pubg

package module
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 10 Imported by: 0

README

PUBG

Go Reference Build Status Go Report Card

This is a Go client library for gathering PUBG API reference data

Relevant for V22.1.0

Table of Contents

Getting Started

Download the PUBG library:

go get github.com/NovikovRoman/pubg

Usage Example

pubgClient := pubg.NewClient(apikey, nil)

if !pubgClient.Status() {
 log.Fatalln("PUBG API not working.")
}

tournaments, err := pubgClient.Tournaments()
if err != nil {
 if e, ok := err.(*pubg.ErrBadRequest); ok {
  log.Fatalln("Bad request", e, e.GetDetail())

 } else if e, ok := err.(*pubg.ErrUnauthorized); ok {
  log.Fatalln("Unauthorized", e, e.GetDetail())

 } else if e, ok := err.(*pubg.ErrNotFound); ok {
  log.Fatalln("Not found", e, e.GetDetail())

 } else if e, ok := err.(*pubg.ErrUnsupportedMediaType); ok {
  log.Fatalln("Unsupported media type", e, e.GetDetail())

 } else if e, ok := err.(*pubg.ErrTooManyRequest); ok {
  log.Fatalln("Too many request", e, e.GetDetail())
 }

 log.Fatalln(err)
}

for _, t := range tournaments.Data {
 fmt.Println(t.ID, t.Attributes.CreatedAt)
}

See the example of using telemetry in the telemetry_test.go.

Tests

PAUSE=true [PROXY=…] APIKEY=… go test

Documentation

See the PUBG API reference.

Documentation

Index

Constants

