Documentation
¶
Overview ¶
Package xbl provides access to the Smartglass Xbox Live API.
Index ¶
- type Achievement
- type ActivityStatus
- type Client
- func (c *Client) Achievements(xid string) ([]Achievement, error)
- func (c *Client) ActivityStatuses(xids ...string) ([]ActivityStatus, error)
- func (c *Client) Expiry() time.Time
- func (c *Client) Gamertag() string
- func (c *Client) Profile(gamertag string) (*Profile, error)
- func (c *Client) Profiles(userIDs ...string) ([]*Profile, error)
- func (c *Client) Titles(xid string, opts ...Option) ([]Title, error)
- func (c *Client) UserID() string
- type DeviceActivity
- type Option
- type Profile
- type Rarity
- type Title
- type TitleActivity
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"`
TitleID int `json:"titleId"`
Name string `json:"name"`
Sequence int `json:"sequence"`
Flags int `json:"flags"`
UnlockedOnline bool `json:"unlockedOnline"`
Unlocked bool `json:"unlocked"`
IsSecret bool `json:"isSecret"`
Platform int `json:"platform"`
Gamescore int `json:"gamerscore"`
Description string `json:"description"`
LockedDescription string `json:"lockedDescription"`
Type int `json:"type"`
TimeUnlocked time.Time `json:"timeUnlocked"`
Rarity Rarity `json:"rarity"`
}
Achievement represents an individual user's achievement in a game.
type ActivityStatus ¶
type ActivityStatus struct {
XUID string `json:"xuid"`
State string `json:"state"`
Devices []DeviceActivity `json:"devices,omitempty"`
}
ActivityStatus describes the current status of a Xbox LIVE gamertag.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client encapsulates the entire Xbox Live API and a set of credentials to access the API.
A Client is safe for concurrent access.
func (*Client) Achievements ¶
func (c *Client) Achievements(xid string) ([]Achievement, error)
Achievements retrieves all achievements for the provided XID.
func (*Client) ActivityStatuses ¶
func (c *Client) ActivityStatuses(xids ...string) ([]ActivityStatus, error)
ActivityStatuses retrieves the activity statuses for the provided XIDs.
func (*Client) Expiry ¶
Expiry returns the time at which this client's credentials will no longer be valid and the client should be replaced with a new one obtained from Login.
func (*Client) Gamertag ¶
Gamertag returns the gamertag of the user who is authenticated with the API.
type DeviceActivity ¶
type DeviceActivity struct {
Type string `json:"type"`
Titles []TitleActivity `json:"titles,omitempty"`
}
type Option ¶
type Option func(*reqOptions)
Option defines an option for a client method.
func UpdatedSince ¶
UpdatedSince will filter results to only results updated since the provided time.
type Profile ¶
type Profile struct {
ID string `json:"id"`
Gamertag string `json:"gamertag,omitempty"`
Gamerscore int `json:"gamerscore,omitempty"`
GamerPicture string `json:"picture_url,omitempty"`
AccountTier string `json:"account_tier,omitempty"`
Reputation string `json:"reputation,omitempty"`
PreferredColor string `json:"-"`
Tenure int `json:"-"`
Bio string `json:"bio,omitempty"`
Location string `json:"location,omitempty"`
}
Profile describe's a gamer's Xbox Live account.
type Rarity ¶
type Rarity struct {
CurrentCategory string `json:"currentCategory"`
CurrentPercentage int `json:"currentPercentage"`
}
Rarity describes the rarity of a particular achievement.
type Title ¶
type Title struct {
ID int64 `json:"titleId"`
Type int `json:"titleType"`
Platforms []int `json:"platforms"`
Name string `json:"name"`
LastPlayed time.Time `json:"lastPlayed"`
CurrentAchievements int64 `json:"currentAchievements"`
CurrentGamerscore int64 `json:"currentGamerscore"`
Sequence int64 `json:"sequence"`
TotalAchievements int64 `json:"totalAchievements"`
TotalGamerscore int64 `json:"totalGamerscore"`
RareUnlocks []struct {
RarityCategory string `json:"rarityCategory"`
NumUnlocks int `json:"numUnlocks"`
IsRarestCategory bool `json:"isRarestCategory"`
} `json:"rareUnlocks"`
}
Title represents an individual Xbox title.