[golang] bootstrapped a client in yet another language
This commit is contained in:
parent
5aac233c08
commit
427cc77fa3
12 changed files with 447 additions and 0 deletions
20
golang/pkg/api/register.go
Normal file
20
golang/pkg/api/register.go
Normal 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,
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue