From 860984057d496999949f7b5680997a25b6c660c3 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 29 May 2024 23:08:24 +0200 Subject: [golang] added ships first api calls --- golang/pkg/model/cargo.go | 7 +++++++ golang/pkg/model/cooldown.go | 7 +++++++ golang/pkg/model/fuel.go | 7 +++++++ golang/pkg/model/inventory.go | 8 ++++++++ golang/pkg/model/nav.go | 9 +++++++++ golang/pkg/model/route.go | 17 +++++++++++++++++ golang/pkg/model/ship.go | 16 ++++++++++++++++ 7 files changed, 71 insertions(+) create mode 100644 golang/pkg/model/cargo.go create mode 100644 golang/pkg/model/cooldown.go create mode 100644 golang/pkg/model/fuel.go create mode 100644 golang/pkg/model/inventory.go create mode 100644 golang/pkg/model/nav.go create mode 100644 golang/pkg/model/route.go create mode 100644 golang/pkg/model/ship.go (limited to 'golang/pkg/model') 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"` +} -- cgit v1.2.3