View Source
const (
	// SoloMode - Solo
	SoloMode = "solo"
	// SoloFPPMode - Solo FPP
	SoloFPPMode = "solo-fpp"
	// DuoMode - Duo
	DuoMode = "duo"
	// DuoFPPMode - Duo FPP
	DuoFPPMode = "duo-fpp"
	// SquadMode - Squad
	SquadMode = "squad"
	// SquadFPPMode - Squad FPP
	SquadFPPMode = "squad-fpp"
)
View Source
const (
	// EmptyPlatform the platform is not specified
	EmptyPlatform = ""
	// SteamPlatform - Steam
	SteamPlatform = "steam"
	// PsnPlatform - PS4
	PsnPlatform = "psn"
	// XboxPlatform - Xbox
	XboxPlatform = "xbox"
	// KakaoPlatform - Kakao
	KakaoPlatform = "kakao"
	// ConsolePlatform - Console
	ConsolePlatform = "console"
	// TournamentPlatform - Tournament
	TournamentPlatform = "tournament"
	// StadiaPlatform - Stadia
	StadiaPlatform = "stadia"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Clan added in v1.5.0

type Clan struct {
	Data struct {
		// Identifier for this object type ("clan")
		Type string `json:"type"`
		// Clan ID
		ID         string `json:"id"`
		Attributes struct {
			ClanName        string `json:"clanName"`
			ClanTag         string `json:"clanTag"`
			ClanLevel       int    `json:"clanLevel"`
			ClanMemberCount int    `json:"clanMemberCount"`
		} `json:"attributes"`
	} `json:"data"`
	Links links `json:"links"`
}

Clan structure.

type Client

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

Client structure.

func NewClient

func NewClient(apikey string, transport *http.Transport) *Client

NewClient create new PUBG Client structure. This structure will be used to acquire make API calls.

func (Client) Clans added in v1.5.0

func (c Client) Clans(platform Platform, clanID string) (clan *Clan, err error)

Clans returns information about the clan.

func (Client) Leaderboards

func (c Client) Leaderboards(platform Platform, seasonID string, gameMode GameMode) (leaderboard *Leaderboard, err error)

Leaderboards returns the leaderboard for a game mode.

func (Client) LifetimeStatsPlayer

func (c Client) LifetimeStatsPlayer(platform Platform, accountID string) (stats *LifetimeStatsPlayer, err error)

LifetimeStatsPlayer returns lifetime stats for a single player.

func (Client) LifetimeStatsPlayers

func (c Client) LifetimeStatsPlayers(platform Platform, gameMode GameMode, accountID ...string) (stats *LifetimeStatsPlayers, err error)

LifetimeStatsPlayers returns lifetime stats for up to 10 players.

func (Client) Matches deprecated

func (c Client) Matches(platform Platform, matchID string) (matches *Matches, err error)

Deprecated: Matches returns a single match.

func (Client) Player

func (c Client) Player(platform Platform, accountID string) (player *Player, err error)

Player returns a single player.

func (Client) PlayersByIDs

func (c Client) PlayersByIDs(platform Platform, accountID ...string) (players *Players, err error)

PlayersByIDs returns a collection of up to 10 players by IDs.

func (Client) PlayersByNames

func (c Client) PlayersByNames(platform Platform, name ...string) (players *Players, err error)

PlayersByNames returns a collection of up to 10 players by names.

func (Client) RankedStatsPlayer

func (c Client) RankedStatsPlayer(platform Platform, seasonID, accountID string) (stats *RankedStatsPlayer, err error)

RankedStats returns ranked stats for a single player.

func (Client) Samples

func (c Client) Samples(platform Platform, start time.Time) (samples *Samples, err error)

Samples returns a list of sample matches.

The number of matches per shard may vary. Requests for samples need to be at least 24hrs in the past UTC time using the `start` query parameter. The default if not specified is the latest sample.

The starting search date in UTC.

Usage: 2018-01-01T00:00:00Z // Note this time will not work

Default: time.Now() - 24hrs

func (Client) SeasonStatsPlayer

func (c Client) SeasonStatsPlayer(platform Platform, seasonID, accountID string) (stats *SeasonStatsPlayer, err error)

SeasonStatsPlayer returns a season information for a single player.

func (Client) SeasonStatsPlayers

func (c Client) SeasonStatsPlayers(platform Platform, seasonID string, gameMode GameMode, accountID ...string) (stats *SeasonStatsPlayers, err error)

SeasonStatsPlayers returns a season information for up to 10 players.

func (Client) Seasons

func (c Client) Seasons(platform Platform) (seasons *Seasons, err error)

Seasons returns the list of available seasons.

func (Client) Status

func (c Client) Status() bool

Status returns true if service API up.

func (Client) SurvivalMastery added in v1.4.0

func (c Client) SurvivalMastery(platform Platform, accountID string) (survivalMastery *SurvivalMastery, err error)

SurvivalMastery returns a survival mastery information for a single player.

func (Client) Tournament

func (c Client) Tournament(tournamentID string) (tournament *Tournament, err error)

Tournament returns information for a single tournament.

func (Client) Tournaments deprecated

func (c Client) Tournaments() (tournaments *Tournaments, err error)

Deprecated: Tournaments returns the list of available tournaments.

func (Client) WeaponMastery

func (c Client) WeaponMastery(platform Platform, accountID string) (weaponMastery *WeaponMastery, err error)

WeaponMastery returns a weapon mastery information for a single player.

type ErrBadRequest

type ErrBadRequest struct {
	// contains filtered or unexported fields
}

ErrBadRequest structure.

func (ErrBadRequest) Error

func (e ErrBadRequest) Error() string

Error returns a error text.

func (ErrBadRequest) GetDetail

func (e ErrBadRequest) GetDetail() string

GetDetail returns a details.

type ErrNotFound

type ErrNotFound struct {
	// contains filtered or unexported fields
}

ErrNotFound structure.

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

Error returns a error text.

func (ErrNotFound) GetDetail

func (e ErrNotFound) GetDetail() string

GetDetail returns a details.

type ErrTooManyRequest

type ErrTooManyRequest struct {
	// contains filtered or unexported fields
}

ErrTooManyRequest structure.

func (ErrTooManyRequest) Error

func (e ErrTooManyRequest) Error() string

Error returns a error text.

func (ErrTooManyRequest) GetDetail

func (e ErrTooManyRequest) GetDetail() string

GetDetail returns a details.

type ErrUnauthorized

type ErrUnauthorized struct {
	// contains filtered or unexported fields
}

ErrUnauthorized structure.

func (ErrUnauthorized) Error

func (e ErrUnauthorized) Error() string

Error returns a error text.

func (ErrUnauthorized) GetDetail

func (e ErrUnauthorized) GetDetail() string

GetDetail returns a details.

type ErrUnsupportedMediaType

type ErrUnsupportedMediaType struct {
	// contains filtered or unexported fields
}

ErrUnsupportedMediaType structure.

func (ErrUnsupportedMediaType) Error

func (e ErrUnsupportedMediaType) Error() string

Error returns a error text.

func (ErrUnsupportedMediaType) GetDetail

func (e ErrUnsupportedMediaType) GetDetail() string

GetDetail returns a details.

type Error

type Error interface {
	GetDetail() string
}

Error interface service API errors

type GameMode

type GameMode string

GameMode as string

func TransformToGameMode

func TransformToGameMode(name string) (gameMode GameMode, err error)

TransformToGameMode transforms a string into a GameMode structure.

func (GameMode) IsValid

func (m GameMode) IsValid() bool

IsValid returns true if the mode is valid.

type ItemPackage

type ItemPackage struct {
	ItemPackageID string                  `json:"itemPackageId"`
	Location      telemetryObjectLocation `json:"location"`
	Items         []telemetryObjectItem   `json:"items"`
}

ItemPackage structure.

type Leaderboard

type Leaderboard struct {
	Data struct {
		// Identifier for this object type ("leaderboard")
		Type string `json:"type"`
		// A randomly generated ID assigned to this resource object for linking elsewhere in the leaderboard response
		ID         string `json:"id"`
		Attributes struct {
			// Platform shard
			ShardId string `json:"shardId"`
			// The game mode
			GameMode string `json:"gameMode"`
			// Season ID postfix
			SeasonId string `json:"seasonId"`
		} `json:"attributes"`

		Relationships struct {
			// Array:
			//     type - Identifier for this object type ("player")
			//     id - The accountId of the player
			Players dataArrayIDAndType `json:"players"`
		} `json:"relationships"`

		Included []struct {
			// Identifier for this object type ("player")
			Type string `json:"type"`
			// The accountId of the player
			ID string `json:"id"`

			Attributes struct {
				// The player's IGN
				Name string `json:"name"`
				// The player's current rank
				Rank int `json:"rank"`
				// Player stats in the context of a season
				Stats struct {
					// Number of rank points the player was awarded.
					RankPoints float64 `json:"rankPoints"`
					// Number of matches won
					Wins int `json:"wins"`
					// Number of games played
					Games int `json:"games"`
					// KDA
					KDA float64 `json:"kda"`
					// Average amount of damage dealt per match
					AverageDamage int `json:"averageDamage"`
					// Number of enemy players killed
					Kills int `json:"kills"`
					// Average rank
					AverageRank float64 `json:"averageRank"`
					// Player's current ranked tier
					Tier string `json:"tier"`
					// Player's current ranked subtier
					SubTier string `json:"subTier"`
				} `json:"stats"`
			} `json:"attributes"`
		} `json:"included"`
	} `json:"data"`

	Links links `json:"links"`
}

Leaderboard structure.

type LifetimeStatsPlayer

type LifetimeStatsPlayer struct {
	Data  statistics `json:"data"`
	Links links      `json:"links"`
}

LifetimeStatsPlayer structure.

type LifetimeStatsPlayers

type LifetimeStatsPlayers struct {
	Data  []statistics `json:"data"`
	Links links        `json:"links"`
}

LifetimeStatsPlayers structure.

type LogArmorDestroy

type LogArmorDestroy struct {
	AttackID           int                      `json:"attackId"`
	Attacker           telemetryObjectCharacter `json:"attacker"`
	Victim             telemetryObjectCharacter `json:"victim"`
	DamageTypeCategory string                   `json:"damageTypeCategory"`
	DamageReason       string                   `json:"damageReason"`
	DamageCauserName   string                   `json:"damageCauserName"`
	Item               telemetryObjectItem      `json:"item"`
	Distance           float64                  `json:"distance"`
	// contains filtered or unexported fields
}

LogArmorDestroy structure.

func NewLogArmorDestroy

func NewLogArmorDestroy(raw json.RawMessage) (l *LogArmorDestroy, err error)

NewLogArmorDestroy create new LogArmorDestroy structure.

type LogBlackZoneEnded

type LogBlackZoneEnded struct {
	Survivors []telemetryObjectCharacter `json:"survivors"`
	// contains filtered or unexported fields
}

LogBlackZoneEnded structure.

func NewLogBlackZoneEnded

func NewLogBlackZoneEnded(raw json.RawMessage) (l *LogBlackZoneEnded, err error)

NewLogBlackZoneEnded create new LogBlackZoneEnded structure.

type LogCarePackageLand

type LogCarePackageLand struct {
	ItemPackage ItemPackage `json:"itemPackage"`
	// contains filtered or unexported fields
}

LogCarePackageLand structure.

func NewLogCarePackageLand

func NewLogCarePackageLand(raw json.RawMessage) (l *LogCarePackageLand, err error)

NewLogCarePackageLand create new LogCarePackageLand structure.

type LogCarePackageSpawn

type LogCarePackageSpawn struct {
	ItemPackage ItemPackage `json:"itemPackage"`
	// contains filtered or unexported fields
}

LogCarePackageSpawn structure.

func NewLogCarePackageSpawn

func NewLogCarePackageSpawn(raw json.RawMessage) (l *LogCarePackageSpawn, err error)

NewLogCarePackageSpawn create new LogCarePackageSpawn structure.

type LogCharacterCarry added in v1.3.0

type LogCharacterCarry struct {
	Character  telemetryObjectCharacter `json:"character"`
	CarryState string                   `json:"carryState"`
	// contains filtered or unexported fields
}

LogCharacterCarry structure.

func NewLogCharacterCarry added in v1.3.0

func NewLogCharacterCarry(raw json.RawMessage) (l *LogCharacterCarry, err error)

NewLogCharacterCarry create new LogCharacterCarry structure.

type LogEmPickupLiftOff added in v1.0.2

type LogEmPickupLiftOff struct {
	Instigator telemetryObjectCharacter   `json:"instigator"`
	Riders     []telemetryObjectCharacter `json:"riders"`
	// contains filtered or unexported fields
}

LogEmPickupLiftOff structure.

func NewLogEmPickupLiftOff added in v1.0.2

func NewLogEmPickupLiftOff(raw json.RawMessage) (l *LogEmPickupLiftOff, err error)

NewLogEmPickupLiftOff create new LogEmPickupLiftOff structure.

type LogGameStatePeriodic

type LogGameStatePeriodic struct {
	GameState telemetryObjectGameState `json:"gameState"`
	// contains filtered or unexported fields
}

LogGameStatePeriodic structure.

func NewLogGameStatePeriodic

func NewLogGameStatePeriodic(raw json.RawMessage) (l *LogGameStatePeriodic, err error)

NewLogGameStatePeriodic create new LogGameStatePeriodic structure.

type LogHeal

type LogHeal struct {
	Character  telemetryObjectCharacter `json:"character"`
	Item       telemetryObjectItem      `json:"item"`
	HealAmount float64                  `json:"healAmount"`
	// contains filtered or unexported fields
}

LogHeal structure.

func NewLogHeal

func NewLogHeal(raw json.RawMessage) (l *LogHeal, err error)

NewLogHeal create new LogHeal structure.

type LogItemAttach

type LogItemAttach struct {
	Character  telemetryObjectCharacter `json:"character"`
	ParentItem telemetryObjectItem      `json:"parentItem"`
	ChildItem  telemetryObjectItem      `json:"childItem"`
	// contains filtered or unexported fields
}

LogItemAttach structure.

func NewLogItemAttach

func NewLogItemAttach(raw json.RawMessage) (l *LogItemAttach, err error)

NewLogItemAttach create new LogItemAttach structure.

type LogItemDetach

type LogItemDetach struct {
	Character  telemetryObjectCharacter `json:"character"`
	ParentItem telemetryObjectItem      `json:"parentItem"`
	ChildItem  telemetryObjectItem      `json:"childItem"`
	// contains filtered or unexported fields
}

LogItemDetach structure.

func NewLogItemDetach

func NewLogItemDetach(raw json.RawMessage) (l *LogItemDetach, err error)

NewLogItemDetach create new LogItemDetach structure.

type LogItemDrop

type LogItemDrop struct {
	Character telemetryObjectCharacter `json:"character"`
	Item      telemetryObjectItem      `json:"item"`
	// contains filtered or unexported fields
}

LogItemDrop structure.

func NewLogItemDrop

func NewLogItemDrop(raw json.RawMessage) (l *LogItemDrop, err error)

NewLogItemDrop create new LogItemDrop structure.

type LogItemEquip

type LogItemEquip struct {
	Character telemetryObjectCharacter `json:"character"`
	Item      telemetryObjectItem      `json:"item"`
	// contains filtered or unexported fields
}

LogItemEquip structure.

func NewLogItemEquip

func NewLogItemEquip(raw json.RawMessage) (l *LogItemEquip, err error)

NewLogItemEquip create new LogItemEquip structure.

type LogItemPickup

type LogItemPickup struct {
	Character telemetryObjectCharacter `json:"character"`
	Item      telemetryObjectItem      `json:"item"`
	// contains filtered or unexported fields
}

LogItemPickup structure.

func NewLogItemPickup

func NewLogItemPickup(raw json.RawMessage) (l *LogItemPickup, err error)

NewLogItemPickup create new LogItemPickup structure.

type LogItemPickupFromCarepackage

type LogItemPickupFromCarepackage struct {
	Character           telemetryObjectCharacter `json:"character"`
	Item                telemetryObjectItem      `json:"item"`
	CarePackageUniqueId float64                  `json:"carePackageUniqueId"`
	// contains filtered or unexported fields
}

LogItemPickupFromCarepackage structure.

func NewLogItemPickupFromCarepackage

func NewLogItemPickupFromCarepackage(raw json.RawMessage) (l *LogItemPickupFromCarepackage, err error)

NewLogItemPickupFromCarepackage create new LogItemPickupFromCarepackage structure.

type LogItemPickupFromCustomPackage

type LogItemPickupFromCustomPackage struct {
	Character telemetryObjectCharacter `json:"character"`
	Item      telemetryObjectItem      `json:"item"`
	// contains filtered or unexported fields
}

LogItemPickupFromCustomPackage structure.

func NewLogItemPickupFromCustomPackage

func NewLogItemPickupFromCustomPackage(raw json.RawMessage) (l *LogItemPickupFromCustomPackage, err error)

NewLogItemPickupFromCustomPackage create new LogItemPickupFromCustomPackage structure.

type LogItemPickupFromLootBox

type LogItemPickupFromLootBox struct {
	Character        telemetryObjectCharacter `json:"character"`
	Item             telemetryObjectItem      `json:"item"`
	OwnerTeamId      int                      `json:"ownerTeamId"`
	CreatorAccountId string                   `json:"creatorAccountId"`
	// contains filtered or unexported fields
}

LogItemPickupFromLootBox structure.

func NewLogItemPickupFromLootBox

func NewLogItemPickupFromLootBox(raw json.RawMessage) (l *LogItemPickupFromLootBox, err error)

NewLogItemPickupFromLootBox create new LogItemPickupFromLootBox structure.

type LogItemPickupFromVehicleRunk added in v1.2.0

type LogItemPickupFromVehicleRunk struct {
	Character telemetryObjectCharacter `json:"character"`
	Vehicle   telemetryObjectVehicle   `json:"vehicle"`
	Item      telemetryObjectItem      `json:"item"`
	// contains filtered or unexported fields
}

LogItemPickupFromVehicleRunk structure.

func NewLogItemPickupFromVehicleRunk added in v1.2.0

func NewLogItemPickupFromVehicleRunk(raw json.RawMessage) (l *LogItemPickupFromVehicleRunk, err error)

NewLogItemPickupFromVehicleRunk create new LogItemPickupFromVehicleRunk structure.

type LogItemPutToVehicleTrunk added in v1.2.0

type LogItemPutToVehicleTrunk struct {
	Character telemetryObjectCharacter `json:"character"`
	Vehicle   telemetryObjectVehicle   `json:"vehicle"`
	Item      telemetryObjectItem      `json:"item"`
	// contains filtered or unexported fields
}

LogItemPutToVehicleTrunk structure.

func NewLogItemPutToVehicleTrunk added in v1.2.0

func NewLogItemPutToVehicleTrunk(raw json.RawMessage) (l *LogItemPutToVehicleTrunk, err error)

NewLogItemPutToVehicleTrunk create new LogItemPutToVehicleTrunk structure.

type LogItemUnequip

type LogItemUnequip struct {
	Character telemetryObjectCharacter `json:"character"`
	Item      telemetryObjectItem      `json:"item"`
	// contains filtered or unexported fields
}

LogItemUnequip structure.

func NewLogItemUnequip

func NewLogItemUnequip(raw json.RawMessage) (l *LogItemUnequip, err error)

NewLogItemUnequip create new LogItemUnequip structure.

type LogItemUse

type LogItemUse struct {
	Character telemetryObjectCharacter `json:"character"`
	Item      telemetryObjectItem      `json:"item"`
	// contains filtered or unexported fields
}

LogItemUse structure.

func NewLogItemUse

func NewLogItemUse(raw json.RawMessage) (l *LogItemUse, err error)

NewLogItemUse create new LogItemUse structure.

type LogMatchDefinition

type LogMatchDefinition struct {
	MatchId     string `json:"MatchId"`
	SeasonState string `json:"SeasonState"`
	// contains filtered or unexported fields
}

LogMatchDefinition structure.

func NewLogMatchDefinition

func NewLogMatchDefinition(raw json.RawMessage) (l *LogMatchDefinition, err error)

NewLogMatchDefinition create new LogMatchDefinition structure.

type LogMatchEnd

type LogMatchEnd struct {
	Characters []telemetryObjectCharacterWrapper `json:"characters"`
	// Shows winning players only
	GameResultOnFinished telemetryObjectGameResultOnFinished `json:"gameResultOnFinished"`
	// contains filtered or unexported fields
}

LogMatchEnd structure.

func NewLogMatchEnd

func NewLogMatchEnd(raw json.RawMessage) (l *LogMatchEnd, err error)

NewLogMatchEnd create new LogMatchEnd structure.

type LogMatchStart

type LogMatchStart struct {
	MapName                  string                                 `json:"mapName"`
	WeatherId                string                                 `json:"weatherId"`
	Characters               []telemetryObjectCharacterWrapper      `json:"characters"`
	CameraViewBehaviour      string                                 `json:"cameraViewBehaviour"`
	TeamSize                 int                                    `json:"teamSize"`
	IsCustomGame             bool                                   `json:"isCustomGame"`
	IsEventMode              bool                                   `json:"isEventMode"`
	BlueZoneCustomOptions    []telemetryObjectBlueZoneCustomOptions `json:"-"`
	BlueZoneCustomOptionsRaw string                                 `json:"blueZoneCustomOptions"`
	// contains filtered or unexported fields
}

LogMatchStart structure.

func NewLogMatchStart

func NewLogMatchStart(raw json.RawMessage) (l *LogMatchStart, err error)

NewLogMatchStart create new LogMatchStart structure.

type LogObjectDestroy

type LogObjectDestroy struct {
	Character      telemetryObjectCharacter `json:"character"`
	ObjectType     string                   `json:"objectType"`
	ObjectLocation telemetryObjectLocation  `json:"objectLocation"`
	// contains filtered or unexported fields
}

LogObjectDestroy structure.

func NewLogObjectDestroy

func NewLogObjectDestroy(raw json.RawMessage) (l *LogObjectDestroy, err error)

NewLogObjectDestroy create new LogObjectDestroy structure.

type LogObjectInteraction

type LogObjectInteraction struct {
	Character                telemetryObjectCharacter `json:"character"`
	ObjectType               string                   `json:"objectType"`
	ObjectTypeStatus         string                   `json:"objectTypeStatus"`
	ObjectTypeAdditionalInfo []map[string]interface{} `json:"objectTypeAdditionalInfo"`
	Common                   telemetryObjectCommon    `json:"common"`
	// contains filtered or unexported fields
}

LogObjectInteraction structure.

func NewLogObjectInteraction

func NewLogObjectInteraction(raw json.RawMessage) (l *LogObjectInteraction, err error)

NewLogObjectInteraction create new LogObjectInteraction structure.

type LogParachuteLanding

type LogParachuteLanding struct {
	Character telemetryObjectCharacter `json:"character"`
	Distance  float64                  `json:"distance"`
	// contains filtered or unexported fields
}

LogParachuteLanding structure.

func NewLogParachuteLanding

func NewLogParachuteLanding(raw json.RawMessage) (l *LogParachuteLanding, err error)

NewLogParachuteLanding create new LogParachuteLanding structure.

type LogPhaseChange

type LogPhaseChange struct {
	Phase       int     `json:"phase"`
	ElapsedTime float64 `json:"elapsedTime"`
	// contains filtered or unexported fields
}

LogPhaseChange structure.

func NewLogPhaseChange

func NewLogPhaseChange(raw json.RawMessage) (l *LogPhaseChange, err error)

NewLogPhaseChange create new LogPhaseChange structure.

type LogPlayerAttack

type LogPlayerAttack struct {
	AttackId             int                      `json:"attackId"`
	FireWeaponStackCount int                      `json:"fireWeaponStackCount"`
	Attacker             telemetryObjectCharacter `json:"attacker"`
	AttackType           string                   `json:"attackType"`
	Weapon               telemetryObjectItem      `json:"weapon"`
	Vehicle              telemetryObjectVehicle   `json:"vehicle"`
	// contains filtered or unexported fields
}

LogPlayerAttack structure.

func NewLogPlayerAttack

func NewLogPlayerAttack(raw json.RawMessage) (l *LogPlayerAttack, err error)

NewLogPlayerAttack create new LogPlayerAttack structure.

type LogPlayerCreate

type LogPlayerCreate struct {
	Character telemetryObjectCharacter `json:"character"`
	// contains filtered or unexported fields
}

LogPlayerCreate structure.

func NewLogPlayerCreate

func NewLogPlayerCreate(raw json.RawMessage) (l *LogPlayerCreate, err error)

NewLogPlayerCreate create new LogPlayerCreate structure.

type LogPlayerDestroyBreachableWall

type LogPlayerDestroyBreachableWall struct {
	Attacker telemetryObjectCharacter `json:"attacker"`
	Weapon   telemetryObjectItem      `json:"weapon"`
	// contains filtered or unexported fields
}

LogPlayerDestroyBreachableWall structure.

func NewLogPlayerDestroyBreachableWall

func NewLogPlayerDestroyBreachableWall(raw json.RawMessage) (l *LogPlayerDestroyBreachableWall, err error)

NewLogPlayerDestroyBreachableWall create new LogPlayerDestroyBreachableWall structure.

type LogPlayerDestroyProp added in v1.0.2

type LogPlayerDestroyProp struct {
	Attacker       telemetryObjectCharacter `json:"attacker"`
	ObjectType     string                   `json:"objectType"`
	ObjectLocation telemetryObjectLocation  `json:"objectLocation"`
	// contains filtered or unexported fields
}

LogPlayerDestroyProp structure.

func NewLogPlayerDestroyProp added in v1.0.2

func NewLogPlayerDestroyProp(raw json.RawMessage) (l *LogPlayerDestroyProp, err error)

NewLogPlayerDestroyProp create new LogPlayerDestroyProp structure.

type LogPlayerKill

type LogPlayerKill struct {
	AttackId                   int                       `json:"attackId"`
	Killer                     telemetryObjectCharacter  `json:"killer"`
	Victim                     telemetryObjectCharacter  `json:"victim"`
	Assistant                  telemetryObjectCharacter  `json:"assistant"`
	DBNOId                     int                       `json:"dBNOId"`
	DamageReason               string                    `json:"damageReason"`
	DamageTypeCategory         string                    `json:"damageTypeCategory"`
	DamageCauserName           string                    `json:"damageCauserName"`
	DamageCauserAdditionalInfo []string                  `json:"damageCauserAdditionalInfo"`
	VictimWeapon               string                    `json:"VictimWeapon"`
	VictimWeaponAdditionalInfo []string                  `json:"VictimWeaponAdditionalInfo"`
	Distance                   float64                   `json:"distance"`
	VictimGameResult           telemetryObjectGameResult `json:"victimGameResult"`
	IsThroughPenetrableWall    bool                      `json:"isThroughPenetrableWall"`
	// contains filtered or unexported fields
}

LogPlayerKill structure.

func NewLogPlayerKill

func NewLogPlayerKill(raw json.RawMessage) (l *LogPlayerKill, err error)

NewLogPlayerKill create new LogPlayerKill structure.

type LogPlayerKillV2 added in v1.0.1

type LogPlayerKillV2 struct {
	AttackId                   int                       `json:"attackId"`
	DBNOId                     int                       `json:"dBNOId"`
	VictimGameResult           telemetryObjectGameResult `json:"victimGameResult"`
	Victim                     telemetryObjectCharacter  `json:"victim"`
	VictimWeapon               string                    `json:"VictimWeapon"`
	VictimWeaponAdditionalInfo []string                  `json:"VictimWeaponAdditionalInfo"`
	DBNOMaker                  telemetryObjectCharacter  `json:"dBNOMaker"`
	DBNODamageInfo             telemetryObjectDamageInfo `json:"dBNODamageInfo"`
	Finisher                   telemetryObjectCharacter  `json:"finisher"`
	FinishDamageInfo           telemetryObjectDamageInfo `json:"finishDamageInfo"`
	Killer                     telemetryObjectCharacter  `json:"killer"`
	KillerDamageInfo           telemetryObjectDamageInfo `json:"killerDamageInfo"`
	AssistsAccountId           []string                  `json:"assists_AccountId"`
	TeamKillersAccountId       []string                  `json:"teamKillers_AccountId"`
	IsSuicide                  bool                      `json:"isSuicide"`
	// contains filtered or unexported fields
}

LogPlayerKillV2 structure.

func NewLogPlayerKillV2 added in v1.0.1

func NewLogPlayerKillV2(raw json.RawMessage) (l *LogPlayerKillV2, err error)

NewLogPlayerKillV2 create new LogPlayerKillV2 structure.

type LogPlayerLogin

type LogPlayerLogin struct {
	AccountId string `json:"accountId"`
	// contains filtered or unexported fields
}

LogPlayerLogin structure.

func NewLogPlayerLogin

func NewLogPlayerLogin(raw json.RawMessage) (l *LogPlayerLogin, err error)

NewLogPlayerLogin create new LogPlayerLogin structure.

type LogPlayerLogout

type LogPlayerLogout struct {
	AccountId string `json:"accountId"`
	// contains filtered or unexported fields
}

LogPlayerLogout structure.

func NewLogPlayerLogout

func NewLogPlayerLogout(raw json.RawMessage) (l *LogPlayerLogout, err error)

NewLogPlayerLogout create new LogPlayerLogout structure.

type LogPlayerMakeGroggy

type LogPlayerMakeGroggy struct {
	AttackId                   int                      `json:"attackId"`
	Attacker                   telemetryObjectCharacter `json:"attacker"`
	Victim                     telemetryObjectCharacter `json:"victim"`
	DamageReason               string                   `json:"damageReason"`
	DamageTypeCategory         string                   `json:"damageTypeCategory"`
	DamageCauserName           string                   `json:"damageCauserName"`
	DamageCauserAdditionalInfo []string                 `json:"damageCauserAdditionalInfo"`
	VictimWeapon               string                   `json:"VictimWeapon"`
	VictimWeaponAdditionalInfo []string                 `json:"VictimWeaponAdditionalInfo"`
	Distance                   float64                  `json:"distance"`
	IsAttackerInVehicle        bool                     `json:"isAttackerInVehicle"`
	DBNOId                     int                      `json:"dBNOId"`
	IsThroughPenetrableWall    bool                     `json:"isThroughPenetrableWall"`
	// contains filtered or unexported fields
}

LogPlayerMakeGroggy structure.

func NewLogPlayerMakeGroggy

func NewLogPlayerMakeGroggy(raw json.RawMessage) (l *LogPlayerMakeGroggy, err error)

NewLogPlayerMakeGroggy create new LogPlayerMakeGroggy structure.

type LogPlayerPosition

type LogPlayerPosition struct {
	Character       telemetryObjectCharacter `json:"character"`
	Vehicle         telemetryObjectVehicle   `json:"vehicle"`
	ElapsedTime     float64                  `json:"elapsedTime"`
	NumAlivePlayers int                      `json:"numAlivePlayers"`
	// contains filtered or unexported fields
}

LogPlayerPosition structure.

func NewLogPlayerPosition

func NewLogPlayerPosition(raw json.RawMessage) (l *LogPlayerPosition, err error)

NewLogPlayerPosition create new LogPlayerPosition structure.

type LogPlayerRedeploy added in v1.1.0

type LogPlayerRedeploy struct {
	Character telemetryObjectCharacter `json:"character"`
	// contains filtered or unexported fields
}

LogPlayerRedeploy structure.

func NewLogPlayerRedeploy added in v1.1.0

func NewLogPlayerRedeploy(raw json.RawMessage) (l *LogPlayerRedeploy, err error)

NewLogPlayerRedeploy create new LogPlayerRedeploy structure.

type LogPlayerRedeployBRStart added in v1.1.0

type LogPlayerRedeployBRStart struct {
	Characters []telemetryObjectCharacter `json:"characters"`
	// contains filtered or unexported fields
}

LogPlayerRedeployBRStart structure.

func NewLogPlayerRedeployBRStart added in v1.1.0

func NewLogPlayerRedeployBRStart(raw json.RawMessage) (l *LogPlayerRedeployBRStart, err error)

NewLogPlayerRedeployBRStart create new LogPlayerRedeployBRStart structure.

type LogPlayerRevive

type LogPlayerRevive struct {
	Reviver telemetryObjectCharacter `json:"reviver"`
	Victim  telemetryObjectCharacter `json:"victim"`
	DBNOId  int                      `json:"dBNOId"`
	// contains filtered or unexported fields
}

LogPlayerRevive structure.

func NewLogPlayerRevive

func NewLogPlayerRevive(raw json.RawMessage) (l *LogPlayerRevive, err error)

NewLogPlayerRevive create new LogPlayerRevive structure.

type LogPlayerTakeDamage

type LogPlayerTakeDamage struct {
	AttackId           int                      `json:"attackId"`
	Attacker           telemetryObjectCharacter `json:"attacker"`
	Victim             telemetryObjectCharacter `json:"victim"`
	DamageTypeCategory string                   `json:"damageTypeCategory"`
	DamageReason       string                   `json:"damageReason"`
	// 1.0 damage = 1.0 health. Net damage after armor; damage to health
	Damage                  float64 `json:"damage"`
	DamageCauserName        string  `json:"damageCauserName"`
	IsThroughPenetrableWall bool    `json:"isThroughPenetrableWall"`
	// contains filtered or unexported fields
}

LogPlayerTakeDamage structure.

func NewLogPlayerTakeDamage

func NewLogPlayerTakeDamage(raw json.RawMessage) (l *LogPlayerTakeDamage, err error)

NewLogPlayerTakeDamage create new LogPlayerTakeDamage structure.

type LogPlayerUseFlareGun

type LogPlayerUseFlareGun struct {
	AttackId             int                      `json:"attackId"`
	FireWeaponStackCount int                      `json:"fireWeaponStackCount"`
	Attacker             telemetryObjectCharacter `json:"attacker"`
	AttackType           string                   `json:"attackType"`
	Weapon               telemetryObjectItem      `json:"weapon"`
	// contains filtered or unexported fields
}

LogPlayerUseFlareGun structure.

func NewLogPlayerUseFlareGun

func NewLogPlayerUseFlareGun(raw json.RawMessage) (l *LogPlayerUseFlareGun, err error)

NewLogPlayerUseFlareGun create new LogPlayerUseFlareGun structure.

type LogPlayerUseThrowable

type LogPlayerUseThrowable struct {
	AttackId             int                      `json:"attackId"`
	FireWeaponStackCount int                      `json:"fireWeaponStackCount"`
	Attacker             telemetryObjectCharacter `json:"attacker"`
	AttackType           string                   `json:"attackType"`
	Weapon               telemetryObjectItem      `json:"weapon"`
	// contains filtered or unexported fields
}

LogPlayerUseThrowable structure.

func NewLogPlayerUseThrowable

func NewLogPlayerUseThrowable(raw json.RawMessage) (l *LogPlayerUseThrowable, err error)

NewLogPlayerUseThrowable create new LogPlayerUseThrowable structure.

type LogRedZoneEnded

type LogRedZoneEnded struct {
	Drivers []telemetryObjectCharacter `json:"drivers"`
	// contains filtered or unexported fields
}

LogRedZoneEnded structure.

func NewLogRedZoneEnded

func NewLogRedZoneEnded(raw json.RawMessage) (l *LogRedZoneEnded, err error)

NewLogRedZoneEnded create new LogRedZoneEnded structure.

type LogSwimEnd

type LogSwimEnd struct {
	Character           telemetryObjectCharacter `json:"character"`
	SwimDistance        float64                  `json:"swimDistance"`
	MaxSwimDepthOfWater float64                  `json:"maxSwimDepthOfWater"`
	// contains filtered or unexported fields
}

LogSwimEnd structure.

func NewLogSwimEnd

func NewLogSwimEnd(raw json.RawMessage) (l *LogSwimEnd, err error)

NewLogSwimEnd create new LogSwimEnd structure.

type LogSwimStart

type LogSwimStart struct {
	Character telemetryObjectCharacter `json:"character"`
	// contains filtered or unexported fields
}

LogSwimStart structure.

func NewLogSwimStart

func NewLogSwimStart(raw json.RawMessage) (l *LogSwimStart, err error)

NewLogSwimStart create new LogSwimStart structure.

type LogVaultStart

type LogVaultStart struct {
	Character   telemetryObjectCharacter `json:"character"`
	IsLedgeGrab bool                     `json:"isLedgeGrab"`
	// contains filtered or unexported fields
}

LogVaultStart structure.

func NewLogVaultStart

func NewLogVaultStart(raw json.RawMessage) (l *LogVaultStart, err error)

NewLogVaultStart create new LogVaultStart structure.

type LogVehicleDamage

type LogVehicleDamage struct {
	AttackId           int                      `json:"attackId"`
	Attacker           telemetryObjectCharacter `json:"attacker"`
	Vehicle            telemetryObjectVehicle   `json:"vehicle"`
	DamageTypeCategory string                   `json:"damageTypeCategory"`
	DamageCauserName   string                   `json:"damageCauserName"`
	Damage             float64                  `json:"damage"`
	Distance           float64                  `json:"distance"`
	// contains filtered or unexported fields
}

LogVehicleDamage structure.

func NewLogVehicleDamage

func NewLogVehicleDamage(raw json.RawMessage) (l *LogVehicleDamage, err error)

NewLogVehicleDamage create new LogVehicleDamage structure.

type LogVehicleDestroy

type LogVehicleDestroy struct {
	AttackId           int                      `json:"attackId"`
	Attacker           telemetryObjectCharacter `json:"attacker"`
	Vehicle            telemetryObjectVehicle   `json:"vehicle"`
	DamageTypeCategory string                   `json:"damageTypeCategory"`
	DamageCauserName   string                   `json:"damageCauserName"`
	Distance           float64                  `json:"distance"`
	// contains filtered or unexported fields
}

LogVehicleDestroy structure.

func NewLogVehicleDestroy

func NewLogVehicleDestroy(raw json.RawMessage) (l *LogVehicleDestroy, err error)

NewLogVehicleDestroy create new LogVehicleDestroy structure.

type LogVehicleLeave

type LogVehicleLeave struct {
	Character        telemetryObjectCharacter   `json:"character"`
	Vehicle          telemetryObjectVehicle     `json:"vehicle"`
	RideDistance     float64                    `json:"rideDistance"`
	SeatIndex        int                        `json:"seatIndex"`
	MaxSpeed         float64                    `json:"maxSpeed"`
	FellowPassengers []telemetryObjectCharacter `json:"fellowPassengers"`
	// contains filtered or unexported fields
}

LogVehicleLeave structure.

func NewLogVehicleLeave

func NewLogVehicleLeave(raw json.RawMessage) (l *LogVehicleLeave, err error)

NewLogVehicleLeave create new LogVehicleLeave structure.

type LogVehicleRide

type LogVehicleRide struct {
	Character        telemetryObjectCharacter   `json:"character"`
	Vehicle          telemetryObjectVehicle     `json:"vehicle"`
	SeatIndex        int                        `json:"seatIndex"`
	FellowPassengers []telemetryObjectCharacter `json:"fellowPassengers"`
	// contains filtered or unexported fields
}

LogVehicleRide structure.

func NewLogVehicleRide

func NewLogVehicleRide(raw json.RawMessage) (l *LogVehicleRide, err error)

NewLogVehicleRide create new LogVehicleRide structure.

type LogWeaponFireCount

type LogWeaponFireCount struct {
	Character telemetryObjectCharacter `json:"character"`
	WeaponId  string                   `json:"weaponId"`
	// Increments of 10
	FireCount int `json:"fireCount"`
	// contains filtered or unexported fields
}

LogWeaponFireCount structure.

func NewLogWeaponFireCount

func NewLogWeaponFireCount(raw json.RawMessage) (l *LogWeaponFireCount, err error)

NewLogWeaponFireCount create new LogWeaponFireCount structure.

type LogWheelDestroy

type LogWheelDestroy struct {
	AttackId           int                      `json:"attackId"`
	Attacker           telemetryObjectCharacter `json:"attacker"`
	Vehicle            telemetryObjectVehicle   `json:"vehicle"`
	DamageTypeCategory string                   `json:"damageTypeCategory"`
	DamageCauserName   string                   `json:"damageCauserName"`
	// contains filtered or unexported fields
}

LogWheelDestroy structure.

func NewLogWheelDestroy

func NewLogWheelDestroy(raw json.RawMessage) (l *LogWheelDestroy, err error)

NewLogWheelDestroy create new LogWheelDestroy structure.

type Matches

type Matches struct {
	Data struct {
		// Identifier for this object type ("match")
		Type string `json:"type"`
		// Match ID
		ID         string `json:"id"`
		Attributes struct {
			// Time this match object was stored in the API
			CreatedAtRaw string    `json:"createdAt"`
			CreatedAt    time.Time `json:"-"`
			// Length of the match measured in seconds
			Duration int `json:"duration"`
			// Type of match [airoyale, arcade, custom, event, official, seasonal, training]
			MatchType string `json:"latestMatchId"`
			// Game mode played [duo, duo-fpp, solo, solo-fpp, squad, squad-fpp, conquest-duo, conquest-duo-fpp,
			//     conquest-solo, conquest-solo-fpp, conquest-squad, conquest-squad-fpp, esports-duo, esports-duo-fpp,
			//     esports-solo, esports-solo-fpp, esports-squad, esports-squad-fpp, normal-duo, normal-duo-fpp,
			//     normal-solo, normal-solo-fpp, normal-squad, normal-squad-fpp, tdm, war-duo, war-duo-fpp, war-solo,
			//     war-solo-fpp, war-squad, war-squad-fpp, zombie-duo, zombie-duo-fpp, zombie-solo, zombie-solo-fpp,
			//     zombie-squad, zombie-squad-fpp]
			GameMode string
			// Map name [Baltic_Main, Desert_Main, DihorOtok_Main, Erangel_Main, Range_Main, Savage_Main, Summerland_Main]
			MapName string `json:"mapName"`
			// True if this match is a custom match
			IsCustomMatch bool `json:"isCustomMatch"`
			// The state of the season [closed, prepare, progress]
			SeasonState string `json:"seasonState"`
			// Platform shard
			ShardId string `json:"shardId"`
			// Identifies the studio and game
			TitleID string `json:"titleId"`
		} `json:"attributes"`

		// References to resource objects that can be found in the included array
		Relationships struct {
			// Array:
			//     type - Identifier for this object type ("asset")
			//     id - AssetID. Used to find the full asset object in the included array
			Assets dataArrayIDAndType `json:"assets"`

			// Array:
			//     type - Identifier for this object type ("roster")
			//     id - RosterID. Used to find the full roster object in the included array
			Rosters dataArrayIDAndType `json:"rosters"`
		} `json:"relationships"`
	} `json:"data"`

	IncludedRaw  []json.RawMessage `json:"included"`
	Participants []participant     `json:"-"`

	// Rosters track the scores of each opposing group of participants. Rosters can have one or many participants
	// depending on the game mode. Roster objects are only meaningful within the context of a match and are not exposed
	// as a standalone resource.
	Rosters []roster `json:"-"`

	// Asset objects contain a URL string that links to a telemetry.json file, which will contain an array of event
	// objects that provide further insight into a match.
	Assets []asset `json:"-"`

	Links links `json:"links"`
}

Matches structure.

type Platform

type Platform string

Platform as string

func TransformToPlatform

func TransformToPlatform(name string) (platform Platform, err error)

TransformToPlatform transforms a string into a Platform structure.

func (Platform) IsEmpty

func (p Platform) IsEmpty() bool

IsEmpty returns true if the platform is empty.

func (Platform) IsValid

func (p Platform) IsValid() bool

IsValid returns true if the platform is valid.

type Player

type Player struct {
	Data  playerData `json:"data"`
	Links links      `json:"links"`
}

Player structure.

type Players

type Players struct {
	Data  []playerData `json:"data"`
	Links links        `json:"links"`
}

Players structure.

type RankedStatsPlayer

type RankedStatsPlayer struct {
	Data  rankedStatistics `json:"data"`
	Links links            `json:"links"`
}

RankedStatsPlayer structure.

type Samples

type Samples struct {
	Data struct {
		// Identifier for this object type ("sample")
		Type string `json:"type"`
		// Sample ID
		ID string `json:"id"`

		// Sample objects contain the ID of a match.
		Attributes struct {
			CreatedAtRaw string    `json:"createdAt"`
			CreatedAt    time.Time `json:"-"`
			TitleID      string    `json:"titleId"`
			// Platform ID
			ShardID string `json:"shardId"`
		} `json:"attributes"`

		// Array:
		//     type - Identifier for this object type ("match")
		//     id - MatchID. Used to find the full match object in the included array
		Relationships struct {
			Matches dataArrayIDAndType `json:"matches"`
		} `json:"relationships"`
	} `json:"data"`
}

Samples structure.

type SeasonStatsPlayer

type SeasonStatsPlayer struct {
	Data  statistics `json:"data"`
	Links links      `json:"links"`
}

SeasonStatsPlayer structure.

type SeasonStatsPlayers

type SeasonStatsPlayers struct {
	Data  []statistics `json:"data"`
	Links links        `json:"links"`
}

SeasonStatsPlayers structure.

type Seasons

type Seasons struct {
	Data []struct {
		// Identifier for this object type ("season")
		Type string `json:"type"`
		// Season ID. Used to lookup a player's stats for this season on the /players endpoint
		ID         string `json:"id"`
		Attributes struct {
			// Indicates if the season is active
			IsCurrentSeason bool `json:"isCurrentSeason"`
			// Indicates if the season is not active
			IsOffseason bool `json:"isOffseason"`
		} `json:"attributes"`
	} `json:"data"`

	Links links `json:"links"`
}

Seasons structure.

type SurvivalMastery added in v1.4.0

type SurvivalMastery struct {
	Data struct {
		// Identifier for this object type ("survivalMasterySummary")
		Type string `json:"type"`
		// Player ID (also known as account ID)
		ID         string `json:"id"`
		Attributes struct {
			// Survival Mastery experience points
			XP int `json:"xp"`
			// Survival Mastery tier
			Tier int `json:"tier"`
			// Survival Mastery level
			Level int `json:"level"`
			// Number of matches played that count toward Survival Mastery
			TotalMatchesPlayed int `json:"totalMatchesPlayed"`
			// The match ID of the last completed match that was played
			LatestMatchId string `json:"latestMatchId"`
			Stats         struct {
				// Number of air drops called
				AirDropsCalled survivalMasteryStats `json:"airDropsCalled"`
				// Total amount of damage dealt to other players
				DamageDealt survivalMasteryStats `json:"damageDealt"`
				// Total amount of damage taken
				DamageTaken survivalMasteryStats `json:"damageTaken"`
				// Total distance travelled by swimming
				DistanceBySwimming survivalMasteryStats `json:"distanceBySwimming"`
				// Total distance travelled by vehicle
				DistanceByVehicle survivalMasteryStats `json:"distanceByVehicle"`
				// Total distance travelled on foot
				DistanceOnFoot survivalMasteryStats `json:"distanceOnFoot"`
				// Total distance travelled by foot, swimming, and vehicle
				DistanceTotal survivalMasteryStats `json:"distanceTotal"`
				// Total amount healed
				Healed survivalMasteryStats `json:"healed"`
				// Number of times landing in a hot drop location
				HotDropLandings survivalMasteryStats `json:"hotDropLandings"`
				// Number of enemy crates looted
				EnemyCratesLooted survivalMasteryStats `json:"enemyCratesLooted"`
				// Match placement
				Position survivalMasteryStats `json:"position"`
				// Number of times revived
				Revived survivalMasteryStats `json:"revived"`
				// Number of times reviving another player
				TeammatesRevived survivalMasteryStats `json:"teammatesRevived"`
				// Total time survived
				TimeSurvived survivalMasteryStats `json:"timeSurvived"`
				// Number of throwables thrown
				ThrowablesThrown survivalMasteryStats `json:"throwablesThrown"`
				// Number of times placing in the top 10
				Top10 survivalMasteryStats `json:"top10"`
			} `json:"stats"`
		} `json:"attributes"`
	} `json:"data"`
	Links links `json:"links"`
}

SurvivalMastery structure.

type Telemetry

type Telemetry struct {
	Raw []json.RawMessage
	// contains filtered or unexported fields
}

Telemetry structure.

func NewTelemetryFromBytes

func NewTelemetryFromBytes(b []byte) (telemetry *Telemetry, err error)

NewTelemetryFromBytes create new Telemetry structure from bytes.

func NewTelemetryFromFile

func NewTelemetryFromFile(filename string) (telemetry *Telemetry, err error)

NewTelemetryFromFile create new Telemetry structure from file.

func NewTelemetryFromURL

func NewTelemetryFromURL(url string, transport *http.Transport) (telemetry *Telemetry, err error)

NewTelemetryFromURL create new Telemetry structure from url.

func (*Telemetry) Len

func (t *Telemetry) Len() int

Len returns the number of events.

func (*Telemetry) Next

func (t *Telemetry) Next() (eventDate time.Time, eventType string, raw json.RawMessage, ok bool, err error)

Next returns the next event (date, type, raw).

func (*Telemetry) Rewind

func (t *Telemetry) Rewind()

Rewind reset pointer.

func (*Telemetry) SetIndex

func (t *Telemetry) SetIndex(index int) error

SetIndex set pointer.

type Tier

type Tier struct {
	// Player's current ranked tier
	Tier string `json:"tier"`
	// Player's current ranked subtier
	SubTier string `json:"subTier"`
}

type Tournament

type Tournament struct {
	Data struct {
		// Identifier for this object type ("tournament")
		Type string `json:"type"`
		// Tournament ID
		ID string `json:"id"`

		Relationships struct {
			Matches dataArrayIDAndType `json:"matches"`
		} `json:"relationships"`
	}

	Included []struct {
		// Identifier for this object type ("match")
		Type string `json:"type"`
		// Match ID
		ID string `json:"id"`

		Attributes struct {
			CreatedAtRaw string    `json:"createdAt"`
			CreatedAt    time.Time `json:"-"`
		} `json:"attributes"`
	} `json:"included"`

	Links links `json:"links"`
}

Tournament structure.

type Tournaments

type Tournaments struct {
	Data []struct {
		// Identifier for this object type ("tournament")
		Type string `json:"type"`
		// Tournament ID
		ID string `json:"id"`

		Attributes struct {
			CreatedAtRaw string    `json:"createdAt"`
			CreatedAt    time.Time `json:"-"`
		} `json:"attributes"`
	} `json:"data"`

	Links links `json:"links"`
}

Tournaments structure.

type WeaponMastery

type WeaponMastery struct {
	Data struct {
		// Identifier for this object type ("weaponMasterySummary")
		Type string `json:"type"`
		// Player ID (also known as account ID)
		ID         string `json:"id"`
		Attributes struct {
			// The platform
			Platform string `json:"platform"`
			// SeasonId: career
			SeasonID string `json:"seasonId"`
			// The match ID of the last completed match that was played.
			LatestMatchID string `json:"latestMatchId"`
			// The weapon summary for each weapon
			WeaponSummaries map[string]weaponSummary `json:"weaponSummaries"`
		} `json:"attributes"`
	} `json:"data"`

	Links links `json:"links"`
}

WeaponMastery structure.

Jump to

Keyboard shortcuts

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