From 427cc77fa3633aca7c4c3377fa26b0e70921a7b5 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 6 May 2024 00:18:22 +0200 Subject: [golang] bootstrapped a client in yet another language --- golang/pkg/api/agents.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 golang/pkg/api/agents.go (limited to 'golang/pkg/api/agents.go') 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) +} -- cgit v1.2.3