summaryrefslogtreecommitdiff
path: root/golang/pkg/model
diff options
context:
space:
mode:
authorJulien Dessaux2025-02-12 23:55:18 +0100
committerJulien Dessaux2025-02-12 23:55:18 +0100
commit01263017fcd03fa9560ddb8a5013fdf786c7d609 (patch)
tree0179ae4f3d013f26f49182aecef65febb1fd56dc /golang/pkg/model
parent[golang] refactor ships api (diff)
downloadspacetraders-01263017fcd03fa9560ddb8a5013fdf786c7d609.tar.gz
spacetraders-01263017fcd03fa9560ddb8a5013fdf786c7d609.tar.bz2
spacetraders-01263017fcd03fa9560ddb8a5013fdf786c7d609.zip
[golang] implement ship refueling
Diffstat (limited to '')
-rw-r--r--golang/pkg/model/nav.go2
-rw-r--r--golang/pkg/model/register.go4
-rw-r--r--golang/pkg/model/route.go6
-rw-r--r--golang/pkg/model/transaction.go14
4 files changed, 20 insertions, 6 deletions
diff --git a/golang/pkg/model/nav.go b/golang/pkg/model/nav.go
index f9bb930..a0b65c6 100644
--- a/golang/pkg/model/nav.go
+++ b/golang/pkg/model/nav.go
@@ -2,7 +2,7 @@ package model
type Nav struct {
FlightMode string `json:"flightMode"`
- Route Route `json:"route"`
+ Route *Route `json:"route"`
Status string `json:"status"`
SystemSymbol string `json:"systemSymbol"`
WaypointSymbol string `json:"waypointSymbol"`
diff --git a/golang/pkg/model/register.go b/golang/pkg/model/register.go
index cf48b8b..36604cf 100644
--- a/golang/pkg/model/register.go
+++ b/golang/pkg/model/register.go
@@ -1,9 +1,9 @@
package model
type Register struct {
- Agent Agent `json:"agent"`
+ Agent *Agent `json:"agent"`
//contract
//faction
- Ship Ship `json:"ship"`
+ Ship *Ship `json:"ship"`
Token string `json:"token"`
}
diff --git a/golang/pkg/model/route.go b/golang/pkg/model/route.go
index 0533e61..0d104b2 100644
--- a/golang/pkg/model/route.go
+++ b/golang/pkg/model/route.go
@@ -3,9 +3,9 @@ package model
import "time"
type Route struct {
- Arrival time.Time `json:"arrival"`
- DepartureTime time.Time `json:"departureTime"`
- Destination RouteEndpoint `json:"destination"`
+ Arrival time.Time `json:"arrival"`
+ DepartureTime time.Time `json:"departureTime"`
+ Destination *RouteEndpoint `json:"destination"`
}
type RouteEndpoint struct {
diff --git a/golang/pkg/model/transaction.go b/golang/pkg/model/transaction.go
new file mode 100644
index 0000000..ed98636
--- /dev/null
+++ b/golang/pkg/model/transaction.go
@@ -0,0 +1,14 @@
+package model
+
+import "time"
+
+type Transaction struct {
+ PricePerUnit int `json:"pricePerUnit"`
+ ShipSymbol string `json:"shipSymbol"`
+ Timestamp time.Time `json:"timestamp"`
+ TotalPrice int `json:"totalPrice"`
+ TradeSymbol string `json:"tradeSymbol"`
+ Type string `json:"type"`
+ Units int `json:"units"`
+ WaypointSymbol string `json:"waypointSymbol"`
+}