Documentation ¶
Index ¶
- Variables
- type Badge
- type CacheInfo
- type CacheTime
- type Client
- func (c *Client) GetCutoffs(ctx context.Context) ([]RankRange, error)
- func (c *Client) GetLeagueLB(ctx context.Context, country string) ([]LeagueUser, error)
- func (c *Client) GetLeagueLBGlobal(ctx context.Context) ([]LeagueUser, error)
- func (c *Client) GetMatches(ctx context.Context, userID string) ([]LeagueRecord, error)
- func (c *Client) GetUser(ctx context.Context, name string) (*FullUser, error)
- func (c *Client) SearchUser(ctx context.Context, discordID string) (PartialUser, error)
- func (c *Client) Session() Session
- type DiscordInfo
- type Error
- type FullTLStats
- type FullUser
- type Handling
- type LeaguePlayer
- type LeagueRecord
- type LeagueUser
- type NoUserError
- type PartialTLStats
- type PartialUser
- type RankRange
- type Response
- type Session
- func (s Session) GetCutoffs(ctx context.Context) ([]RankRange, error)
- func (s Session) GetLeagueLB(ctx context.Context, country string) ([]LeagueUser, error)
- func (s Session) GetLeagueLBGlobal(ctx context.Context) ([]LeagueUser, error)
- func (s Session) GetMatches(ctx context.Context, userID string) ([]LeagueRecord, error)
- func (s Session) GetUser(ctx context.Context, name string) (*FullUser, error)
- func (s Session) SearchUser(ctx context.Context, discordID string) (PartialUser, error)
- type StatusError
- type TenchiDump
- type UserSnapshot
- type VersusStats
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClient = NewClient(nil)
View Source
var ErrAmbiguousRecord = errors.New("tetrio: record has no winner or loser")
View Source
var ErrNonMultiRecord = errors.New("tetrio: not a multiplayer record")
Functions ¶
This section is empty.
Types ¶
type CacheInfo ¶ added in v1.0.0
type Client ¶ added in v1.1.0
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetCutoffs ¶ added in v1.1.0
func (*Client) GetLeagueLB ¶ added in v1.1.0
func (*Client) GetLeagueLBGlobal ¶ added in v1.1.0
func (c *Client) GetLeagueLBGlobal(ctx context.Context) ([]LeagueUser, error)
func (*Client) GetMatches ¶ added in v1.1.0
func (*Client) SearchUser ¶ added in v1.1.0
type DiscordInfo ¶
type Error ¶ added in v1.0.0
type Error string // The API returns string errors so... not much can be done.
type FullTLStats ¶ added in v1.0.0
type FullUser ¶ added in v1.0.0
type FullUser struct { LeagueUser League FullTLStats `json:"league"` TS time.Time `json:"ts"` BotMaster string `json:"botmaster"` Badges []Badge `json:"badges"` GamesPlayed int `json:"gamesplayed"` GamesWon int `json:"gameswon"` GameTime float64 `json:"gametime"` BadStanding bool `json:"badstanding"` SupporterTier int `json:"supporter_tier"` AvatarRevision int64 `json:"avatar_revision"` BannerRevision int64 `json:"banner_revision"` Bio string `json:"bio"` FriendCount int `json:"friend_count"` Connections struct { Discord DiscordInfo } `json:"connections"` Distinguishment struct { Type string } `json:"distinguishment"` }
type Handling ¶
type Handling struct { ARR float64 `json:"arr"` DAS float64 `json:"das"` DCD float64 `json:"dcd"` SDF int `json:"sdf"` SafeLock bool `json:"safelock"` Cancel bool `json:"cancel"` }
Handling is the in game handling settings.
type LeaguePlayer ¶
type LeaguePlayer struct { User PartialUser Wins int Inputs int PiecesPlaced int Handling Handling Stats VersusStats RoundStats []VersusStats }
type LeagueRecord ¶ added in v0.3.0
type LeagueRecord struct { ReplayID string TS time.Time IsForfeit bool Winner LeaguePlayer Loser LeaguePlayer }
func GetMatches ¶ added in v1.0.0
func GetMatches(userID string) ([]LeagueRecord, error)
func (*LeagueRecord) UnmarshalJSON ¶ added in v0.3.0
func (g *LeagueRecord) UnmarshalJSON(data []byte) error
type LeagueUser ¶ added in v1.0.0
type LeagueUser struct { PartialUser Role string `json:"role"` XP *float64 `json:"xp"` Country *string `json:"country"` Supporter bool `json:"supporter"` Verified *bool `json:"verified"` League PartialTLStats `json:"league"` }
func GetLeagueLB ¶ added in v1.0.0
func GetLeagueLB(country string) ([]LeagueUser, error)
func GetLeagueLBGlobal ¶ added in v1.0.0
func GetLeagueLBGlobal() ([]LeagueUser, error)
type NoUserError ¶ added in v1.0.0
type NoUserError struct { UID string // contains filtered or unexported fields }
func (NoUserError) Error ¶ added in v1.0.0
func (e NoUserError) Error() string
func (NoUserError) Unwrap ¶ added in v1.0.0
func (e NoUserError) Unwrap() error
type PartialTLStats ¶ added in v1.0.0
type PartialTLStats struct { // Standing isn't returned by the API for the TETRA LEAGUE leaderboard list. // It is filled in by the library. // // The #1 ranked player has Standing 1. (not 0) Standing int `json:"standing"` GamesPlayed int `json:"gamesplayed"` GamesWon int `json:"gameswon"` Rating float64 `json:"rating"` Rank string `json:"rank"` BestRank *string `json:"bestrank,omitempty"` Glicko float64 `json:"glicko"` RD float64 `json:"rd"` APM float64 `json:"apm"` PPS float64 `json:"pps"` VS *float64 `json:"vs,omitempty"` Decaying *bool `json:"decaying,omitempty"` }
type PartialUser ¶
func SearchUser ¶ added in v1.0.0
func SearchUser(discordID string) (PartialUser, error)
type RankRange ¶ added in v1.0.0
type RankRange struct { Rank string Percentile float64 Top *LeagueUser Bottom *LeagueUser }
func GetCutoffs ¶ added in v1.0.0
type Response ¶ added in v1.0.0
type Response struct { Success bool `json:"success"` Error json.RawMessage `json:"error"` Data json.RawMessage `json:"data"` Cache CacheInfo `json:"cache"` }
type Session ¶ added in v1.1.0
type Session struct { ID string // contains filtered or unexported fields }
func (Session) GetCutoffs ¶ added in v1.1.0
func (Session) GetLeagueLB ¶ added in v1.1.0
func (Session) GetLeagueLBGlobal ¶ added in v1.1.0
func (s Session) GetLeagueLBGlobal(ctx context.Context) ([]LeagueUser, error)
func (Session) GetMatches ¶ added in v1.1.0
func (Session) SearchUser ¶ added in v1.1.0
SearchUser returns the PartialUser that has their Discord account linked with TETR.IO. returns a zero PartialUser if no user is found.
type StatusError ¶ added in v1.0.0
func (StatusError) Error ¶ added in v1.0.0
func (e StatusError) Error() string
type TenchiDump ¶ added in v1.0.0
type TenchiDump struct { Success bool `json:"success"` Users []LeagueUser `json:"users"` TS time.Time `json:"ts"` }
type UserSnapshot ¶ added in v1.0.0
type UserSnapshot struct { TS time.Time `json:"ts"` User LeagueUser `json:"user"` }
type VersusStats ¶
type VersusStats struct { APM float64 `json:"apm"` // Attacks per minute PPS float64 `json:"pps"` // Pieces per second VS float64 `json:"vs"` // Versus score }
VersusStats is the statistics for multiplayer games.
Click to show internal directories.
Click to hide internal directories.