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/register.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 golang/pkg/api/register.go (limited to 'golang/pkg/api/register.go') diff --git a/golang/pkg/api/register.go b/golang/pkg/api/register.go new file mode 100644 index 0000000..4f95e2f --- /dev/null +++ b/golang/pkg/api/register.go @@ -0,0 +1,20 @@ +package api + +type RegisterMessage struct { + //agent + //contract + //faction + //ship + Token string `json:"token"` +} + +func (c *Client) Register(faction, symbol string) (APIMessage[RegisterMessage, any], error) { + type RegisterRequest struct { + Faction string `json:"faction"` + Symbol string `json:"symbol"` + } + return Send[RegisterMessage](c, "POST", "/register", RegisterRequest{ + Faction: faction, + Symbol: symbol, + }) +} -- cgit v1.2.3