summaryrefslogtreecommitdiff
path: root/golang/pkg/model
diff options
context:
space:
mode:
authorJulien Dessaux2024-05-29 23:08:24 +0200
committerJulien Dessaux2024-05-29 23:08:24 +0200
commit860984057d496999949f7b5680997a25b6c660c3 (patch)
tree32653e3f8e89464167d2ae3918a59a40364e020d /golang/pkg/model
parent[golang] fixed golang api client design mistakes (diff)
downloadspacetraders-860984057d496999949f7b5680997a25b6c660c3.tar.gz
spacetraders-860984057d496999949f7b5680997a25b6c660c3.tar.bz2
spacetraders-860984057d496999949f7b5680997a25b6c660c3.zip
[golang] added ships first api calls
Diffstat (limited to '')
-rw-r--r--golang/pkg/model/cargo.go7
-rw-r--r--golang/pkg/model/cooldown.go7
-rw-r--r--golang/pkg/model/fuel.go7
-rw-r--r--golang/pkg/model/inventory.go8
-rw-r--r--golang/pkg/model/nav.go9
-rw-r--r--golang/pkg/model/route.go17
-rw-r--r--golang/pkg/model/ship.go16
7 files changed, 71 insertions, 0 deletions
diff --git a/golang/pkg/model/cargo.go b/golang/pkg/model/cargo.go
new file mode 100644
index 0000000..bf58204
--- /dev/null
+++ b/golang/pkg/model/cargo.go
@@ -0,0 +1,7 @@
+package model
+
+type Cargo struct {
+ Capacity int `json:"capacity"`
+ Inventory []Inventory `json:"inventory"`
+ Units int `json:"units"`
+}
diff --git a/golang/pkg/model/cooldown.go b/golang/pkg/model/cooldown.go
new file mode 100644
index 0000000..e092b4e
--- /dev/null
+++ b/golang/pkg/model/cooldown.go
@@ -0,0 +1,7 @@
+package model
+
+type Cooldown struct {
+ //ShipSymbol int `json:"shipSymbol"`
+ RemainingSeconds int `json:"remainingSeconds"`
+ //TotalSeconds int `json:"totalSeconds"`
+}
diff --git a/golang/pkg/model/fuel.go b/golang/pkg/model/fuel.go
new file mode 100644
index 0000000..395fbdb
--- /dev/null
+++ b/golang/pkg/model/fuel.go
@@ -0,0 +1,7 @@
+package model
+
+type Fuel struct {
+ Capacity int `json:"capacity"`
+ //Consummed
+ Current int `json:"current"`
+}
diff --git a/golang/pkg/model/inventory.go b/golang/pkg/model/inventory.go
new file mode 100644
index 0000000..d685250
--- /dev/null
+++ b/golang/pkg/model/inventory.go
@@ -0,0 +1,8 @@
+package model
+
+type Inventory struct {
+ //Description string `json:"description"`
+ Units int `json:"units"`
+ //Name string `json:"name"`
+ Symbol string `json:"symbol"`
+}
diff --git a/golang/pkg/model/nav.go b/golang/pkg/model/nav.go
new file mode 100644
index 0000000..f9bb930
--- /dev/null
+++ b/golang/pkg/model/nav.go
@@ -0,0 +1,9 @@
+package model
+
+type Nav struct {
+ FlightMode string `json:"flightMode"`
+ Route Route `json:"route"`
+ Status string `json:"status"`
+ SystemSymbol string `json:"systemSymbol"`
+ WaypointSymbol string `json:"waypointSymbol"`
+}
diff --git a/golang/pkg/model/route.go b/golang/pkg/model/route.go
new file mode 100644
index 0000000..0533e61
--- /dev/null
+++ b/golang/pkg/model/route.go
@@ -0,0 +1,17 @@
+package model
+
+import "time"
+
+type Route struct {
+ Arrival time.Time `json:"arrival"`
+ DepartureTime time.Time `json:"departureTime"`
+ Destination RouteEndpoint `json:"destination"`
+}
+
+type RouteEndpoint struct {
+ Type string `json:"type"`
+ Symbol string `json:"symbol"`
+ SystemSymbol string `json:"systemSymbol"`
+ X int `json:"x"`
+ Y int `json:"y"`
+}
diff --git a/golang/pkg/model/ship.go b/golang/pkg/model/ship.go
new file mode 100644
index 0000000..549f09e
--- /dev/null
+++ b/golang/pkg/model/ship.go
@@ -0,0 +1,16 @@
+package model
+
+type Ship struct {
+ Cargo Cargo `json:"cargo"`
+ Cooldown Cooldown `json:"cooldown"`
+ //// crew
+ //// engine
+ //// frame
+ Fuel Fuel `json:"fuel"`
+ //// modules
+ //// mounts
+ Nav Nav `json:"nav"`
+ //// reactor
+ //registration: Registration;
+ Symbol string `json:"symbol"`
+}