Documentation
¶
Index ¶
- Variables
- type Account
- type AccountAchievement
- type AccountBankItem
- type AccountDailyCraftingItem
- type AccountFinisher
- type AccountHomeCat
- type AccountLuck
- type AccountMastery
- type AccountMasteryPoints
- type BuildTemplate
- type ItemSlot
- type Material
- type Session
- func (s *Session) GetAccount() (account Account, err error)
- func (s *Session) GetAccountAchievements(ids ...int) (accountAchievements []*AccountAchievement, err error)
- func (s *Session) GetAccountBuildStorage(ids ...int) (buildstorage []*BuildTemplate, err error)
- func (s *Session) GetAccountDailyCrafting(ids ...int) (items []*AccountDailyCraftingItem, err error)
- func (s *Session) GetAccountDungeons()
- func (s *Session) GetAccountDyes() (dyes []int, err error)
- func (s *Session) GetAccountFinishers() (finishers []*AccountFinisher, err error)
- func (s *Session) GetAccountGliders() (gliders []int, err error)
- func (s *Session) GetAccountHomeCats() (cats []*AccountHomeCat, err error)
- func (s *Session) GetAccountHomeNodes() (nodes []string, err error)
- func (s *Session) GetAccountLuck() (luck AccountLuck, err error)
- func (s *Session) GetAccountMapChests() (chests []string, err error)
- func (s *Session) GetAccountMasteries() (masteries []*AccountMastery, err error)
- func (s *Session) GetAccountMasteryPoints() (masteryPoints AccountMasteryPoints, err error)
- func (s *Session) GetAccountMaterials() (materials []*Material, err error)
- func (s *Session) GetAccountSharedInventory() (items []*ItemSlot, err error)
- func (s *Session) GetMailCarriers() (carries []int, err error)
- func (s *Session) GetTokenInfo() (tokeninfo TokenInfo, err error)
- func (s *Session) WithAccessToken(token string) *Session
- func (s *Session) WithEndpointAPI(endpointApi string) *Session
- func (s *Session) WithLanguage(lang string) *Session
- type TokenInfo
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = errors.New("not found") ErrInvalidAccessToken = errors.New("Invalid access token") )
Error constants
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID string `json:"id"`
Name string `json:"name"`
Age time.Duration `json:"age"`
World int `json:"world"`
Guilds []string `json:"guilds"`
GuildLeader []string `json:"guild_leader"`
Created time.Time `json:"created"`
Access []string `json:"access"`
Commander bool `json:"commander"`
FractalLevel int `json:"fractal_level"`
DailyAP int `json:"daily_ap"`
MonthlyAP int `json:"monthly_ap"`
WvWRank int `json:"wvw_rank"`
}
Account includes general information
type AccountAchievement ¶
type AccountAchievement struct {
ID int `json:"id"`
Current int `json:"current"`
Max int `json:"max"`
Done bool `json:"done"`
}
AccountAchievement contains the unlock status for an achievement
type AccountBankItem ¶
type AccountBankItem struct {
ID int `json:"id"`
Count int `json:"count"`
Skin int `json:"skin"`
Upgrades []int `json:"upgrades"`
UpgradeSlotIndices []int `json:"upgrade_slot_indices"`
Dyes []int `json:"dyes"`
Binding string `json:"binding"`
Stats struct {
ID int `json:"id"`
Attributes struct {
} `json:"attributes"`
} `json:"stats"`
}
AccountBankItem is an item from the account bank
type AccountDailyCraftingItem ¶
type AccountDailyCraftingItem struct {
ID string `json:"id"`
}
AccountDailyCraftingItem is an object crafted daily
type AccountFinisher ¶
type AccountFinisher struct {
ID int `json:"id"`
Permanent bool `json:"permanent"`
Quantity int `json:"qantity"`
}
AccountFinisher is an finisher unluck for an account
type AccountHomeCat ¶
AccountHomeCat is a home cat node
type AccountLuck ¶
AccountLuck is the accounts consumed luck
type AccountMastery ¶
AccountMastery contains the unlocked mastery level
type AccountMasteryPoints ¶
type AccountMasteryPoints struct {
Totals []struct {
Region string `json:"region"` // The mastery region
Spent int `json:"spent"` // Amount of masteries of this region spent in mastery tracks
Earned int `json:"earned"` // Amount of masteries of this region earned for the account
} `json:"totals"`
Unlocked []int `json:"unlocked"` // Array of mastery ids
}
AccountMasteryPoints contains the accounts mastery points for each region
type BuildTemplate ¶
type BuildTemplate struct {
Name string `json:"name"`
Profession string `json:"profession"`
Specializations []struct {
ID int `json:"id"`
Traits []int `json:"traits"`
} `json:"specializations"`
Skills struct {
Heal int `json:"heal"`
Utilities []int `json:"utilities"`
Elite int `json:"elite"`
} `json:"skills"`
AquaticSkills struct {
Heal int `json:"heal"`
Utilities []int `json:"utilities"`
Elite int `json:"elite"`
} `json:"aquatic_skills"`
}
BuildTemplate is a template in the accounts storage
type ItemSlot ¶
type ItemSlot struct {
ID string `json:"id"`
Count int `json:"count"`
Charges int `json:"charges"`
Skin int `json:"skin"`
Upgrades []int `json:"upgrades"`
Infusions []int `json:"infusions"`
Binding string `json:"binding"`
BoundTo string `json:"bound_to"`
}
ItemStack is the data contained in requests that return stored items, e.g. bank or shared inventory
type Material ¶
type Material struct {
ID int `json:"id"`
Category int `json:"category"`
Binding string `json:"binding"`
Count int `json:"count"`
}
A Material is an item stored in the players vault/material storage
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is used to make requests to the gw2api. It also handles authentication.
func (*Session) GetAccount ¶
GetAccount returns the owner account of the apikey provided
func (*Session) GetAccountAchievements ¶
func (s *Session) GetAccountAchievements(ids ...int) (accountAchievements []*AccountAchievement, err error)
GetAccountAchievements returns the accounts achievement status for the given ids
func (*Session) GetAccountBuildStorage ¶
func (s *Session) GetAccountBuildStorage(ids ...int) (buildstorage []*BuildTemplate, err error)
GetAccountBuildStorage returns all builds stored in the accounts build storage
func (*Session) GetAccountDailyCrafting ¶
func (s *Session) GetAccountDailyCrafting(ids ...int) (items []*AccountDailyCraftingItem, err error)
GetAccountDailyCrafting returns the accounts daily crafted items
func (*Session) GetAccountDyes ¶
GetAccountDyes returns all dye unlocks
func (*Session) GetAccountFinishers ¶
func (s *Session) GetAccountFinishers() (finishers []*AccountFinisher, err error)
GetAccountFinishers returns all finisher unlocks
func (*Session) GetAccountGliders ¶
GetAccountGliders returns all glider unlocks
func (*Session) GetAccountHomeCats ¶
func (s *Session) GetAccountHomeCats() (cats []*AccountHomeCat, err error)
GetAccountHomeCats returns all home cat unlocks
func (*Session) GetAccountHomeNodes ¶
GetAccountHomeNodes returns all home node unlocks
func (*Session) GetAccountLuck ¶
func (s *Session) GetAccountLuck() (luck AccountLuck, err error)
GetAccountLuck returns the accounts luck
func (*Session) GetAccountMapChests ¶
GetAccountMapChests returns all Hero's choice chests unlocked since daily reset
func (*Session) GetAccountMasteries ¶
func (s *Session) GetAccountMasteries() (masteries []*AccountMastery, err error)
GetAccountMasteries returns all masteries and their levels unlocked
func (*Session) GetAccountMasteryPoints ¶
func (s *Session) GetAccountMasteryPoints() (masteryPoints AccountMasteryPoints, err error)
GetAccountMasteryPoints returns the mastery points for each region
func (*Session) GetAccountMaterials ¶
GetAccountMaterials returns the accounts materials stored
func (*Session) GetAccountSharedInventory ¶
GetAccountSharedInventory returns the items stored in the shared inventory slots
func (*Session) GetMailCarriers ¶
GetMailCarries returns all mail carrier unlocks
func (*Session) GetTokenInfo ¶
GetTokenInfo returns general information about the provided token
func (*Session) WithAccessToken ¶
WithAccessToken sets an accesstoken for a session
func (*Session) WithEndpointAPI ¶
WithEndpointAPI sets the API endpoint
func (*Session) WithLanguage ¶
WithLanguage sets the sessions language