summaryrefslogtreecommitdiff
path: root/golang/pkg/api/agents.go
diff options
context:
space:
mode:
authorJulien Dessaux2024-05-06 00:18:22 +0200
committerJulien Dessaux2024-05-06 00:18:22 +0200
commit427cc77fa3633aca7c4c3377fa26b0e70921a7b5 (patch)
treecc8de99037ab539a0786f568cf217b680ac99ec3 /golang/pkg/api/agents.go
parent[node] fix shortest path to only hop through refueling points (diff)
downloadspacetraders-427cc77fa3633aca7c4c3377fa26b0e70921a7b5.tar.gz
spacetraders-427cc77fa3633aca7c4c3377fa26b0e70921a7b5.tar.bz2
spacetraders-427cc77fa3633aca7c4c3377fa26b0e70921a7b5.zip
[golang] bootstrapped a client in yet another language
Diffstat (limited to '')
-rw-r--r--golang/pkg/api/agents.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/golang/pkg/api/agents.go b/golang/pkg/api/agents.go
new file mode 100644
index 0000000..aa8107a
--- /dev/null
+++ b/golang/pkg/api/agents.go
@@ -0,0 +1,14 @@
+package api
+
+type AgentMessage struct {
+ AccountID string `json:"accountId"`
+ Credits int `json:"credits"`
+ Headquarters string `json:"headquarters"`
+ ShipCount int `json:"shipCount"`
+ StartingFaction string `json:"startingFaction"`
+ Symbol string `json:"symbol"`
+}
+
+func (c *Client) MyAgent() (APIMessage[AgentMessage, any], error) {
+ return Send[AgentMessage](c, "GET", "/my/agent", nil)
+}