summaryrefslogtreecommitdiff
path: root/golang/pkg/api/contracts.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--golang/pkg/api/contracts.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/golang/pkg/api/contracts.go b/golang/pkg/api/contracts.go
new file mode 100644
index 0000000..f82ee6d
--- /dev/null
+++ b/golang/pkg/api/contracts.go
@@ -0,0 +1,17 @@
+package api
+
+import (
+ "fmt"
+ "net/url"
+
+ "git.adyxax.org/adyxax/spacetraders/golang/pkg/model"
+)
+
+func (c *Client) MyContracts() ([]model.Contract, error) {
+ uriRef := url.URL{Path: "my/contracts"}
+ var contracts []model.Contract
+ if err := c.Send("GET", &uriRef, nil, &contracts); err != nil {
+ return nil, fmt.Errorf("failed to get contracts: %w", err)
+ }
+ return contracts, nil
+}