Documentation
¶
Index ¶
- func FindCurrentMeta(platform, requestedActivity string) (*skillserver.EchoResponse, error)
- func FindMostPopularActivities(platform string) (*skillserver.EchoResponse, error)
- func InitEnv()
- type ActivityResponse
- type ActivitySummary
- type BaseResponse
- type Client
- type InnerActivityResponse
- type InnerMetaResponse
- type MetaResponse
- type PlatformSummary
- type WeaponStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindCurrentMeta ¶
func FindCurrentMeta(platform, requestedActivity string) (*skillserver.EchoResponse, error)
FindCurrentMeta will return information about commonly used weapons via the Charlemagne API
func FindMostPopularActivities ¶
func FindMostPopularActivities(platform string) (*skillserver.EchoResponse, error)
FindMostPopularActivities will generate an EchoResponse that describes the most popular activities currently being played.
Types ¶
type ActivityResponse ¶
type ActivityResponse struct { *BaseResponse *InnerActivityResponse `json:"response"` }
ActivityResponse contains all the stats returned by the Charlemagne API from the activity endpoints
type ActivitySummary ¶
type ActivitySummary struct { ActivityHash string `json:"activityHash"` Mode int `json:"mode"` ModeName string PercentagePlayed float64 `json:"percentagePlayed"` RawScore int `json:"rawScore"` }
ActivitySummary contains data that summarizes the activity stats. It seems (from the sample responses) that either activity hash or mode will be provided but not both
type BaseResponse ¶
BaseResponse contains the field that are present in all response from the Charlemagne API.
type Client ¶
Client is a type that encapsulates functionality for making requests to the Charlemagne API.
func (*Client) GetCurrentMeta ¶
func (c *Client) GetCurrentMeta(activityHash string, gameModes []string, membershipType string) (*MetaResponse, error)
GetCurrentMeta will request informatino about the current "meta" in Destiny 2. The parameters can be used to filter the meta information returned by the API if a particular activity is requested, a set of game modes, or a specific platform.
func (*Client) GetPlayerActivity ¶
func (c *Client) GetPlayerActivity() (*ActivityResponse, error)
GetPlayerActivity will send a request to the Charlemagne API to get the current activity for all players in the game.
type InnerActivityResponse ¶
type InnerActivityResponse struct { AverageConcurrentPlayers int `json:"averageConcurrentPlayers"` ActivityByMode map[string]*ActivitySummary `json:"activityByModeType"` ActivityByRaid map[string]*ActivitySummary `json:"activityByRaid"` ActivityByPlatform map[string]*PlatformSummary `json:"activityByPlatform"` }
InnerActivityResponse is a wrapper around the data inside the inner response JSON tag. This is where the majority of the (meaningful) data is stored.
type InnerMetaResponse ¶
type InnerMetaResponse struct { WeekNumber int `json:"weekNumber"` ActivityHash string `json:"activityHash"` MembershipTypes string `json:"membershipTypes"` // Comma separated ModeTypes string `json:"modeTypes"` // Comma separated TopKineticWeapons []*WeaponStats `json:"topKineticWeapons"` TopEnergyWeapons []*WeaponStats `json:"topEnergyWeapons"` TopPowerWeapons []*WeaponStats `json:"topPowerWeapons"` }
InnerMetaResponse is a wrapper around the inner response JSON tag. This is where the majority of the data is stored.
type MetaResponse ¶
type MetaResponse struct { *BaseResponse *InnerMetaResponse `json:"response"` }
MetaResponse contains the fields returned from the Charlemagne API for meta endpoints
type PlatformSummary ¶
type PlatformSummary struct { MembershipType int `json:"membershipType"` DisplayName string `json:"displayName"` RawScore int `json:"rawScore"` Percent float64 `json:"percent"` ActivityByMode map[string]*ActivitySummary `json:"activityByModeType"` ActivityByRaid map[string]*ActivitySummary `json:"activityByRaid"` }
PlatformSummary contains the activity data for the different platfomrs. These summaries are keyed by the platform ID string.