Documentation ¶
Index ¶
- type APIError
- type Client
- func (c *Client) GetServer(ctx context.Context, version, server string) (Server, error)
- func (c *Client) GetTribeByID(ctx context.Context, version, server string, id int64) (Tribe, error)
- func (c *Client) ListEnnoblements(ctx context.Context, version, server string, ...) ([]Ennoblement, error)
- func (c *Client) ListServers(ctx context.Context, version string, params ListServersQueryParams) ([]Server, error)
- func (c *Client) ListTribes(ctx context.Context, version, server string, params ListTribesQueryParams) ([]Tribe, error)
- func (c *Client) ListVersions(ctx context.Context) ([]Version, error)
- func (c *Client) ListVillages(ctx context.Context, version, server string, params ListVillagesQueryParams) ([]Village, error)
- type ClientOption
- type Ennoblement
- type EnnoblementSort
- type ErrorCode
- type ListEnnoblementsQueryParams
- type ListServersQueryParams
- type ListTribesQueryParams
- type ListVillagesQueryParams
- type NullBool
- type NullPlayerMeta
- type NullTribeMeta
- type PlayerMeta
- type Server
- type Tribe
- type TribeMeta
- type Version
- type Village
- type VillageMeta
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
}
func (*Client) GetTribeByID ¶
func (*Client) ListEnnoblements ¶
func (c *Client) ListEnnoblements( ctx context.Context, version, server string, params ListEnnoblementsQueryParams, ) ([]Ennoblement, error)
func (*Client) ListServers ¶ added in v0.1.3
func (*Client) ListTribes ¶ added in v0.1.6
func (*Client) ListVillages ¶ added in v0.4.1
type ClientOption ¶
type ClientOption func(c *Client)
func WithHTTPClient ¶
func WithHTTPClient(hc *http.Client) ClientOption
func WithRateLimiter ¶ added in v0.4.0
func WithRateLimiter(rl *rate.Limiter) ClientOption
func WithUserAgent ¶
func WithUserAgent(ua string) ClientOption
type Ennoblement ¶
type Ennoblement struct { ID int64 `json:"id"` Village VillageMeta `json:"village"` NewOwner NullPlayerMeta `json:"newOwner"` CreatedAt time.Time `json:"createdAt"` }
type EnnoblementSort ¶ added in v0.4.0
type EnnoblementSort string
const (
EnnoblementSortCreatedAtASC EnnoblementSort = "createdAt:ASC"
)
func (EnnoblementSort) String ¶ added in v0.4.0
func (s EnnoblementSort) String() string
type ListEnnoblementsQueryParams ¶
type ListEnnoblementsQueryParams struct { Limit int32 Offset int32 Since time.Time Sort []EnnoblementSort }
type ListServersQueryParams ¶ added in v0.1.3
type ListTribesQueryParams ¶ added in v0.1.6
type ListVillagesQueryParams ¶ added in v0.4.1
type NullPlayerMeta ¶
type NullPlayerMeta struct { Player PlayerMeta Valid bool }
func (NullPlayerMeta) MarshalJSON ¶
func (p NullPlayerMeta) MarshalJSON() ([]byte, error)
func (*NullPlayerMeta) UnmarshalJSON ¶
func (p *NullPlayerMeta) UnmarshalJSON(data []byte) error
type NullTribeMeta ¶
func (NullTribeMeta) MarshalJSON ¶
func (t NullTribeMeta) MarshalJSON() ([]byte, error)
func (*NullTribeMeta) UnmarshalJSON ¶
func (t *NullTribeMeta) UnmarshalJSON(data []byte) error
type PlayerMeta ¶
type PlayerMeta struct { ID int64 `json:"id"` Name string `json:"name"` ProfileURL string `json:"profileUrl"` Tribe NullTribeMeta `json:"tribe"` }
type VillageMeta ¶
type VillageMeta struct { ID int64 `json:"id"` FullName string `json:"fullName"` ProfileURL string `json:"profileUrl"` Player NullPlayerMeta `json:"player"` }
Click to show internal directories.
Click to hide internal directories.