blob: 39db7902e51307c2616e0807fadcca67f91f5935 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package api
import (
"net/url"
"git.adyxax.org/adyxax/spacetraders/golang/pkg/model"
)
func (c *Client) Register(faction, symbol string) (*model.Register, error) {
type RegisterRequest struct {
Faction string `json:"faction"`
Symbol string `json:"symbol"`
}
uriRef := url.URL{Path: "register"}
payload := RegisterRequest{
Faction: faction,
Symbol: symbol,
}
var response model.Register
err := c.Send("POST", &uriRef, payload, &response)
if err != nil {
return nil, err
}
return &response, nil
}
|