summaryrefslogtreecommitdiff
path: root/golang/pkg/api/register.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/register.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 'golang/pkg/api/register.go')
-rw-r--r--golang/pkg/api/register.go20
1 files changed, 20 insertions, 0 deletions
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,
+ })
+}