blizz

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcuItem

type AcuItem struct {
	ID           int                `json:"id"`
	Context      int                `json:"context"`
	Modifiers    []AucItemModifiers `json:"modifiers"`
	PetBreedID   int                `json:"pet_breed_id"`
	PetLevel     int                `json:"pet_level"`
	PetQualityID int                `json:"pet_quality_id"`
	PetSpeciesID int                `json:"pet_species_id"`
}

type AucItemModifiers

type AucItemModifiers struct {
	Type  int `json:"type"`
	Value int `json:"value"`
}

type AuctionData

type AuctionData struct {
	Auctions []*AuctionsDetail `json:"auctions"`
}

type AuctionsDetail

type AuctionsDetail struct {
	ID       int                       `json:"id"`
	Item     AcuItem                   `json:"item"`
	Buyout   int                       `json:"buyout"`
	Quantity int                       `json:"quantity"`
	TimeLeft string                    `json:"time_left"`
	ItemName ItemResultResultsDataName `json:"item_name"`
	Quality  string                    `json:"quality"`
	Price    int                       `json:"unit_price"`
}

type BlizzRealmsSearchResult

type BlizzRealmsSearchResult struct {
	Results []BlizzRealmsSearchResultResults `json:"results"`
}

Итоговая структура. Из этого нужно брать имя сервера и значением будет айди коннектед риалма

type BlizzRealmsSearchResultResults

type BlizzRealmsSearchResultResults struct {
	Data BlizzRealmsSearchResultResultsData `json:"data"`
}

type BlizzRealmsSearchResultResultsData

type BlizzRealmsSearchResultResultsData struct {
	Realms []BlizzRealmsSearchResultResultsDataRealms `json:"realms"`
	ID     int                                        `json:"id"`
}

type BlizzRealmsSearchResultResultsDataRealms

type BlizzRealmsSearchResultResultsDataRealms struct {
	Name BlizzRealmsSearchResultResultsDataRealmsName `json:"name"`
}

type BlizzRealmsSearchResultResultsDataRealmsName

type BlizzRealmsSearchResultResultsDataRealmsName struct {
	RuRU string `json:"ru_RU"`
	EnGB string `json:"en_GB"`
}

type BlizzardToken

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

type Client

type Client interface {
	GetBlizzRealms() error
	MakeBlizzAuth() error
	GetRealmID(string) int
	BlizzAuthRoutine()
	GetItemMedia(itemID string) (*ItemMedia, error)
	SearchItem(itemName string, region string) (*Item, error)
	GetAuctionData(realmID int, region string) ([]*AuctionsDetail, error)
}

func NewClient

func NewClient(ctx context.Context, logger *logrus.Logger, blizzCfg *conf.BlizzApiCfg) Client

type Item

type Item struct {
	Results []ItemResultResults `json:"results"`
}

type ItemAssets

type ItemAssets struct {
	Key        string `json:"key"`
	Value      string `json:"value"`
	FileDataID int    `json:"file_data_id"`
}

type ItemMedia

type ItemMedia struct {
	Assets []ItemAssets `json:"assets"`
	ID     int          `json:"id"`
}

type ItemResultResults

type ItemResultResults struct {
	Data ItemResultResultsData `json:"data"`
}

type ItemResultResultsData

type ItemResultResultsData struct {
	Name    ItemResultResultsDataName    `json:"name"`
	ID      int                          `json:"id"`
	Quality ItemResultResultsDataQuality `json:"quality"`
}

type ItemResultResultsDataName

type ItemResultResultsDataName struct {
	RuRU string `json:"ru_RU"`
	EnGB string `json:"en_GB"`
	EnUS string `json:"en_US"`
}

type ItemResultResultsDataQuality

type ItemResultResultsDataQuality struct {
	Type string `json:"type"`
}

Jump to

Keyboard shortcuts

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