Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Hostname represents the root domain sc2replaystats is hosted at Hostname = "sc2replaystats.com" // Protocol represents the HTTP protocol we use when communicating with sc2replaystats Protocol = "https" // APIRoot represents the base URL for requests to the sc2replaystats JSON-ish API APIRoot = fmt.Sprintf("%s://api.%s", Protocol, Hostname) // WebRoot represents the base URL for requests to the sc2replaystats Website WebRoot = fmt.Sprintf("%s://%s", Protocol, Hostname) // ClientIdentifier represents the "upload_method" shown to sc2replaystats ClientIdentifier = fmt.Sprintf("sc2-rsu-api-%s", runtime.GOOS) )
View Source
var ( // ErrBadKey is the base message shown in all errors returned by ValidAPIKey ErrBadKey = errors.New("invalid sc2replaystats API key") // ErrBadKeyDate means the API key's timestamp was invalid or too old to use ErrBadKeyDate = fmt.Errorf("%s: bad timestamp", ErrBadKey.Error()) // ErrBadKeyLen means the API key's format or length was incorrect ErrBadKeyLen = fmt.Errorf("%s: bad length", ErrBadKey.Error()) )
Functions ¶
func ValidAPIKey ¶
ValidAPIKey checks that the given string matches sc2replaystats API key format
Types ¶
type AccountPlayer ¶
type AccountPlayer struct { ID uint `json:"players_id"` Default uint `json:"default"` Player Player `json:"player"` }
AccountPlayer represents the JSON format of a Player owned by a server Account
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client allows you to communicate with the sc2ReplayStats API
func (*Client) GetAccountPlayers ¶
func (client *Client) GetAccountPlayers() (players []AccountPlayer, err error)
GetAccountPlayers returns an slice of AccountPlayers from the server, showing all those Accounts/Toons associated with the given API key
func (*Client) GetReplayStatus ¶
GetReplayStatus tries to retrieve the replayID associated with a given replayQueueID -- returning an empty string if it's still processing
type Player ¶
type Player struct { ID uint `json:"players_id"` Name string `json:"players_name"` BattleNetURL string `json:"battle_net_url"` BattleTagName string `json:"battle_tag_name"` BattleTagID uint `json:"battle_tag_id"` CharacterID uint `json:"character_link_id"` LegacyBattleTagName string `json:"legacy_battle_tag_name"` LegacyLinkID uint `json:"legacy_link_id"` LegacyLinkRealm uint `json:"legacy_link_realm"` ReplaysURL string `json:"players_replays_url"` Updated time.Time `json:"updated_at"` }
Player represents the JSON format that the server stores Toon/Characters in
Click to show internal directories.
Click to hide internal directories.