Documentation ¶
Index ¶
- Constants
- Variables
- type AccountInfo
- type Client
- type Error
- type FinalStats
- type GlobalWinsLeaderboard
- type Player
- type PlayerV1
- type Session
- func (s *Session) CheckStatus() (bool, error)
- func (s *Session) GetWinsLeaderboard(platform, groupType string) (*GlobalWinsLeaderboard, error)
- func (s *Session) Kill() error
- func (s *Session) QueryPlayer(name string, accountId string) (*Player, error)
- func (s *Session) QueryPlayerById(accountId string) (*statsResponse, error)
- func (s *Session) QueryPlayerByIdV1(accountId string) (*statsResponseV1, error)
- func (s *Session) QueryPlayerV1(name string, accountId string, platform string) (*PlayerV1, error)
- func (s *Session) Refresh() error
- type Stats
- type StatsV1
Constants ¶
const ( PC = "pc" Xbox = "xb1" PS4 = "ps4" TOUCH = "touch" GAMEPAD = "gamepad" KEYBOARDMOUSE = "keyboardmouse" )
Platform types
const ( Solo = "_defaultsolo" Duo = "_defaultduo" Squad = "_defaultsquad" )
Name identifiers for group type. Used in parsing URLs and responses.
const ( SoloV1 = "_p2" DuoV1 = "_p10" SquadV1 = "_p9" )
Name identifiers for group type. Used in parsing URLs and responses.
const Version = "0.1"
Version is the package version.
Variables ¶
var ( AuthBearer = "Bearer" AuthBasic = "Basic" )
Authentication header types
var ErrNotFound = Error{"Character not found."}
ErrNotFound is returned when we receive a 404 when attempting to query a player.
Functions ¶
This section is empty.
Types ¶
type AccountInfo ¶
AccountInfo contains basic information about the user.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is our HTTP client for this package to interface with Epic's API.
type FinalStats ¶
Stats is the structure which holds the player's stats for the 3 different game modes offered in Battle Royal.
type GlobalWinsLeaderboard ¶
type GlobalWinsLeaderboard []leaderboardEntry
GlobalWinsLeaderboard contains an array of the top X players by wins on a specific platform and party mode.
type Player ¶
type Player struct { AccountInfo AccountInfo Stats *FinalStats RawStats map[string]int }
Player is the hierarchical struct used to contain information regarding a player's account info and stats.
type PlayerV1 ¶
type PlayerV1 struct { AccountInfo AccountInfo Stats StatsV1 RawStats map[string]int }
type Session ¶
type Session struct { AccessToken string ExpiresAt string RefreshToken string AccountID string ClientID string // contains filtered or unexported fields }
Session holds connection information regarding a successful authentication with an Epic account to Epic's API. Will hold a Client to use for interfacing with said API, and retain information about our authenticated session with them.
func Create ¶
func Create(email string, password string, launcherToken string, gameToken string) (*Session, int, error)
Create opens a new connection to Epic and authenticates into the game to obtain the necessary access tokens.
func Create2fa ¶
func Create2fa(email string, password string, code string, launcherToken string, gameToken string) (*Session, error)
Create opens a new connection to Epic and authenticates into the game to obtain the necessary access tokens.
func (*Session) CheckStatus ¶
CheckStatus checks the status of the Fortnite game service. Will return false with error containing the status message from Epic.
func (*Session) GetWinsLeaderboard ¶
func (s *Session) GetWinsLeaderboard(platform, groupType string) (*GlobalWinsLeaderboard, error)
GetWinsLeaderboard returns the top 50 players and their rank position based on global wins for a specific platform, and party/group type.
func (*Session) Kill ¶
Kill terminates an existing session by sending a DELETE request to deactivate the session on Epic's servers.
func (*Session) QueryPlayer ¶
QueryPlayer looks up a player by their username and platform, and returns information about that player, namely, the statistics for the 3 different party modes.
func (*Session) QueryPlayerById ¶
func (*Session) QueryPlayerByIdV1 ¶
func (*Session) QueryPlayerV1 ¶
QueryPlayer V1 looks up a player by their username and platform, and returns information about that player, namely, the statistics for the 3 different party modes.