1
0
Fork 0

[golang] bootstrapped a client in yet another language

This commit is contained in:
Julien Dessaux 2024-05-06 00:18:22 +02:00
parent 5aac233c08
commit 427cc77fa3
Signed by: adyxax
GPG key ID: F92E51B86E07177E
12 changed files with 447 additions and 0 deletions

View file

@ -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,
})
}