summaryrefslogtreecommitdiff
path: root/golang/pkg/api/agents.go
blob: a2d5b6a7b10c472671d067d3416ee065af7f2f89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package api

import (
	"net/url"

	"git.adyxax.org/adyxax/spacetraders/v2/pkg/model"
)

func (c *Client) MyAgent() (*model.Agent, error) {
	uriRef := url.URL{Path: "my/agent"}
	var response model.Agent
	err := c.Send("GET", &uriRef, nil, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}