Documentation
¶
Overview ¶
Package vimeworld implements client to VimeWorld API.
Index ¶
- type Achievement
- type Achievements
- type AvailableLeaderboard
- type Client
- func (c *Client) BareDo(ctx context.Context, req *http.Request) (*http.Response, error)
- func (c *Client) Do(ctx context.Context, req *http.Request, v any) (*http.Response, error)
- func (c *Client) GetAchievements(ctx context.Context) (*Achievements, error)
- func (c *Client) GetGames(ctx context.Context) ([]*Game, error)
- func (c *Client) GetGuildByID(ctx context.Context, id int) (*Guild, error)
- func (c *Client) GetGuildByName(ctx context.Context, name string) (*Guild, error)
- func (c *Client) GetGuildByTag(ctx context.Context, tag string) (*Guild, error)
- func (c *Client) GetLeaderboard(ctx context.Context, boardType, sort string, size, offset int) (*Leaderboard, error)
- func (c *Client) GetLeaderboardList(ctx context.Context) ([]*AvailableLeaderboard, error)
- func (c *Client) GetLocaleByName(ctx context.Context, name string, parts ...string) (*Locale, error)
- func (c *Client) GetMaps(ctx context.Context) (*Maps, error)
- func (c *Client) GetMatchLatest(ctx context.Context) ([]*Match, error)
- func (c *Client) GetMatchListAfter(ctx context.Context, after string, count int) ([]*Match, error)
- func (c *Client) GetMatchListBefore(ctx context.Context, before string, count int) ([]*Match, error)
- func (c *Client) GetOnline(ctx context.Context) (*Online, error)
- func (c *Client) GetOnlineStaff(ctx context.Context) ([]*User, error)
- func (c *Client) GetOnlineStreams(ctx context.Context) ([]*OnlineStream, error)
- func (c *Client) GetTokenInfo(ctx context.Context, token string) (*Token, error)
- func (c *Client) GetUserAchievements(ctx context.Context, id int) (*UserAchievements, error)
- func (c *Client) GetUserFriends(ctx context.Context, id int) (*Friends, error)
- func (c *Client) GetUserLeaderboards(ctx context.Context, id int) (*UserLeaderboards, error)
- func (c *Client) GetUserMatchesAfter(ctx context.Context, id int, after string, count int) (*UserMatches, error)
- func (c *Client) GetUserMatchesBefore(ctx context.Context, id int, before string, count int) (*UserMatches, error)
- func (c *Client) GetUserMatchesOffset(ctx context.Context, id, offset, count int) (*UserMatches, error)
- func (c *Client) GetUserSession(ctx context.Context, id int) (*Session, error)
- func (c *Client) GetUserStats(ctx context.Context, id int, games ...string) (*UserStats, error)
- func (c *Client) GetUsersByIDs(ctx context.Context, ids ...int) ([]*User, error)
- func (c *Client) GetUsersByNames(ctx context.Context, names ...string) ([]*User, error)
- func (c *Client) GetUsersSessions(ctx context.Context, ids ...int) ([]*UserSession, error)
- func (c *Client) GuildSearch(ctx context.Context, query string) ([]*UserGuild, error)
- func (c *Client) NewRequest(method, urlStr string, body any) (*http.Request, error)
- type Error
- type ErrorResponse
- type Friends
- type Game
- type GameLocale
- type GameSessionsStats
- type Guild
- type GuildMember
- type GuildPerk
- type Leaderboard
- type LeaderboardResponseMeta
- type Locale
- type Map
- type Maps
- type Match
- type MatchMap
- type Online
- type OnlineSession
- type OnlineStream
- type Options
- type RankLocale
- type Session
- type Token
- type User
- type UserAchievement
- type UserAchievements
- type UserGuild
- type UserLeaderboard
- type UserLeaderboards
- type UserMatch
- type UserMatches
- type UserMatchesRequest
- type UserSession
- type UserStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Achievement ¶
type Achievement struct {
ID int `json:"id"`
Title string `json:"title"`
Reward int `json:"reward"`
Description []string `json:"description"`
}
Achievement struct.
type AvailableLeaderboard ¶
type AvailableLeaderboard struct {
Type string `json:"type"`
Description string `json:"description"`
MaxSize int `json:"max_size"`
Sort []string `json:"sort"`
Season string `json:"season"`
}
AvailableLeaderboard struct.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for VimeWorld API.
func (*Client) GetAchievements ¶
func (c *Client) GetAchievements(ctx context.Context) (*Achievements, error)
GetAchievements returns achievements.
func (*Client) GetGuildByID ¶
GetGuildByID returns guild by ID.
func (*Client) GetGuildByName ¶
GetGuildByName returns guild by name.
func (*Client) GetGuildByTag ¶
GetGuildByTag returns guild by tag.
func (*Client) GetLeaderboard ¶
func (c *Client) GetLeaderboard(ctx context.Context, boardType, sort string, size, offset int) (*Leaderboard, error)
GetLeaderboard returns leaderboard.
func (*Client) GetLeaderboardList ¶
func (c *Client) GetLeaderboardList(ctx context.Context) ([]*AvailableLeaderboard, error)
GetLeaderboardList returns available leaderboards.
func (*Client) GetLocaleByName ¶
func (c *Client) GetLocaleByName(ctx context.Context, name string, parts ...string) (*Locale, error)
GetLocaleByName returns locale by name.
func (*Client) GetMatchLatest ¶
GetMatchLatest returns latest matches.
func (*Client) GetMatchListAfter ¶
GetMatchListAfter returns matches after ID.
func (*Client) GetMatchListBefore ¶
func (c *Client) GetMatchListBefore(ctx context.Context, before string, count int) ([]*Match, error)
GetMatchListBefore returns matches before ID.
func (*Client) GetOnlineStaff ¶
GetOnlineStaff returns online staff.
func (*Client) GetOnlineStreams ¶
func (c *Client) GetOnlineStreams(ctx context.Context) ([]*OnlineStream, error)
GetOnlineStreams returns online streams.
func (*Client) GetTokenInfo ¶
GetTokenInfo returns token info by token.
func (*Client) GetUserAchievements ¶
GetUserAchievements return user achievements by ID.
func (*Client) GetUserFriends ¶
GetUserFriends return Friend list of user by ID.
func (*Client) GetUserLeaderboards ¶
GetUserLeaderboards returns user leaderboard by ID.
func (*Client) GetUserMatchesAfter ¶
func (c *Client) GetUserMatchesAfter(ctx context.Context, id int, after string, count int) (*UserMatches, error)
GetUserMatchesAfter return matches after id.
func (*Client) GetUserMatchesBefore ¶
func (c *Client) GetUserMatchesBefore(ctx context.Context, id int, before string, count int) (*UserMatches, error)
GetUserMatchesBefore return matches before id.
func (*Client) GetUserMatchesOffset ¶
func (c *Client) GetUserMatchesOffset(ctx context.Context, id, offset, count int) (*UserMatches, error)
GetUserMatchesOffset return matches by offset.
func (*Client) GetUserSession ¶
GetUserSession return user session by ID.
func (*Client) GetUserStats ¶
GetUserStats return user stats by ID
func (*Client) GetUsersByIDs ¶ added in v1.0.2
GetUsersByIDs return users by ids.
func (*Client) GetUsersByNames ¶
GetUsersByNames return users by names.
func (*Client) GetUsersSessions ¶
GetUsersSessions return user sessions by ids.
func (*Client) GuildSearch ¶
GuildSearch returns guilds by query.
type Error ¶
type Error struct {
ErrorCode int `json:"error_code"`
ErrorMsg string `json:"error_msg"`
Comment string `json:"comment"`
}
Error is a api error.
type Game ¶
type Game struct {
ID string `json:"id"`
Name string `json:"name"`
GlobalStats []string `json:"global_stats"`
SeasonStats GameSessionsStats `json:"season_stats"`
}
Game struct.
type GameSessionsStats ¶ added in v1.0.2
GameSessionsStats ...
type Guild ¶
type Guild struct {
ID int `json:"id"`
Name string `json:"name"`
Tag string `json:"tag"`
Color string `json:"color"`
Level int `json:"level"`
LevelPercentage float64 `json:"levelPercentage"`
AvatarURL string `json:"avatar_url"`
TotalExp int `json:"totalExp"`
TotalCoins int `json:"totalCoins"`
Created int `json:"created"`
WebInfo string `json:"web_info"`
Perks map[string]GuildPerk `json:"perks"`
Members []GuildMember `json:"members"`
}
Guild struct.
type GuildMember ¶
type GuildMember struct {
User User `json:"user"`
Status string `json:"status"`
Joined int `json:"joined"`
GuildCoins int `json:"guildCoins"`
GuildExp int `json:"guildExp"`
}
GuildMember struct.
type Leaderboard ¶
type Leaderboard struct {
Meta LeaderboardResponseMeta `json:"leaderboard"`
Records []any `json:"records"`
}
Leaderboard struct.
type LeaderboardResponseMeta ¶
type LeaderboardResponseMeta struct {
Type string `json:"type"`
Sort string `json:"sort"`
Offset int `json:"offset"`
Size int `json:"size"`
MaxSize int `json:"max_size"`
}
LeaderboardResponseMeta struct.
type Locale ¶
type Locale struct {
Games map[string]GameLocale `json:"games"`
GameStats map[string]map[string]any `json:"game_stats"`
Ranks map[string]RankLocale `json:"ranks"`
}
Locale struct.
type Map ¶
type Map struct {
Name string `json:"name"`
Teams int `json:"teams"`
PlayersInTeam int `json:"playersInTeam"`
}
Map struct.
type Match ¶
type Match struct {
ID string `json:"id"`
Game string `json:"game"`
Map MatchMap `json:"map"`
Date int64 `json:"date"`
Duration int `json:"duration"`
Players int `json:"players"`
}
Match struct.
type MatchMap ¶
type MatchMap struct {
ID string `json:"id"`
Name string `json:"name"`
Teams int `json:"teams"`
PlayersInTeam int `json:"playersInTeam"`
}
MatchMap struct.
type OnlineSession ¶
type OnlineSession struct {
Value bool `json:"value"`
Message string `json:"message"`
Game string `json:"game"`
}
OnlineSession struct.
type OnlineStream ¶
type OnlineStream struct {
Title string `json:"title"`
Owner string `json:"owner"`
Viewers int `json:"viewers"`
URL string `json:"url"`
Duration int `json:"duration"`
Platform string `json:"platform"`
User User `json:"user"`
}
OnlineStream struct.
type RankLocale ¶
RankLocale struct.
type Session ¶
type Session struct {
User User `json:"user"`
Online OnlineSession `json:"online"`
}
Session struct.
type Token ¶
type Token struct {
Token string `json:"token"`
Valid bool `json:"valid"`
Type string `json:"type"`
Limit int `json:"limit"`
Owner *User `json:"owner"`
}
Token struct.
type User ¶
type User struct {
ID int `json:"id"`
Username string `json:"username"`
Level int `json:"level"`
LevelPercentage float64 `json:"levelPercentage"`
Rank string `json:"rank"`
PlayedSeconds int64 `json:"playedSeconds"`
LastSeen int64 `json:"lastSeen"`
Guild *UserGuild `json:"guild"`
}
User struct.
type UserAchievement ¶
UserAchievement struct.
type UserAchievements ¶
type UserAchievements struct {
User User `json:"user"`
Achievements []UserAchievement `json:"achievements"`
}
UserAchievements struct.
type UserGuild ¶
type UserGuild struct {
ID int `json:"id"`
Name string `json:"name"`
Tag string `json:"tag"`
Color string `json:"color"`
Level int `json:"level"`
LevelPercentage float64 `json:"levelPercentage"`
AvatarURL string `json:"avatar_url"`
}
UserGuild struct.
type UserLeaderboard ¶
type UserLeaderboard struct {
Type string `json:"type"`
Sort string `json:"sort"`
Place int `json:"place"`
}
UserLeaderboard struct.
type UserLeaderboards ¶
type UserLeaderboards struct {
User User `json:"user"`
Leaderboards []UserLeaderboard `json:"leaderboards"`
}
UserLeaderboards struct.
type UserMatch ¶
type UserMatch struct {
ID string `json:"id"`
Game string `json:"game"`
Map MatchMap `json:"map"`
Date int `json:"date"`
Duration int `json:"duration"`
Players int `json:"players"`
Win bool `json:"win"`
State int `json:"state"`
}
UserMatch struct.
type UserMatches ¶
type UserMatches struct {
User User `json:"user"`
Request UserMatchesRequest `json:"request"`
Matches []UserMatch `json:"matches"`
}
UserMatches struct.
type UserMatchesRequest ¶ added in v1.0.2
type UserMatchesRequest struct {
Count int `json:"count"`
Offset int `json:"offset"`
Size int `json:"size"`
}
UserMatchesRequest ...
type UserSession ¶
type UserSession struct {
User
Online OnlineSession `json:"online"`
}
UserSession struct.