Documentation ¶
Overview ¶
Package gw2api provides bindings for the Guild Wars 2 v2 API
Using this package is as simple as calling the functions on the API struct Further examples can be found with the function definitions
func main() { api := NewGW2Api() b, _ := api.Build() fmt.Println(b) }
Index ¶
- type APIError
- type Account
- type Achievement
- type AchievementCategory
- type AchievementGroup
- type AchievementProgress
- type ArticleListing
- type ArticlePrice
- type Bag
- type BankItem
- type Bonus
- type Character
- type Color
- type ColorDetail
- type Continent
- type CraftingDiscipline
- type Currency
- type DailyAchievement
- type DailyAchievementLevel
- type DailyAchievements
- type DetailSpecialization
- type EmblemLayers
- type Equipment
- type EquipmentPvP
- type Exchange
- type Fact
- type FactType
- type File
- type GW2Api
- func (gw2 *GW2Api) Account() (acc Account, err error)
- func (gw2 *GW2Api) AccountAchievements() (achievs []AchievementProgress, err error)
- func (gw2 *GW2Api) AccountBank() (items []BankItem, err error)
- func (gw2 *GW2Api) AccountDyes() (dyes []int, err error)
- func (gw2 *GW2Api) AccountMaterials() (items []MaterialItem, err error)
- func (gw2 *GW2Api) AccountMinis() (minis []int, err error)
- func (gw2 *GW2Api) AccountSkins() (skins []int, err error)
- func (gw2 *GW2Api) AccountWallet() (currency []WalletCurrency, err error)
- func (gw2 *GW2Api) AchievementCategories() (res []int, err error)
- func (gw2 *GW2Api) AchievementCategoryIds(lang string, ids ...int) (achievs []AchievementCategory, err error)
- func (gw2 *GW2Api) AchievementGroupIds(lang string, ids ...string) (achievs []AchievementGroup, err error)
- func (gw2 *GW2Api) AchievementGroups() (res []string, err error)
- func (gw2 *GW2Api) AchievementIds(lang string, ids ...int) (achievs []Achievement, err error)
- func (gw2 *GW2Api) AchievementPages(lang string, page, pageSize int) (achievs []Achievement, err error)
- func (gw2 *GW2Api) Achievements() (res []int, err error)
- func (gw2 *GW2Api) AchievementsDaily() (achievs DailyAchievements, err error)
- func (gw2 *GW2Api) AchievementsDailyTomorrow() (achievs DailyAchievements, err error)
- func (gw2 *GW2Api) Build() (v int, err error)
- func (gw2 *GW2Api) CharacterIds(ids ...string) (chars []Character, err error)
- func (gw2 *GW2Api) Characters() (res []string, err error)
- func (gw2 *GW2Api) CharactersPage(page, pageSize int) (chars []Character, err error)
- func (gw2 *GW2Api) ColorIds(lang string, ids ...int) (colors []Color, err error)
- func (gw2 *GW2Api) Colors() (res []int, err error)
- func (gw2 *GW2Api) CommerceExchangeCoins(quantity int64) (res Exchange, err error)
- func (gw2 *GW2Api) CommerceExchangeGems(quantity int) (res Exchange, err error)
- func (gw2 *GW2Api) CommerceListingIds(ids ...int) (articles []ArticleListing, err error)
- func (gw2 *GW2Api) CommerceListingPages(page int, pageSize int) (res []ArticleListing, err error)
- func (gw2 *GW2Api) CommerceListings() (res []int, err error)
- func (gw2 *GW2Api) CommercePriceIds(ids ...int) (artprices []ArticlePrice, err error)
- func (gw2 *GW2Api) CommercePrices() (res []int, err error)
- func (gw2 *GW2Api) CommerceTransactionsCurrentBuys() (trans []Transaction, err error)
- func (gw2 *GW2Api) CommerceTransactionsCurrentSells() (trans []Transaction, err error)
- func (gw2 *GW2Api) CommerceTransactionsHistoryBuys() (trans []Transaction, err error)
- func (gw2 *GW2Api) CommerceTransactionsHistorySells() (trans []Transaction, err error)
- func (gw2 *GW2Api) ContinentFloorRegionMapPois(continent, floor, region, mapID int) (pois []int, err error)
- func (gw2 *GW2Api) ContinentFloorRegionMapSectors(continent, floor, region, mapID int) (sectors []int, err error)
- func (gw2 *GW2Api) ContinentFloorRegionMapTasks(continent, floor, region, mapID int) (tasks []int, err error)
- func (gw2 *GW2Api) ContinentFloorRegionMaps(continent, floor, region int) (maps []int, err error)
- func (gw2 *GW2Api) ContinentFloorRegions(continent, floor int) (regions []int, err error)
- func (gw2 *GW2Api) ContinentFloors(continent int) (floors []int, err error)
- func (gw2 *GW2Api) ContinentIds(lang string, ids ...int) (conts []Continent, err error)
- func (gw2 *GW2Api) Continents() (res []int, err error)
- func (gw2 *GW2Api) Currencies() (res []int, err error)
- func (gw2 *GW2Api) CurrencyIds(lang string, ids ...int) (currencies []Currency, err error)
- func (gw2 *GW2Api) FileIds(ids ...string) (files []File, err error)
- func (gw2 *GW2Api) Files() (res []string, err error)
- func (gw2 *GW2Api) GuildEmblemBackgroundIds(ids ...int) (layers []EmblemLayers, err error)
- func (gw2 *GW2Api) GuildEmblemForegroundIds(ids ...int) (layers []EmblemLayers, err error)
- func (gw2 *GW2Api) GuildEmblems() (foreground []int, background []int, err error)
- func (gw2 *GW2Api) GuildLog(id string) (log []GuildLogEntry, err error)
- func (gw2 *GW2Api) GuildMembers(id string) (member []GuildMember, err error)
- func (gw2 *GW2Api) GuildPermissionIds(ids ...string) (guild []GuildPermission, err error)
- func (gw2 *GW2Api) GuildPermissions() (res []string, err error)
- func (gw2 *GW2Api) GuildPvPTeams(id string) (teams []GuildTeam, err error)
- func (gw2 *GW2Api) GuildRanks(id string) (guild []GuildRank, err error)
- func (gw2 *GW2Api) GuildStashes(id string) (stash []GuildStash, err error)
- func (gw2 *GW2Api) GuildTreasuries(id string) (treasury []GuildTreasury, err error)
- func (gw2 *GW2Api) GuildUpgradeIds(lang string, ids ...int) (guild []GuildUpgrade, err error)
- func (gw2 *GW2Api) GuildUpgrades() (res []int, err error)
- func (gw2 *GW2Api) HasPermission(p Permission) bool
- func (gw2 *GW2Api) ItemDetails(page int, pageSize int, lang string, ids ...int) ([]Item, error)
- func (gw2 *GW2Api) ItemIds(lang string, ids ...int) (items []Item, err error)
- func (gw2 *GW2Api) ItemPages(page int, pageSize int, lang string) (items []Item, err error)
- func (gw2 *GW2Api) Items() (res []int, err error)
- func (gw2 *GW2Api) MapIds(lang string, ids ...int) (maps []Map, err error)
- func (gw2 *GW2Api) Maps() (res []int, err error)
- func (gw2 *GW2Api) MatchIds(ids ...string) (match []Match, err error)
- func (gw2 *GW2Api) MatchWorld(worldID int) (match Match, err error)
- func (gw2 *GW2Api) Matches() (res []string, err error)
- func (gw2 *GW2Api) MiniIds(lang string, ids ...int) (minis []Mini, err error)
- func (gw2 *GW2Api) Minis() (res []int, err error)
- func (gw2 *GW2Api) ObjectiveIds(lang string, ids ...string) (objs []Objective, err error)
- func (gw2 *GW2Api) Objectives() (res []string, err error)
- func (gw2 *GW2Api) PvPGameIds(ids ...string) (games []PvPGameStats, err error)
- func (gw2 *GW2Api) PvPGames() (res []string, err error)
- func (gw2 *GW2Api) PvPSeasonID(lang string, id string) (res PvPSeason, err error)
- func (gw2 *GW2Api) PvPSeasons() (res []string, err error)
- func (gw2 *GW2Api) PvPStandings() (res []PvPSeasonStanding, err error)
- func (gw2 *GW2Api) PvPStats() (stats PvPStats, err error)
- func (gw2 *GW2Api) QuagganIds(ids ...string) (quag []Quaggan, err error)
- func (gw2 *GW2Api) Quaggans() (res []string, err error)
- func (gw2 *GW2Api) RecipeIds(ids ...int) (recipes []Recipe, err error)
- func (gw2 *GW2Api) RecipeSearchInput(input int) ([]int, error)
- func (gw2 *GW2Api) RecipeSearchOutput(output int) ([]int, error)
- func (gw2 *GW2Api) Recipes() (res []int, err error)
- func (gw2 *GW2Api) Render(signature string, fileID int) (img image.Image, err error)
- func (gw2 *GW2Api) SetAuthentication(auth string) (err error)
- func (gw2 *GW2Api) SetTimeout(t time.Duration)
- func (gw2 *GW2Api) SharedInventory() (slots []SharedInventorySlot, err error)
- func (gw2 *GW2Api) SkinIds(lang string, ids ...int) (skins []Skin, err error)
- func (gw2 *GW2Api) Skins() (res []int, err error)
- func (gw2 *GW2Api) SpecializationIds(lang string, ids ...int) (specs []DetailSpecialization, err error)
- func (gw2 *GW2Api) Specializations() (res []int, err error)
- func (gw2 *GW2Api) Tile(continent, floor, zoom, x, y int) (img image.Image, err error)
- func (gw2 *GW2Api) TokenInfo() (token TokenInfo, err error)
- func (gw2 *GW2Api) TraitIds(lang string, ids ...int) (traits []Trait, err error)
- func (gw2 *GW2Api) Traits() (res []int, err error)
- func (gw2 *GW2Api) WorldIds(lang string, ids ...int) (worlds []World, err error)
- func (gw2 *GW2Api) Worlds() (res []int, err error)
- type GuildLogEntry
- type GuildMember
- type GuildPermission
- type GuildRank
- type GuildStash
- type GuildStashItem
- type GuildTeam
- type GuildTeamStats
- type GuildTreasury
- type GuildTreasuryUpgrade
- type GuildUpgrade
- type GuildUpgradeCost
- type InventoryItem
- type Item
- type LadderStats
- type Listing
- type Map
- type MapWvW
- type Match
- type MatchObjective
- type MaterialItem
- type Mini
- type Objective
- type Permission
- type PetSelection
- type Price
- type ProfessionStats
- type PvPDivision
- type PvPGameScore
- type PvPGameStats
- type PvPSeason
- type PvPSeasonStanding
- type PvPStanding
- type PvPStats
- type PvPTier
- type Quaggan
- type Recipe
- type RecipeIngredient
- type SharedInventorySlot
- type Skill
- type SkillSelection
- type Skills
- type Skin
- type SkinDetails
- type Specalizations
- type Specialization
- type TeamAssoc
- type TeamMulti
- type TokenInfo
- type Trait
- type TraitedFact
- type Transaction
- type WalletCurrency
- type WinLoss
- type World
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID string `json:"id"` Name string `json:"name"` World int `json:"world"` Guilds []string `json:"guilds"` Access string `json:"access"` Created string `json:"created"` FractalLevel int `json:"fractal_level"` DailyAP int `json:"daily_ap"` MonthlyAP int `json:"monthly_ap"` WvWRank int `json:"wvw_rank"` }
Account includes all general information
type Achievement ¶
type Achievement struct { ID int `json:"id"` Icon string `json:"icon"` Name string `json:"name"` Description string `json:"description"` Requirement string `json:"requirement"` Type string `json:"type"` Flags []string `json:"flags"` }
Achievement detailed achievement information
type AchievementCategory ¶
type AchievementCategory struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Order int `json:"order"` Icon string `json:"icon"` Achievements []int `json:"achievements"` // Either GuildWars2 or HeartOfThorns RequiredAccess []string `json:"required_access"` }
AchievementCategory Category description
type AchievementGroup ¶
type AchievementGroup struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Order int `json:"order"` Categories []int `json:"categories"` }
AchievementGroup Group description
type AchievementProgress ¶
type AchievementProgress struct { ID int `json:"id"` Current int `json:"current"` // Max - The amount needed to complete the achievement. Most WvW achievements // have this set to -1. Max int `json:"max"` Done bool `json:"done"` // Bits - This attribute contains an array of numbers from 0 to 7, giving more // specific information on the progress for the achievement. The meaning of // each 0-7 value varies with each achievement. ( Bits []int `json:"bits"` }
AchievementProgress represents detailed information about the accounts progress on an achievement.
type ArticleListing ¶
type ArticleListing struct { ID int `json:"id"` Buys []Listing `json:"buys"` Sells []Listing `json:"sells"` }
ArticleListing includes the id of the listing and a list of buys and sells
type ArticlePrice ¶
ArticlePrice Listings for a specific item (highest buy, lowest sell)
type Bag ¶
type Bag struct { ID int `json:"id"` Size int `json:"size"` Inventory []InventoryItem `json:"inventory"` }
Bag on the character with size and inventory
type BankItem ¶
type BankItem struct { ID int `json:"id"` Count int `json:"count"` Skin int `json:"skin"` Upgrades []int `json:"upgrades"` Infusions []int `json:"infusions"` }
BankItem describes an item stored in the players normal bank
type Character ¶
type Character struct { Name string `json:"name"` Race string `json:"race"` Gender string `json:"gender"` Profession string `json:"profession"` Level int `json:"level"` Guild string `json:"guild"` Created string `json:"created"` Age int `json:"age"` Deaths int `json:"deaths"` Crafting []CraftingDiscipline `json:"crafting"` Specalization Specalizations `json:"specalization"` Skill Skills `json:"skills"` Bags []Bag `json:"bags"` Equipment []Equipment `json:"equipment"` EquipmentPvP EquipmentPvP `json:"equipment_pvp"` }
Character combines all information about the character
type Color ¶
type Color struct { ID int `json:"id"` Name string `json:"name"` BaseRGB [3]int `json:"base_rgb"` Cloth ColorDetail `json:"cloth"` Leather ColorDetail `json:"leather"` Metal ColorDetail `json:"metal"` }
Color with specific values for the three armor types
type ColorDetail ¶
type ColorDetail struct { Brightness int `json:"brightness"` Contrast float32 `json:"contrast"` Hue int `json:"hue"` Saturation float32 `json:"saturation"` Lightness float32 `json:"lightness"` RGB [3]int `json:"rgb"` }
ColorDetail per armor type
type Continent ¶
type Continent struct { ID int `json:"id"` Name string `json:"name"` ContinentDims []int `json:"continent_dims"` MinZoom int `json:"min_zoom"` MaxZoom int `json:"max_zoom"` Floors []int `json:"floors"` }
Continent information
type CraftingDiscipline ¶
type CraftingDiscipline struct { Discipline string `json:"discipline"` Rating int `json:"rating"` Active bool `json:"active"` }
CraftingDiscipline contains information about learned crafting discplines on the character and shows their active state
type Currency ¶
type Currency struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Icon string `json:"icon"` Order int `json:"order"` }
Currency detail struct
type DailyAchievement ¶
type DailyAchievement struct { ID int `json:"id"` Level DailyAchievementLevel `json:"level"` Requirement []string `json:"required_access"` }
DailyAchievement for the gamemode
type DailyAchievementLevel ¶
DailyAchievementLevel range for the achievement. Determining if it is visible to a character or not
type DailyAchievements ¶
type DailyAchievements struct { PvE []DailyAchievement `json:"pve"` PvP []DailyAchievement `json:"pvp"` WvW []DailyAchievement `json:"wvw"` Fractals []DailyAchievement `json:"fractals"` Special []DailyAchievement `json:"special"` }
DailyAchievements structured by their gamemode
type DetailSpecialization ¶
type DetailSpecialization struct { ID int `json:"id"` Name string `json:"name"` Elite bool `json:"elite"` Icon string `json:"icon"` Background string `json:"background"` MinorTraits []int `json:"minor_traits"` MajorTraits []int `json:"major_traits"` }
DetailSpecialization spec lines and their traits
type EmblemLayers ¶
EmblemLayers for the requested Fore/Background
type Equipment ¶
type Equipment struct { ID int `json:"id"` Slot string `json:"slot"` Upgrades []int `json:"upgrades"` Infusions []int `json:"infusions"` Skin int `json:"skin"` }
Equipment worn by the character
type EquipmentPvP ¶
type EquipmentPvP struct { // references PvPAmulets Amulet int `json:"amulet"` Rune int `json:"rune"` // UI order left to right Sigils []int `json:"sigils"` }
EquipmentPvP selected items in PvP mode
type Fact ¶
type Fact struct { Text string `json:"text"` Icon string `json:"icon"` Type string `json:"type"` Facts []FactType `json:"facts"` // Only as TraitedFact RequiresTrait int `json:"requires_trait"` Overrides int `json:"overrides"` }
Fact associated with a trait or skill
type FactType ¶
type FactType struct { //Common fields Text string `json:"text"` Type string `json:"type"` Icon string `json:"icon"` Description string `json:"description"` Percent int `json:"percent"` Target string `json:"target"` Duration int `json:"duration"` Status string `json:"status"` ApplyCount int `json:"apply_count"` Value int `json:"value"` // BuffConversionFact Source string `json:"source"` // ComboFieldFact FinisherType string `json:"finisher_type"` // DamageFact HitCount int `json:"hit_count"` // DistanceFact Distance int `json:"distance"` // PrefixedBuffFact Prefix Fact `json:"prefix"` }
FactType - One of the types a fact can be Set fields depend on the Type
type GW2Api ¶
type GW2Api struct {
// contains filtered or unexported fields
}
GW2Api is the state holder of the API. It includes authentication information
func NewAuthenticatedGW2Api ¶
NewAuthenticatedGW2Api returns an authenticated GW2Api or an error if authentication failed
Example ¶
var api *GW2Api var err error if api, err = NewAuthenticatedGW2Api("<APIKEY>"); err != nil { fmt.Printf("Failed to connect to the API: %s", err) } if api.HasPermission(PermAccount) { var acc Account if acc, err = api.Account(); err != nil { fmt.Printf("API did not answer correctly: %s", err) } fmt.Printf("%s\n", acc.Name) }
Output:
func NewGW2Api ¶
func NewGW2Api() *GW2Api
NewGW2Api returns a simple GW2Api with a HTTP timeout of 15 seconds
Example ¶
api := NewGW2Api() build, _ := api.Build() fmt.Printf("%d\n", build)
Output:
func (*GW2Api) AccountAchievements ¶
func (gw2 *GW2Api) AccountAchievements() (achievs []AchievementProgress, err error)
AccountAchievements returns a list of the accounts progress with all known achievements in the game
func (*GW2Api) AccountBank ¶
AccountBank returns an array of objects, each representing an item slot in the vault. If a slot is empty, it will return null. The amount of slots/bank tabs is implied by the length of the array. Requires authentication
func (*GW2Api) AccountDyes ¶
AccountDyes returns an array of dyes unlocked by the player. The IDs can be resolved via ColorIds() Requires authentication
func (*GW2Api) AccountMaterials ¶
func (gw2 *GW2Api) AccountMaterials() (items []MaterialItem, err error)
AccountMaterials returns an array of objects, each representing a material that can be stored in the vault. Every material will be returned, even if they have a count of 0 Requires authentication
func (*GW2Api) AccountMinis ¶
AccountMinis returns the ids of all unlocked minis in the accounts collection
func (*GW2Api) AccountSkins ¶
AccountSkins returns an array of skins unlocked by the player. The IDs can be resolved via SkinIds() Requires authentication
func (*GW2Api) AccountWallet ¶
func (gw2 *GW2Api) AccountWallet() (currency []WalletCurrency, err error)
AccountWallet returns an array of currencies owned by the player. The IDs can be resolved via CurrencyIds() Requires authentication
func (*GW2Api) AchievementCategories ¶
AchievementCategories list of all achievement categories
func (*GW2Api) AchievementCategoryIds ¶
func (gw2 *GW2Api) AchievementCategoryIds(lang string, ids ...int) (achievs []AchievementCategory, err error)
AchievementCategoryIds localized achievement categories by id
func (*GW2Api) AchievementGroupIds ¶
func (gw2 *GW2Api) AchievementGroupIds(lang string, ids ...string) (achievs []AchievementGroup, err error)
AchievementGroupIds localized achievement groups by id
func (*GW2Api) AchievementGroups ¶
AchievementGroups list of all achievement groups
func (*GW2Api) AchievementIds ¶
func (gw2 *GW2Api) AchievementIds(lang string, ids ...int) (achievs []Achievement, err error)
AchievementIds localized achievement details via ids
func (*GW2Api) AchievementPages ¶
func (gw2 *GW2Api) AchievementPages(lang string, page, pageSize int) (achievs []Achievement, err error)
AchievementPages returns a paginated list of all achievements. Use it to grab all achievements from the API. Return values are localized to lang
func (*GW2Api) Achievements ¶
Achievements - List of all achievement ids
func (*GW2Api) AchievementsDaily ¶
func (gw2 *GW2Api) AchievementsDaily() (achievs DailyAchievements, err error)
AchievementsDaily returns the daily achievements which can be completed today
func (*GW2Api) AchievementsDailyTomorrow ¶
func (gw2 *GW2Api) AchievementsDailyTomorrow() (achievs DailyAchievements, err error)
AchievementsTomorrow returns the daily achievements which can be completed tomorrow
func (*GW2Api) CharacterIds ¶
CharacterIds requests detailed information about the characters requested via the IDs. The IDs can also be character names as e.g. provided by the Characters() API Call Requires authentication
func (*GW2Api) Characters ¶
Characters returns an array of character names associated with the account. The names can be used to request detailed information via CharacterIds() Requires authentication
func (*GW2Api) CharactersPage ¶
CharactersPage allows pagination for the character objects and enables the request of all character objects Requires authentication
func (*GW2Api) CommerceExchangeCoins ¶
CommerceExchangeCoins returns the amount of gems given for the quantity of gems
func (*GW2Api) CommerceExchangeGems ¶
CommerceExchangeGems returns the amount of gold given for the quantity of coin
func (*GW2Api) CommerceListingIds ¶
func (gw2 *GW2Api) CommerceListingIds(ids ...int) (articles []ArticleListing, err error)
CommerceListingIds returns the article listings for the provided ids
func (*GW2Api) CommerceListingPages ¶
func (gw2 *GW2Api) CommerceListingPages(page int, pageSize int) (res []ArticleListing, err error)
CommerceListingPages for paginating through all existing listings
func (*GW2Api) CommerceListings ¶
CommerceListings returns a list of all current transactions ids
func (*GW2Api) CommercePriceIds ¶
func (gw2 *GW2Api) CommercePriceIds(ids ...int) (artprices []ArticlePrice, err error)
CommercePriceIds returns price information about the requested ids
func (*GW2Api) CommercePrices ¶
CommercePrices returns a list of all ids
func (*GW2Api) CommerceTransactionsCurrentBuys ¶
func (gw2 *GW2Api) CommerceTransactionsCurrentBuys() (trans []Transaction, err error)
CommerceTransactionsCurrentBuys returns all current buy orders of the account
func (*GW2Api) CommerceTransactionsCurrentSells ¶
func (gw2 *GW2Api) CommerceTransactionsCurrentSells() (trans []Transaction, err error)
CommerceTransactionsCurrentSells returns all current sell orders of the account
func (*GW2Api) CommerceTransactionsHistoryBuys ¶
func (gw2 *GW2Api) CommerceTransactionsHistoryBuys() (trans []Transaction, err error)
CommerceTransactionsHistoryBuys returns all past buy orders of the account for the last 90 days
func (*GW2Api) CommerceTransactionsHistorySells ¶
func (gw2 *GW2Api) CommerceTransactionsHistorySells() (trans []Transaction, err error)
CommerceTransactionsHistorySells returns all past sell orders of the account for the last 90 days
func (*GW2Api) ContinentFloorRegionMapPois ¶
func (gw2 *GW2Api) ContinentFloorRegionMapPois(continent, floor, region, mapID int) (pois []int, err error)
ContinentFloorRegionMapPois returns all points of interest on the continent, floor, region and map
func (*GW2Api) ContinentFloorRegionMapSectors ¶
func (gw2 *GW2Api) ContinentFloorRegionMapSectors(continent, floor, region, mapID int) (sectors []int, err error)
ContinentFloorRegionMapSectors returns all sectors on the continent, floor, region and map
func (*GW2Api) ContinentFloorRegionMapTasks ¶
func (gw2 *GW2Api) ContinentFloorRegionMapTasks(continent, floor, region, mapID int) (tasks []int, err error)
ContinentFloorRegionMapTasks returns all taskson the continent, floor, region and map
func (*GW2Api) ContinentFloorRegionMaps ¶
ContinentFloorRegionMaps returns all maps ont he continent, floor and region
func (*GW2Api) ContinentFloorRegions ¶
ContinentFloorRegions returns all regions on the continent and floor
func (*GW2Api) ContinentFloors ¶
ContinentFloors returns all floor ids on the continent
func (*GW2Api) ContinentIds ¶
ContinentIds returns continent information localized to lang for requested ids
func (*GW2Api) Continents ¶
Continents reutns a list of continent ids. Only 1 = Tyria and 2 = Mists for now
func (*GW2Api) Currencies ¶
Currencies list of them
func (*GW2Api) CurrencyIds ¶
CurrencyIds localized currency information
func (*GW2Api) GuildEmblemBackgroundIds ¶
func (gw2 *GW2Api) GuildEmblemBackgroundIds(ids ...int) (layers []EmblemLayers, err error)
GuildEmblemBackgroundIds returns the layers for the requested backgrounds
func (*GW2Api) GuildEmblemForegroundIds ¶
func (gw2 *GW2Api) GuildEmblemForegroundIds(ids ...int) (layers []EmblemLayers, err error)
GuildEmblemForegroundIds returns the layers for the requested foregrounds
func (*GW2Api) GuildEmblems ¶
GuildEmblems returns two lists for all emblem layers
func (*GW2Api) GuildLog ¶
func (gw2 *GW2Api) GuildLog(id string) (log []GuildLogEntry, err error)
GuildLog returns up to a 100 of each type of log entry
func (*GW2Api) GuildMembers ¶
func (gw2 *GW2Api) GuildMembers(id string) (member []GuildMember, err error)
GuildMembers returns a list of all members
func (*GW2Api) GuildPermissionIds ¶
func (gw2 *GW2Api) GuildPermissionIds(ids ...string) (guild []GuildPermission, err error)
GuildPermissionIds Names/Description of permissions
func (*GW2Api) GuildPermissions ¶
GuildPermissions Grab them all
func (*GW2Api) GuildPvPTeams ¶
GuildPvPTeams returns a list of teams for a guild
func (*GW2Api) GuildRanks ¶
GuildRanks Show all ranks in the guild
func (*GW2Api) GuildStashes ¶
func (gw2 *GW2Api) GuildStashes(id string) (stash []GuildStash, err error)
GuildStashes returns a list of all guild bank tabs and their content
func (*GW2Api) GuildTreasuries ¶
func (gw2 *GW2Api) GuildTreasuries(id string) (treasury []GuildTreasury, err error)
GuildTreasuries returns a list of all currently needed items for any guild upgrade
func (*GW2Api) GuildUpgradeIds ¶
func (gw2 *GW2Api) GuildUpgradeIds(lang string, ids ...int) (guild []GuildUpgrade, err error)
GuildUpgradeIds Translated information
func (*GW2Api) GuildUpgrades ¶
GuildUpgrades Get them all
func (*GW2Api) HasPermission ¶
func (gw2 *GW2Api) HasPermission(p Permission) bool
HasPermission checks for permissions of the API Key provided by the user
func (*GW2Api) ItemDetails ¶
ItemDetails returns a list of items depending on the parameters either with pagination or as requested by ids
func (*GW2Api) ItemIds ¶
ItemIds returns a list of detailed item description for the requested ids. Names of the items are localized according to the lang parameter
func (*GW2Api) ItemPages ¶
ItemPages returns a list of detailed item description for the requested page. Names of the items are localized according to the lang parameter
func (*GW2Api) MatchIds ¶
MatchIds returns matches as requested by ids in the form provided by Matches(). Use special id `all` for every match in US/EU
func (*GW2Api) MatchWorld ¶
MatchWorld finds the match the server id is participating in
func (*GW2Api) MiniIds ¶
MiniIds returns the detailed information about requested minis localized to lang
func (*GW2Api) ObjectiveIds ¶
ObjectiveIds returns a list of objectives as request by ids. Use special id `all` to request all objectives
func (*GW2Api) Objectives ¶
Objectives returns a list of all objectives on wvw maps
func (*GW2Api) PvPGameIds ¶
func (gw2 *GW2Api) PvPGameIds(ids ...string) (games []PvPGameStats, err error)
PvPGameIds fetches the details for the requested ids
func (*GW2Api) PvPSeasonID ¶
PvPSeasonID fetches information on a season id
func (*GW2Api) PvPSeasons ¶
PvPSeasons returns a list of season ids
func (*GW2Api) PvPStandings ¶
func (gw2 *GW2Api) PvPStandings() (res []PvPSeasonStanding, err error)
PvPStandings fetches the current and previsous standings during the pvp seasons
func (*GW2Api) QuagganIds ¶
QuagganIds ids -> urls for the quaggan images
func (*GW2Api) RecipeSearchInput ¶
RecipeSearchInput searches for recipes which use the input item id
func (*GW2Api) RecipeSearchOutput ¶
RecipeSearchOutput searches for recipes which output the item id
func (*GW2Api) SetAuthentication ¶
SetAuthentication adds authentication to a previously un-authenticated instance of GW2Api
func (*GW2Api) SetTimeout ¶
SetTimeout set HTTP timeout for all new HTTP connections started from this instance
func (*GW2Api) SharedInventory ¶
func (gw2 *GW2Api) SharedInventory() (slots []SharedInventorySlot, err error)
SharedInventory returns the list of items currently in the shared inventory
func (*GW2Api) SpecializationIds ¶
func (gw2 *GW2Api) SpecializationIds(lang string, ids ...int) (specs []DetailSpecialization, err error)
SpecializationIds returns a localized detail object for the requested ids
func (*GW2Api) Specializations ¶
Specializations returns the list of all
func (*GW2Api) Tile ¶
Tile fetches a rendered JPEG tile for the game map on the requested continent/floor at zoom level and for the coordinates
func (*GW2Api) TokenInfo ¶
TokenInfo requests the token information from the authenticated API Requires authentication
type GuildLogEntry ¶
type GuildLogEntry struct { ID int `json:"id"` Time time.Time `json:"time"` Type string `json:"type"` //type = treasury ItemID int `json:"item_id"` Count int `json:"count"` //type = motd Motd string `json:"motd"` //type = (motd|joined|invited) User string `json:"user"` //type = influence Activity string `json:"activity"` TotalParticipants int `json:"total_participants"` Participants []string `json:"participants"` //type = rank_change ChangedBy string `json:"changed_by"` OldRank string `json:"old_rank"` NewRank string `json:"new_rank"` //type = invited InvitedBy string `json:"invited_by"` //type = stash Operation string `json:"operation"` Coints int `json:"coins"` //type = upgrade UpgradeID int `json:"upgrade_id"` Action string `json:"action"` }
GuildLogEntry returns information about certain events in a guild's log
type GuildMember ¶
type GuildMember struct { Name string `json:"name"` Rank string `json:"rank"` Joined time.Time `json:"joined"` // Only as part of guild team Role string `json:"role"` }
GuildMember Accountname, current rank and date they joined
type GuildPermission ¶
type GuildPermission struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` }
GuildPermission Name/Desc basically
type GuildRank ¶
type GuildRank struct { ID string `json:"id"` Order int `json:"order"` Permissions []string `json:"permissions"` }
GuildRank Granted Permissions and Order to sorty by
type GuildStash ¶
type GuildStash struct { UpgradeID int `json:"upgrade_id"` Size int `json:"size"` Coins int `json:"coins"` Inventory []GuildStashItem `json:"inventory"` }
GuildStash represents a bank tab in the guild bank
type GuildStashItem ¶
GuildStashItem represents a single slot in one of the bank tabs
type GuildTeam ¶
type GuildTeam struct { ID int `json:"id"` Members []GuildMember `json:"members"` Name string `json:"name"` Aggregate WinLoss `json:"aggregate"` Ladders LadderStats `json:"ladders"` Games PvPGameStats `json:"games"` Seasons GuildTeamStats `json:"seasons"` }
GuildTeam a designated team for PvP
type GuildTeamStats ¶
type GuildTeamStats struct { SeasonID string `json:"id"` Wins int `json:"wins"` Losses int `json:"losses"` Rating int `json:"rating"` }
GuildTeamStats per season stats of a guild team
type GuildTreasury ¶
type GuildTreasury struct { ID int `json:"id"` Count int `json:"count"` NeededBy []GuildTreasuryUpgrade `json:"needed_by"` }
GuildTreasury represents the need for an item. NeededBy show the upgrades needing it
type GuildTreasuryUpgrade ¶
GuildTreasuryUpgrade represents an upgrade which requires the parent ressource
type GuildUpgrade ¶
type GuildUpgrade struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` BuildTime int `json:"build_time"` Icon string `json:"icon"` Type string `json:"type"` RequiredLevel int `json:"required_level"` Experience int `json:"experience"` Prerequisites []int `json:"prerequisites"` Costs []GuildUpgradeCost `json:"costs"` }
GuildUpgrade All the Upgrade Information
type GuildUpgradeCost ¶
type GuildUpgradeCost struct { Type string `json:"type"` Count int `json:"count"` Name string `json:"name"` ItemID int `json:"item_id"` }
GuildUpgradeCost specific costs of an upgrade. Type like Collection or Item
type InventoryItem ¶
InventoryItem Item in a characters inventory and their count
type Item ¶
type Item struct { ID int `json:"id"` Name string `json:"name"` Icon string `json:"icon"` Description string `json:"description,omitempty"` Type string `json:"type"` Rarity string `json:"rarity"` Level int `json:"level"` VendorValue int `json:"vendor_value"` DefaultSkin int `json:"default_skin"` GameTypes []string `json:"game_types"` Flags []string `json:"flags"` Restrictions []string `json:"restrictions"` Details map[string]interface{} `json:"details"` }
Item includes detailed information about items as requested by the endpoints
type LadderStats ¶
LadderStats WinLoss per queue
type Listing ¶
type Listing struct { Listings int `json:"listings"` UnitPrice int `json:"unit_price"` Quantity int `json:"quantity"` }
Listing includes number of listings at the unit price with respective quantity
type Map ¶
type Map struct { ID int `json:"id"` Name string `json:"name"` MinLevel int `json:"min_level"` MaxLevel int `json:"max_level"` DefaultFloor int `json:"default_floor"` Floors []int `json:"floors"` RegionID int `json:"region_id"` RegionName string `json:"region_name"` ContinentID int `json:"continent_id"` ContinentName string `json:"continent_name"` MapRect [2][2]int `json:"map_rect"` ContinentRect [2][2]int `json:"continent_rect"` }
Map holds specific map details. ContinentID and RegionID can be used with the API to find higher orders of association
type MapWvW ¶
type MapWvW struct { ID int `json:"id"` Type string `json:"type"` Scores TeamAssoc `json:"scores"` Bonuses []Bonus `json:"bonuses"` Deaths TeamAssoc `json:"deaths"` Kills TeamAssoc `json:"kills"` Objectives []MatchObjective `json:"objectives"` }
MapWvW - One of the four maps and their status
type Match ¶
type Match struct { ID string `json:"id"` StartTime time.Time `json:"start_time"` EndTime time.Time `json:"end_time"` Scores TeamAssoc `json:"scores"` Worlds TeamAssoc `json:"worlds"` AllWorlds TeamMulti `json:"all_worlds"` Deaths TeamAssoc `json:"deaths"` Kills TeamAssoc `json:"kills"` Maps []MapWvW `json:"maps"` }
Match including overall stats and indivdual maps with stats
type MatchObjective ¶
type MatchObjective struct { ID string `json:"id"` Type string `json:"type"` Owner string `json:"owner"` LastFlipped string `json:"last_flipped"` ClaimedBy string `json:"claimed_by"` ClaimedAt string `json:"claimed_at"` }
MatchObjective - Map objectives such as towers, keeps, etc
type MaterialItem ¶
type MaterialItem struct { ID int `json:"id"` Count int `json:"count"` Category int `json:"category"` }
MaterialItem represents a material stored in the material storage of the player Requires authentication
type Mini ¶
type Mini struct { ID int `json:"id"` Name string `json:"name"` Icon string `json:"icon"` Order int `json:"order"` ItemID int `json:"item_id"` }
Mini has the basic information and the associated item id for the mini
type Objective ¶
type Objective struct { ID string `json:"id"` Name string `json:"name"` SectorID int `json:"sector_id"` Type string `json:"type"` MapType string `json:"map_type"` MapID int `json:"map_id"` Coord []float32 `json:"coord"` Marker string `json:"marker"` }
Objective - Map objectives such as towers, keeps, etc
type Permission ¶
type Permission uint
Permission abstracts the bitmask containing permission information
const ( PermAccount Permission = iota PermCharacter PermInventory PermTradingpost PermWallet PermUnlocks PermPvP PermBuilds PermProgression PermGuilds PermSize )
Perm* represent the specific permission as required by the API
type PetSelection ¶
PetSelection for rangers
type ProfessionStats ¶
type ProfessionStats struct { Elementalist WinLoss `json:"elementalist"` Engineer WinLoss `json:"engineer"` Guardian WinLoss `json:"guardian"` Mesmer WinLoss `json:"mesmer"` Necromancer WinLoss `json:"necromancer"` Ranger WinLoss `json:"ranger"` Revenant WinLoss `json:"revenant"` Thief WinLoss `json:"thief"` Warrior WinLoss `json:"warrior"` }
ProfessionStats WinLoss per profession
type PvPDivision ¶
type PvPDivision struct { Name string `json:"name"` Flags []string `json:"flags"` LargeIcon string `json:"large_icon"` SmallIcon string `json:"small_icon"` PipIcon string `json:"pip_icon"` Tiers []PvPTier `json:"tiers"` }
PvPDivision mostly for graphical interfaces
type PvPGameScore ¶
PvPGameScore single games final score
type PvPGameStats ¶
type PvPGameStats struct { ID string `json:"id"` MapID int `json:"map_id"` Started time.Time `json:"started"` Ended time.Time `json:"ended"` Result string `json:"result"` Team string `json:"team"` Profession string `json:"profession"` Scores PvPGameScore `json:"scores"` RatingType string `json:"rating_type"` }
PvPGameStats all information about a match
type PvPSeason ¶
type PvPSeason struct { ID string `json:"id"` Name string `json:"name"` Start time.Time `json:"start"` End time.Time `json:"end"` Active bool `json:"active"` Divisions []PvPDivision `json:"divisions"` }
PvPSeason Meta object for pvp seasons
type PvPSeasonStanding ¶
type PvPSeasonStanding struct { Current PvPStanding `json:"current"` Best PvPStanding `json:"best"` SeasonID string `json:"season_id"` }
PvPSeasonStanding meta object for the call
type PvPStanding ¶
type PvPStanding struct { TotalPoints int `json:"total_points"` Division int `json:"division"` Tier int `json:"tier"` Points int `json:"points"` Repeats int `json:"repeats"` }
PvPStanding TotalPoints is the definitive amount
type PvPStats ¶
type PvPStats struct { PvPRank int `json:"pvp_rank"` PvPRankPoints int `json:"pvp_rank_points"` PvPRankRollovers int `json:"pvp_rank_rollovers"` Aggregate WinLoss `json:"aggregate"` Professions ProfessionStats `json:"professions"` Ladders LadderStats `json:"ladders"` }
PvPStats Meta object for the stats
type Recipe ¶
type Recipe struct { ID int `json:"id"` Type string `json:"type"` OutputItemID int `json:"output_item_id"` OutputItemCount int `json:"output_item_count"` TimeToCraftMS int `json:"time_to_craft_ms"` Disciplines []string `json:"disciplines"` MinRating int `json:"min_rating"` Flags []string `json:"flags"` Ingredients []RecipeIngredient `json:"ingredients"` }
Recipe meta object for the recipes
type RecipeIngredient ¶
RecipeIngredient for the ingredient list
type Skill ¶
type Skill struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Icon string `json:"icon"` Facts []Fact `json:"facts"` TraitedFacts []TraitedFact `json:"traited_facts"` }
Skill with associated facts
type SkillSelection ¶
type SkillSelection struct { Legends []string `json:"legends"` Heal int `json:"heal"` Utility []int `json:"utility"` Elite int `json:"elite"` Pets PetSelection `json:"pets"` }
SkillSelection shows the currently selected heals, utility elite and legends
type Skills ¶
type Skills struct { PvE SkillSelection `json:"pve"` PvP SkillSelection `json:"pvp"` WvW SkillSelection `json:"wvw"` }
Skills per game type
type Skin ¶
type Skin struct { ID int `json:"id"` Name string `json:"name"` Type string `json:"type"` Flags []string `json:"flags"` Restrictions []string `json:"restrictions"` Icon string `json:"icon"` Description string `json:"description"` Details SkinDetails `json:"details"` }
Skin all information on the skin
type SkinDetails ¶
type SkinDetails struct { Type string `json:"type"` WeightClass string `json:"weight_class"` DamageType string `json:"damage_type"` }
SkinDetails Either WeightClass(Armor) or DamageType(Weapon) is set depending on Type
type Specalizations ¶
type Specalizations struct { PvE []Specialization `json:"pve"` PvP []Specialization `json:"pvp"` WvW []Specialization `json:"wvw"` }
Specalizations is a meta object which holds the specalizations associated with the different game types
type Specialization ¶
Specialization represents the currently selected one and includes all active traits on the character
type TeamMulti ¶
type TeamMulti struct { Green []int `json:"green"` Blue []int `json:"blue"` Red []int `json:"red"` }
TeamMulti Used in multi association for teams
type TokenInfo ¶
type TokenInfo struct { ID string `json:"id"` Name string `json:"name"` Permissions []string `json:"permissions"` }
TokenInfo contains information about the provided API Key of the user. Including the name of the key as set by the user and the permissions associated with it
type Trait ¶
type Trait struct { ID int `json:"id"` Name string `json:"icon"` Icon string `json:"icon"` Description string `json:"description"` Specialization int `json:"specialization"` Tier int `json:"tier"` Order int `josn:"order"` Slot string `json:"slot"` Facts []Fact `json:"facts"` TraitedFacts []TraitedFact `json:"traited_facts"` Skills []Skill `json:"skills"` }
Trait overview with facts
type Transaction ¶
type Transaction struct { ID int `json:"id"` ItemID int `json:"item_id"` Price int `json:"price"` Quantity int `json:"quantity"` Created string `json:"created"` Purchased string `json:"purchased"` }
Transaction represents one of the accounts listed buy or sell orders
type WalletCurrency ¶
WalletCurrency represents a currency and the amount owned by the player