client

package
v0.0.0-...-bf9dc68 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client for communication with chess.com API servers.

func NewClient

func NewClient(username string) *Client

NewClient returns pointer to new client.

func (*Client) GetCountryByURL

func (c *Client) GetCountryByURL(countryURL string) (*model.Country, error)

GetCountryByURL fetches full country entity from https://api.chess.com/pub/country/{country_code}.

func (*Client) GetMonthlyGameArchive

func (c *Client) GetMonthlyGameArchive(url string) ([]model.Game, error)

GetMonthlyGameArchive returns list of URLS in the form of https://api.chess.com/pub/player/{username}/games/{YYYY}/{MM}.

func (*Client) GetMonthlyGameArchivesURLList

func (c *Client) GetMonthlyGameArchivesURLList() ([]string, error)

GetMonthlyGameArchivesURLList returns list of URLS in the form of https://api.chess.com/pub/player/{username}/games/{YYYY}/{MM}.

func (*Client) GetPlayerByUsername

func (c *Client) GetPlayerByUsername(username string) (*model.Player, error)

GetPlayerByUsername returns chess.com user from https://api.chess.com/pub/player/{username}.

type Games

type Games struct {
	Games []model.Game `json:"games"`
}

Games are how games are returned by https://api.chess.com/pub/player/{username}/games/{YYYY}/{MM}.

Jump to

Keyboard shortcuts

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