api

package
v0.0.0-...-5bf8448 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package api allows interaction with the SoT API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client allows querying SoT API endpoints

func NewClient

func NewClient(ratToken string, locale language.Tag, logger *slog.Logger) *Client

NewClient creates a new API client with the specified token

func (*Client) GetBalance

func (c *Client) GetBalance() (b structs.Balance, err error)

GetBalance retrieves the balance of in-game currencies for the pirate

func (*Client) GetHealth

func (c *Client) GetHealth() (h structs.Health, err error)

GetHealth retrieves data about the status of the API

func (*Client) GetReputation

func (c *Client) GetReputation() (r structs.Reputation, err error)

GetReputation retrieves the reputation for all available campaigns

func (*Client) GetSeason

func (c *Client) GetSeason() (s structs.Season, err error)

GetSeason retrieves data about the current active season

type RequestError

type RequestError struct {
	StatusCode int
	Err        error
}

RequestError is returned as error when a non-200 HTTP response is received

func (RequestError) Error

func (r RequestError) Error() string

Directories

Path Synopsis
Package structs contains structs for API responses
Package structs contains structs for API responses

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL