wowapi

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

README

World of Warcraft API Golang

This is a simple wrapper for the World of Warcraft API written in Go.

Usage

Get your API Access here : https://develop.battle.net/access/clients

Installation

go get -u github.com/raph6/wowapi

Usage

import "github.com/raph6/wowapi"

func main() {
    // API_CLIENT_ID, API_SECRET, region, lang
    // accepted region ->  eu | us | kr | tw
    // accepted lang -> en_US | es_MX | pt_BR | en_GB | es_ES | fr_FR | ru_RU | de_DE | pt_PT | it_IT | zh_TW | ko_KR
    client, err := wowapi.NewClient("xx_API_CLIENT_ID_xx", "xx_API_SECRET_xx", "eu", "fr_FR")
    if err != nil {
        fmt.Println(err)
        return
    }

    // Realm, Name
    titles, err := client.CharacterTitles("Kirin-Tor", "Vimdiesel")
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(titles)
}

Available methods

client.CharacterAchievementsStatistics(realm string, name string)
client.CharacterAchievements(realm string, name string)
client.CharacterAppearance(realm string, name string)
client.CharacterCharacterMedia(realm string, name string)
client.CharacterCharacterStatus(realm string, name string)
client.CharacterCollectionsHeirlooms(realm string, name string)
client.CharacterCollectionsMounts(realm string, name string)
client.CharacterCollectionsPets(realm string, name string)
client.CharacterCollectionsToys(realm string, name string)
client.CharacterCollections(realm string, name string)
client.CharacterEncountersDungeons(realm string, name string)
client.CharacterEncountersRaids(realm string, name string)
client.CharacterEncounters(realm string, name string)
client.CharacterEquipment(realm string, name string)
client.CharacterMythicKeystoneProfile(realm string, name string)
client.CharacterPvpSummary(realm string, name string)
client.CharacterQuestsCompleted(realm string, name string)
client.CharacterQuests(realm string, name string)
client.CharacterSoulbinds(realm string, name string)

You can also use the client like this

req, err := wowapi.Client("xx_API_CLIENT_ID_xx", "xx_API_SECRET_xx", "eu", "fr_FR")
...
body, err := req("/profile/wow/character/kirin-tor/vimdiesel/statistics")
...
var data interface{}
err = json.Unmarshal(body, &data)
...
fmt.Println(data)

Todo

  • All tests
  • Raider.io
  • Hunter pets methods

Tests

API_CLIENT_ID=xxxxx API_SECRET=xxxxx go test

Official documentation : https://develop.battle.net/documentation/world-of-warcraft

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Achievements

type Achievements struct {
	RecentEvents []struct {
		Achievement struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"achievement"`
		Timestamp float64 `json:"timestamp"`
	} `json:"recent_events"`
	Character struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name  string  `json:"name"`
		Id    float64 `json:"id"`
		Realm struct {
			Id   float64 `json:"id"`
			Slug string  `json:"slug"`
			Key  struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string `json:"name"`
		} `json:"realm"`
	} `json:"character"`
	Statistics struct {
		Href string `json:"href"`
	} `json:"statistics"`
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	TotalQuantity float64 `json:"total_quantity"`
	TotalPoints   float64 `json:"total_points"`
	Achievements  []struct {
		Id          float64 `json:"id"`
		Achievement struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"achievement"`
		Criteria struct {
			Id          float64 `json:"id"`
			IsCompleted bool    `json:"is_completed"`
		} `json:"criteria"`
		CompletedTimestamp float64 `json:"completed_timestamp"`
	} `json:"achievements"`
	CategoryProgress []struct {
		Points   float64 `json:"points"`
		Category struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"category"`
		Quantity float64 `json:"quantity"`
	} `json:"category_progress"`
}

type AchievementsStatistics

type AchievementsStatistics struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Character struct {
		Name  string  `json:"name"`
		Id    float64 `json:"id"`
		Realm struct {
			Slug string `json:"slug"`
			Key  struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"realm"`
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
	} `json:"character"`
	Categories []struct {
		Id            float64 `json:"id"`
		Name          string  `json:"name"`
		SubCategories []struct {
			Id         float64 `json:"id"`
			Name       string  `json:"name"`
			Statistics []struct {
				Id                   float64 `json:"id"`
				Name                 string  `json:"name"`
				LastUpdatedTimestamp float64 `json:"last_updated_timestamp"`
				Quantity             float64 `json:"quantity"`
			} `json:"statistics"`
		} `json:"sub_categories"`
		Statistics []struct {
			Name                 string  `json:"name"`
			LastUpdatedTimestamp float64 `json:"last_updated_timestamp"`
			Quantity             float64 `json:"quantity"`
			Id                   float64 `json:"id"`
		} `json:"statistics"`
	} `json:"categories"`
}

type Appearance

type Appearance struct {
	Customizations []struct {
		Option struct {
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"option"`
		Choice struct {
			Id           float64 `json:"id"`
			DisplayOrder float64 `json:"display_order"`
		} `json:"choice"`
	} `json:"customizations"`
	PlayableClass struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name string  `json:"name"`
		Id   float64 `json:"id"`
	} `json:"playable_class"`
	Gender struct {
		Type string `json:"type"`
		Name string `json:"name"`
	} `json:"gender"`
	PlayableRace struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name string  `json:"name"`
		Id   float64 `json:"id"`
	} `json:"playable_race"`
	ActiveSpec struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name string  `json:"name"`
		Id   float64 `json:"id"`
	} `json:"active_spec"`
	Faction struct {
		Type string `json:"type"`
		Name string `json:"name"`
	} `json:"faction"`
	GuildCrest struct {
		Emblem struct {
			Id    float64 `json:"id"`
			Media struct {
				Key struct {
					Href string `json:"href"`
				} `json:"key"`
				Id float64 `json:"id"`
			} `json:"media"`
			Color struct {
				Id   float64 `json:"id"`
				Rgba struct {
					B float64 `json:"b"`
					A float64 `json:"a"`
					R float64 `json:"r"`
					G float64 `json:"g"`
				} `json:"rgba"`
			} `json:"color"`
		} `json:"emblem"`
		Border struct {
			Id    float64 `json:"id"`
			Media struct {
				Key struct {
					Href string `json:"href"`
				} `json:"key"`
				Id float64 `json:"id"`
			} `json:"media"`
			Color struct {
				Rgba struct {
					B float64 `json:"b"`
					A float64 `json:"a"`
					R float64 `json:"r"`
					G float64 `json:"g"`
				} `json:"rgba"`
				Id float64 `json:"id"`
			} `json:"color"`
		} `json:"border"`
		Background struct {
			Color struct {
				Id   float64 `json:"id"`
				Rgba struct {
					R float64 `json:"r"`
					G float64 `json:"g"`
					B float64 `json:"b"`
					A float64 `json:"a"`
				} `json:"rgba"`
			} `json:"color"`
		} `json:"background"`
	} `json:"guild_crest"`
	Items []struct {
		Subclass float64 `json:"subclass"`
		Id       float64 `json:"id"`
		Slot     struct {
			Name string `json:"name"`
			Type string `json:"type"`
		} `json:"slot"`
		Enchant                  float64 `json:"enchant"`
		ItemAppearanceModifierId float64 `json:"item_appearance_modifier_id"`
		InternalSlotId           float64 `json:"internal_slot_id"`
	} `json:"items"`
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Character struct {
		Realm struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
			Slug string  `json:"slug"`
		} `json:"realm"`
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name string  `json:"name"`
		Id   float64 `json:"id"`
	} `json:"character"`
}

type BlizzardAPIBearerToken

type BlizzardAPIBearerToken struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	ExpiresIn   int    `json:"expires_in"`
}

type Character

type Character struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Gender struct {
		Type string `json:"type"`
		Name string `json:"name"`
	} `json:"gender"`
	Faction struct {
		Type string `json:"type"`
		Name string `json:"name"`
	} `json:"faction"`
	Race struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name string `json:"name"`
		ID   int    `json:"id"`
	} `json:"race"`
	CharacterClass struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name string `json:"name"`
		ID   int    `json:"id"`
	} `json:"character_class"`
	ActiveSpec struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name string `json:"name"`
		ID   int    `json:"id"`
	} `json:"active_spec"`
	Realm struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name string `json:"name"`
		ID   int    `json:"id"`
		Slug string `json:"slug"`
	} `json:"realm"`
	Guild struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name  string `json:"name"`
		ID    int    `json:"id"`
		Realm struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string `json:"name"`
			ID   int    `json:"id"`
			Slug string `json:"slug"`
		} `json:"realm"`
		Faction struct {
			Type string `json:"type"`
			Name string `json:"name"`
		} `json:"faction"`
	} `json:"guild"`
	Level                  int   `json:"level"`
	Experience             int   `json:"experience"`
	AchievementPoints      int   `json:"achievement_points"`
	Achievements           Href  `json:"achievements"`
	Titles                 Href  `json:"titles"`
	PvpSummary             Href  `json:"pvp_summary"`
	Encounters             Href  `json:"encounters"`
	Media                  Href  `json:"media"`
	LastLoginTimestamp     int64 `json:"last_login_timestamp"`
	AverageItemLevel       int   `json:"average_item_level"`
	EquippedItemLevel      int   `json:"equipped_item_level"`
	Specializations        Href  `json:"specializations"`
	Statistics             Href  `json:"statistics"`
	MythicKeystoneProfile  Href  `json:"mythic_keystone_profile"`
	Equipment              Href  `json:"equipment"`
	Appearance             Href  `json:"appearance"`
	Collections            Href  `json:"collections"`
	Reputations            Href  `json:"reputations"`
	Quests                 Href  `json:"quests"`
	AchievementsStatistics Href  `json:"achievements_statistics"`
	Professions            Href  `json:"professions"`
	CovenantProgress       struct {
		ChosenCovenant struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string `json:"name"`
			ID   int    `json:"id"`
		} `json:"chosen_covenant"`
		RenownLevel int `json:"renown_level"`
		Soulbinds   struct {
			Href string `json:"href"`
		} `json:"soulbinds"`
	} `json:"covenant_progress"`
}

type CharacterMedia

type CharacterMedia struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Character struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name  string  `json:"name"`
		Id    float64 `json:"id"`
		Realm struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
			Slug string  `json:"slug"`
		} `json:"realm"`
	} `json:"character"`
	Assets []struct {
		Value string `json:"value"`
		Key   string `json:"key"`
	} `json:"assets"`
}

type CharacterStatus

type CharacterStatus struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Id      float64 `json:"id"`
	IsValid bool    `json:"is_valid"`
}

type Collections

type Collections struct {
	Heirlooms struct {
		Href string `json:"href"`
	} `json:"heirlooms"`
	Toys struct {
		Href string `json:"href"`
	} `json:"toys"`
	Character struct {
		Name  string  `json:"name"`
		Id    float64 `json:"id"`
		Realm struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
			Slug string  `json:"slug"`
		} `json:"realm"`
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
	} `json:"character"`
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Pets struct {
		Href string `json:"href"`
	} `json:"pets"`
	Mounts struct {
		Href string `json:"href"`
	} `json:"mounts"`
}

type CollectionsHeirlooms

type CollectionsHeirlooms struct {
	Heirlooms []struct {
		Heirloom struct {
			Id  float64 `json:"id"`
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string `json:"name"`
		} `json:"heirloom"`
		Upgrade struct {
			Level float64 `json:"level"`
		} `json:"upgrade"`
	} `json:"heirlooms"`
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
}

type CollectionsMounts

type CollectionsMounts struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Mounts []struct {
		Mount struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"mount"`
		IsUseable bool `json:"is_useable"`
	} `json:"mounts"`
}

type CollectionsPets

type CollectionsPets struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Pets []struct {
		CreatureDisplay struct {
			Id  float64 `json:"id"`
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
		} `json:"creature_display"`
		Id      float64 `json:"id"`
		Species struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"species"`
		Level   float64 `json:"level"`
		Quality struct {
			Type string `json:"type"`
			Name string `json:"name"`
		} `json:"quality"`
		Stats struct {
			BreedId float64 `json:"breed_id"`
			Health  float64 `json:"health"`
			Power   float64 `json:"power"`
			Speed   float64 `json:"speed"`
		} `json:"stats"`
	} `json:"pets"`
	UnlockedBattlePetSlots float64 `json:"unlocked_battle_pet_slots"`
}

type CollectionsToys

type CollectionsToys struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Toys []struct {
		Toy struct {
			Id  float64 `json:"id"`
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string `json:"name"`
		} `json:"toy"`
	} `json:"toys"`
}

type Encounters

type Encounters struct {
	Character struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name  string  `json:"name"`
		Id    float64 `json:"id"`
		Realm struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
			Slug string  `json:"slug"`
		} `json:"realm"`
	} `json:"character"`
	Dungeons struct {
		Href string `json:"href"`
	} `json:"dungeons"`
	Raids struct {
		Href string `json:"href"`
	} `json:"raids"`
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
}

type EncountersDungeons

type EncountersDungeons struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Expansions []struct {
		Expansion struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"expansion"`
		Instances []struct {
			Instance struct {
				Name string  `json:"name"`
				Id   float64 `json:"id"`
				Key  struct {
					Href string `json:"href"`
				} `json:"key"`
			} `json:"instance"`
			Modes []struct {
				Difficulty struct {
					Name string `json:"name"`
					Type string `json:"type"`
				} `json:"difficulty"`
				Status struct {
					Name string `json:"name"`
					Type string `json:"type"`
				} `json:"status"`
				Progress struct {
					Encounters []struct {
						Encounter struct {
							Key struct {
								Href string `json:"href"`
							} `json:"key"`
							Name string  `json:"name"`
							Id   float64 `json:"id"`
						} `json:"encounter"`
						CompletedCount    float64 `json:"completed_count"`
						LastKillTimestamp float64 `json:"last_kill_timestamp"`
					} `json:"encounters"`
					CompletedCount float64 `json:"completed_count"`
					TotalCount     float64 `json:"total_count"`
				} `json:"progress"`
			} `json:"modes"`
		} `json:"instances"`
	} `json:"expansions"`
}

type EncountersRaids

type EncountersRaids struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Character struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name  string  `json:"name"`
		Id    float64 `json:"id"`
		Realm struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
			Slug string  `json:"slug"`
		} `json:"realm"`
	} `json:"character"`
	Expansions []struct {
		Expansion struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"expansion"`
		Instances []struct {
			Instance struct {
				Key struct {
					Href string `json:"href"`
				} `json:"key"`
				Name string  `json:"name"`
				Id   float64 `json:"id"`
			} `json:"instance"`
			Modes []struct {
				Difficulty struct {
					Type string `json:"type"`
					Name string `json:"name"`
				} `json:"difficulty"`
				Status struct {
					Type string `json:"type"`
					Name string `json:"name"`
				} `json:"status"`
				Progress struct {
					CompletedCount float64 `json:"completed_count"`
					TotalCount     float64 `json:"total_count"`
					Encounters     []struct {
						Encounter struct {
							Id  float64 `json:"id"`
							Key struct {
								Href string `json:"href"`
							} `json:"key"`
							Name string `json:"name"`
						} `json:"encounter"`
						CompletedCount    float64 `json:"completed_count"`
						LastKillTimestamp float64 `json:"last_kill_timestamp"`
					} `json:"encounters"`
				} `json:"progress"`
			} `json:"modes"`
		} `json:"instances"`
	} `json:"expansions"`
}

type Equipment

type Equipment struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Character struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name  string  `json:"name"`
		Id    float64 `json:"id"`
		Realm struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
			Slug string  `json:"slug"`
		} `json:"realm"`
	} `json:"character"`
	EquippedItems []struct {
		Slot struct {
			Type string `json:"type"`
			Name string `json:"name"`
		} `json:"slot"`
		ModifiedAppearanceId float64 `json:"modified_appearance_id"`
		Stats                []struct {
			Type struct {
				Type string `json:"type"`
				Name string `json:"name"`
			} `json:"type"`
			Value   float64 `json:"value"`
			Display struct {
				DisplayString string `json:"display_string"`
				Color         struct {
					R float64 `json:"r"`
					G float64 `json:"g"`
					B float64 `json:"b"`
					A float64 `json:"a"`
				} `json:"color"`
			} `json:"display"`
		} `json:"stats"`
		Requirements struct {
			Level struct {
				Value         float64 `json:"value"`
				DisplayString string  `json:"display_string"`
			} `json:"level"`
			PlayableClasses struct {
				Links []struct {
					Key struct {
						Href string `json:"href"`
					} `json:"key"`
					Name string  `json:"name"`
					Id   float64 `json:"id"`
				} `json:"links"`
				DisplayString string `json:"display_string"`
			} `json:"playable_classes"`
		} `json:"requirements"`
		NameDescription struct {
			DisplayString string `json:"display_string"`
			Color         struct {
				B float64 `json:"b"`
				A float64 `json:"a"`
				R float64 `json:"r"`
				G float64 `json:"g"`
			} `json:"color"`
		} `json:"name_description"`
		Context float64 `json:"context"`
		Media   struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Id float64 `json:"id"`
		} `json:"media"`
		Binding struct {
			Type string `json:"type"`
			Name string `json:"name"`
		} `json:"binding"`
		Transmog struct {
			ItemModifiedAppearanceId float64 `json:"item_modified_appearance_id"`
			Item                     struct {
				Key struct {
					Href string `json:"href"`
				} `json:"key"`
				Name string  `json:"name"`
				Id   float64 `json:"id"`
			} `json:"item"`
			DisplayString string `json:"display_string"`
		} `json:"transmog"`
		Durability struct {
			Value         float64 `json:"value"`
			DisplayString string  `json:"display_string"`
		} `json:"durability"`
		Level struct {
			Value         float64 `json:"value"`
			DisplayString string  `json:"display_string"`
		} `json:"level"`
		Quantity  float64 `json:"quantity"`
		BonusList []struct {
			BonusList float64 `json:"bonus_list"`
		} `json:"bonus_list"`
		ItemClass struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"item_class"`
		InventoryType struct {
			Type string `json:"type"`
			Name string `json:"name"`
		} `json:"inventory_type"`
		Armor struct {
			Value   float64 `json:"value"`
			Display struct {
				DisplayString string `json:"display_string"`
				Color         struct {
					B float64 `json:"b"`
					A float64 `json:"a"`
					R float64 `json:"r"`
					G float64 `json:"g"`
				} `json:"color"`
			} `json:"display"`
		} `json:"armor"`
		Set struct {
			ItemSet struct {
				Key struct {
					Href string `json:"href"`
				} `json:"key"`
				Name string  `json:"name"`
				Id   float64 `json:"id"`
			} `json:"item_set"`
			Items []struct {
				IsEquipped bool `json:"is_equipped"`
				Item       struct {
					Key struct {
						Href string `json:"href"`
					} `json:"key"`
					Name string  `json:"name"`
					Id   float64 `json:"id"`
				} `json:"item"`
			} `json:"items"`
			Effects []struct {
				DisplayString string  `json:"display_string"`
				RequiredCount float64 `json:"required_count"`
				IsActive      bool    `json:"is_active"`
			} `json:"effects"`
			DisplayString string `json:"display_string"`
		} `json:"set"`
		Item struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Id float64 `json:"id"`
		} `json:"item"`
		Sockets []struct {
			Media struct {
				Key struct {
					Href string `json:"href"`
				} `json:"key"`
				Id float64 `json:"id"`
			} `json:"media"`
			SocketType struct {
				Type string `json:"type"`
				Name string `json:"name"`
			} `json:"socket_type"`
			Item struct {
				Key struct {
					Href string `json:"href"`
				} `json:"key"`
				Name string  `json:"name"`
				Id   float64 `json:"id"`
			} `json:"item"`
			DisplayString string `json:"display_string"`
		} `json:"sockets"`
		Quality struct {
			Type string `json:"type"`
			Name string `json:"name"`
		} `json:"quality"`
		Name         string `json:"name"`
		ItemSubclass struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"item_subclass"`
		SellPrice struct {
			DisplayStrings struct {
				Header string `json:"header"`
				Gold   string `json:"gold"`
				Silver string `json:"silver"`
				Copper string `json:"copper"`
			} `json:"display_strings"`
			Value float64 `json:"value"`
		} `json:"sell_price"`
	} `json:"equipped_items"`
	EquippedItemSets []struct {
		ItemSet struct {
			Id  float64 `json:"id"`
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string `json:"name"`
		} `json:"item_set"`
		Items []struct {
			IsEquipped bool `json:"is_equipped"`
			Item       struct {
				Key struct {
					Href string `json:"href"`
				} `json:"key"`
				Name string  `json:"name"`
				Id   float64 `json:"id"`
			} `json:"item"`
		} `json:"items"`
		Effects []struct {
			IsActive      bool    `json:"is_active"`
			DisplayString string  `json:"display_string"`
			RequiredCount float64 `json:"required_count"`
		} `json:"effects"`
		DisplayString string `json:"display_string"`
	} `json:"equipped_item_sets"`
}

type Href

type Href struct {
	Href string `json:"href"`
}

type Key

type Key struct {
	Key struct {
		Href string `json:"href"`
	} `json:"key"`
	Name string `json:"name"`
	ID   int    `json:"id"`
}

type MythicKeystoneProfile

type MythicKeystoneProfile struct {
	CurrentMythicRating struct {
		Color struct {
			R float64 `json:"r"`
			G float64 `json:"g"`
			B float64 `json:"b"`
			A float64 `json:"a"`
		} `json:"color"`
		Rating float64 `json:"rating"`
	} `json:"current_mythic_rating"`
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	CurrentPeriod struct {
		Period struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Id float64 `json:"id"`
		} `json:"period"`
	} `json:"current_period"`
	Seasons []struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Id float64 `json:"id"`
	} `json:"seasons"`
	Character struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name  string  `json:"name"`
		Id    float64 `json:"id"`
		Realm struct {
			Slug string `json:"slug"`
			Key  struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"realm"`
	} `json:"character"`
}

type PrimaryStat

type PrimaryStat struct {
	Base      int64 `json:"base"`
	Effective int64 `json:"effective"`
}

type Profession

type Profession struct {
	Profession struct {
		Name string `json:"name"`
		Id   int    `json:"id"`
	} `json:"profession"`
	Tiers []struct {
		SkillPoints    int `json:"skill_points"`
		MaxSkillPoints int `json:"max_skill_points"`
		Tier           struct {
			Name string `json:"name"`
			Id   int    `json:"id"`
		} `json:"tier"`
		KnownRecipes []struct {
			Name string `json:"name"`
			Id   int    `json:"id"`
		} `json:"known_recipes"`
	} `json:"tiers"`
}

type Professions

type Professions struct {
	Primaries   []Profession `json:"primaries"`
	Secondaries []Profession `json:"secondaries"`
}

type PvpSummary

type PvpSummary struct {
	HonorableKills float64 `json:"honorable_kills"`
	Character      struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name  string  `json:"name"`
		Id    float64 `json:"id"`
		Realm struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
			Slug string  `json:"slug"`
		} `json:"realm"`
	} `json:"character"`
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Brackets []struct {
		Href string `json:"href"`
	} `json:"brackets"`
	HonorLevel       float64 `json:"honor_level"`
	PvpMapStatistics []struct {
		WorldMap struct {
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"world_map"`
		MatchStatistics struct {
			Played float64 `json:"played"`
			Won    float64 `json:"won"`
			Lost   float64 `json:"lost"`
		} `json:"match_statistics"`
	} `json:"pvp_map_statistics"`
}

type Quests

type Quests struct {
	InProgress []struct {
		Name string  `json:"name"`
		Id   float64 `json:"id"`
		Key  struct {
			Href string `json:"href"`
		} `json:"key"`
	} `json:"in_progress"`
	Completed struct {
		Href string `json:"href"`
	} `json:"completed"`
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Character struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name  string  `json:"name"`
		Id    float64 `json:"id"`
		Realm struct {
			Id   float64 `json:"id"`
			Slug string  `json:"slug"`
			Key  struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string `json:"name"`
		} `json:"realm"`
	} `json:"character"`
}

type QuestsCompleted

type QuestsCompleted struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Character struct {
		Id    float64 `json:"id"`
		Realm struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
			Slug string  `json:"slug"`
		} `json:"realm"`
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name string `json:"name"`
	} `json:"character"`
	Quests []struct {
		Id  float64 `json:"id"`
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name string `json:"name"`
	} `json:"quests"`
}

type Rating

type Rating struct {
	Rating      int     `json:"rating"`
	RatingBonus float64 `json:"rating_bonus"`
	Value       float64 `json:"value"`
}

type Reputations

type Reputations struct {
	Reputations []struct {
		Faction struct {
			Name string `json:"name"`
			Id   int    `json:"id"`
		} `json:"faction"`
		Standing struct {
			Name        string `json:"name"`
			RenownLevel int    `json:"renown_level"`
		} `json:"standing"`
	} `json:"reputations"`
}

type RequestFunc

type RequestFunc func(url string) ([]byte, error)

func Client

func Client(ApiClientId string, ApiSecret string, region string, lang string) (RequestFunc, error)

Client returns a RequestFunc that can be used to make requests to the Blizzard API. The returned RequestFunc will use the provided API key to authenticate requests. ApiClientId and ApiSecret are the client zh_CNid and secret for the Blizzard API. region: us | eu | kr | tw lang: en_US | es_MX | pt_BR | en_GB | es_ES | fr_FR | ru_RU | de_DE | pt_PT | it_IT | zh_TW | ko_KR

func (RequestFunc) CharacterAchievements

func (req RequestFunc) CharacterAchievements(realm string, name string) (s Achievements, err error)

func (RequestFunc) CharacterAchievementsStatistics

func (req RequestFunc) CharacterAchievementsStatistics(realm string, name string) (s AchievementsStatistics, err error)

func (RequestFunc) CharacterAppearance

func (req RequestFunc) CharacterAppearance(realm string, name string) (s Appearance, err error)

func (RequestFunc) CharacterCharacterMedia

func (req RequestFunc) CharacterCharacterMedia(realm string, name string) (s CharacterMedia, err error)

func (RequestFunc) CharacterCharacterStatus

func (req RequestFunc) CharacterCharacterStatus(realm string, name string) (s CharacterStatus, err error)

func (RequestFunc) CharacterCollections

func (req RequestFunc) CharacterCollections(realm string, name string) (s Collections, err error)

func (RequestFunc) CharacterCollectionsHeirlooms

func (req RequestFunc) CharacterCollectionsHeirlooms(realm string, name string) (s CollectionsHeirlooms, err error)

func (RequestFunc) CharacterCollectionsMounts

func (req RequestFunc) CharacterCollectionsMounts(realm string, name string) (s CollectionsMounts, err error)

func (RequestFunc) CharacterCollectionsPets

func (req RequestFunc) CharacterCollectionsPets(realm string, name string) (s CollectionsPets, err error)

func (RequestFunc) CharacterCollectionsToys

func (req RequestFunc) CharacterCollectionsToys(realm string, name string) (s CollectionsToys, err error)

func (RequestFunc) CharacterEncounters

func (req RequestFunc) CharacterEncounters(realm string, name string) (s Encounters, err error)

func (RequestFunc) CharacterEncountersDungeons

func (req RequestFunc) CharacterEncountersDungeons(realm string, name string) (s EncountersDungeons, err error)

func (RequestFunc) CharacterEncountersRaids

func (req RequestFunc) CharacterEncountersRaids(realm string, name string) (s EncountersRaids, err error)

func (RequestFunc) CharacterEquipment

func (req RequestFunc) CharacterEquipment(realm string, name string) (s Equipment, err error)

func (RequestFunc) CharacterMythicKeystoneProfile

func (req RequestFunc) CharacterMythicKeystoneProfile(realm string, name string) (s MythicKeystoneProfile, err error)

func (RequestFunc) CharacterPvpSummary

func (req RequestFunc) CharacterPvpSummary(realm string, name string) (s PvpSummary, err error)

func (RequestFunc) CharacterQuests

func (req RequestFunc) CharacterQuests(realm string, name string) (s Quests, err error)

func (RequestFunc) CharacterQuestsCompleted

func (req RequestFunc) CharacterQuestsCompleted(realm string, name string) (s QuestsCompleted, err error)

func (RequestFunc) CharacterSoulbinds

func (req RequestFunc) CharacterSoulbinds(realm string, name string) (s Soulbinds, err error)

func (RequestFunc) CharacterStats

func (req RequestFunc) CharacterStats(realm string, name string) (stats interface{}, err error)

func (RequestFunc) CharacterTitles

func (req RequestFunc) CharacterTitles(realm string, name string) (s Titles, err error)

type Soulbinds

type Soulbinds struct {
	Soulbinds []struct {
		Traits []struct {
			Trait struct {
				Key struct {
					Href string `json:"href"`
				} `json:"key"`
				Name string  `json:"name"`
				Id   float64 `json:"id"`
			} `json:"trait"`
			Tier         float64 `json:"tier"`
			DisplayOrder float64 `json:"display_order"`
		} `json:"traits"`
		Soulbind struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"soulbind"`
	} `json:"soulbinds"`
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Character struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name  string  `json:"name"`
		Id    float64 `json:"id"`
		Realm struct {
			Slug string `json:"slug"`
			Key  struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
		} `json:"realm"`
	} `json:"character"`
	ChosenCovenant struct {
		Id  float64 `json:"id"`
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name string `json:"name"`
	} `json:"chosen_covenant"`
	RenownLevel float64 `json:"renown_level"`
}

type Statistics

type Statistics struct {
	Health    int64 `json:"health"`
	Power     int64 `json:"power"`
	PowerType struct {
		Name string `json:"name"`
		Id   int64  `json:"id"`
	} `json:"power_type"`
	Speed                       float64     `json:"speed"`
	Strength                    PrimaryStat `json:"strength"`
	Agility                     PrimaryStat `json:"agility"`
	Intellect                   PrimaryStat `json:"intellect"`
	Stamina                     PrimaryStat `json:"stamina"`
	MeleeCrit                   Rating      `json:"melee_crit"`
	MeleeHaste                  Rating      `json:"melee_haste"`
	Mastery                     Rating      `json:"mastery"`
	BonusArmor                  float64     `json:"bonus_armor"`
	Lifesteal                   Rating      `json:"lifesteal"`
	Versatility                 int64       `json:"versatility"`
	VersatilityDamageDoneBonus  float64     `json:"versatility_damage_done_bonus"`
	VersatilityHealingDoneBonus float64     `json:"versatility_healing_done_bonus"`
	VersatilityDamageTakenBonus float64     `json:"versatility_damage_taken_bonus"`
	Avoidance                   Rating      `json:"avoidance"`
	AttackPower                 int64       `json:"attack_power"`
	MainHandDamageMin           float64     `json:"main_hand_damage_min"`
	MainHandDamageMax           float64     `json:"main_hand_damage_max"`
	MainHandSpeed               float64     `json:"main_hand_speed"`
	MainHandDps                 float64     `json:"main_hand_dps"`
	OffHandDamageMin            float64     `json:"off_hand_damage_min"`
	OffHandDamageMax            float64     `json:"off_hand_damage_max"`
	OffHandSpeed                float64     `json:"off_hand_speed"`
	OffHandDps                  float64     `json:"off_hand_dps"`
	SpellPower                  int64       `json:"spell_power"`
	SpellPenetration            int64       `json:"spell_penetration"`
	SpellCrit                   Rating      `json:"spell_crit"`
	ManaRegen                   float64     `json:"mana_regen"`
	ManaRegenCombat             float64     `json:"mana_regen_combat"`
	Armor                       PrimaryStat `json:"armor"`
	Dodge                       Rating      `json:"dodge"`
	Parry                       Rating      `json:"parry"`
	Block                       Rating      `json:"block"`
	RangedCrit                  Rating      `json:"ranged_crit"`
	RangedHaste                 Rating      `json:"ranged_haste"`
	SpellHaste                  Rating      `json:"spell_haste"`
}

type Titles

type Titles struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"_links"`
	Character struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name  string  `json:"name"`
		Id    float64 `json:"id"`
		Realm struct {
			Key struct {
				Href string `json:"href"`
			} `json:"key"`
			Name string  `json:"name"`
			Id   float64 `json:"id"`
			Slug string  `json:"slug"`
		} `json:"realm"`
	} `json:"character"`
	ActiveTitle struct {
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name          string  `json:"name"`
		Id            float64 `json:"id"`
		DisplayString string  `json:"display_string"`
	} `json:"active_title"`
	Titles []struct {
		Id  float64 `json:"id"`
		Key struct {
			Href string `json:"href"`
		} `json:"key"`
		Name string `json:"name"`
	} `json:"titles"`
}

Jump to

Keyboard shortcuts

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