warcraftlogs

package module
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2020 License: MIT Imports: 8 Imported by: 5

README

WarcraftLogs API Go GoDoc

Patreon PayPal Liberapay

fork of alexejk/go-warcraftlogs

A Simple golang wrapper for WarcraftLogs API

import "gitlab.com/rakshazi/wacraftlogs-api"


// Use WarcraftLogs API token (warcraftlogs.com -> account settings -> scroll to the end of page)
api := warcraftlogs.NewRetail("cb63bb62fbadb166657d20927a2335ae")
// For classic logs use: api := warcraftlogs.NewClassic("cb63bb62fbadb166657d20927a2335ae")
// reports := api.ReportsForGuild("GuildName", "realm-slug-from-blizzard-api", "region")
reports := api.ReportsForGuild("Совет Тирисфаля", "ревущии-фьорд", "EU")

for _, report := range reports {
  // Use report information
}

Implemented

Reports
  • Guild reports list
  • Reports list by URL
Fights
  • Fights (pulls) list
  • Detailed information about each fight (pull)
  • Information about raiders

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aura added in v0.2.6

type Aura struct {
	SourceID  int    `json:"source,omitempty"`
	AbilityID int    `json:"ability,omitempty"`
	Stacks    int    `json:"stacks,omitempty"`
	Name      string `json:"name,omitempty"`
}

Aura / buffs info

type Event added in v0.2.6

type Event struct {
	Type        string `json:"type,omitempty"`
	Timestamp   int    `json:"timestamp,omitempty"`
	EncounterID int    `json:"encounterID,omitempty"`
	Name        string `json:"name,omitempty"`
	SourceID    int    `json:"sourceID,omitempty"`
	Gear        []Gear `json:"gear,omitempty"`
	Auras       []Aura `json:"auras,omitempty"`
}

Event - event info

type Fight

type Fight struct {
	Fights     []*Pull   `json:"fights,omitempty"`
	Friendlies []*Raider `json:"friendlies,omitempty"`
}

Fight - actually, report

type Gear added in v0.2.6

type Gear struct {
	ID      int `json:"id,omitempty"`
	Quality int `json:"quality,omitempty"`
	Level   int `json:"itemLevel,omitempty"`
}

Gear info

type Pull

type Pull struct {
	Id                            int
	StartTime                     int    `json:"start_time"`
	EndTime                       int    `json:"end_time"`
	Boss                          int    `json:"boss,omitempty"`
	Name                          string `json:"name,omitempty"`
	Size                          int    `json:"size,omitempty"`
	Difficulty                    int    `json:"difficulty,omitempty"`
	Kill                          bool   `json:"kill,omitempty"`
	Partial                       int    `json:"partial,omitempty"`
	BossPercentage                int    `json:"bossPercentage,omitempty"`
	FightPercentage               int    `json:"fightPercentage,omitempty"`
	LastPhaseForPercentageDisplay int    `json:"lastPhaseForPercentageDisplay,omitempty"`
}

Pull - fight/pull information

type Raider

type Raider struct {
	Id     int
	Name   string
	Type   string
	Guid   int
	Server string
	Fights []struct {
		Id int
	}
}

Raider info

type Report

type Report struct {
	Id        string
	Title     string
	Owner     string
	Zone      int64
	StartTime *int64 `json:"start"`
	EndTime   *int64 `json:"end"`
}

type WarcraftLogs

type WarcraftLogs struct {
	// contains filtered or unexported fields
}

WarcraftLogs Client

func New

func New(apiToken string) *WarcraftLogs

New - shortcut to NewRetail(apiToken string)

func NewClassic

func NewClassic(apiToken string) *WarcraftLogs

NewClassic - New WarcraftLogs Client for WoW CLASSIC, with required API Token. Currently using v1 API endpoint as default

func NewRetail

func NewRetail(apiToken string) *WarcraftLogs

NewRetail - New WarcraftLogs Client for RETAIL/actual WoW, with required API Token. Currently using v1 API endpoint as default

func (*WarcraftLogs) Events added in v0.2.6

func (w *WarcraftLogs) Events(code string, view string, start int, end int) ([]*Event, error)

Events - todo

func (*WarcraftLogs) Fights

func (w *WarcraftLogs) Fights(code string) (Fight, error)

Fights - get fight from report by report id (code)

func (*WarcraftLogs) Get

func (w *WarcraftLogs) Get(path string, responseHolder interface{}) error

Get - support function to make an authenticated GET call and parse response JSON to a responseHolder.

func (*WarcraftLogs) GetToken

func (w *WarcraftLogs) GetToken() string

GetToken - get random API token from pool

func (*WarcraftLogs) RemoveToken

func (w *WarcraftLogs) RemoveToken(remove string)

RemoveToken - remove token from pool

func (*WarcraftLogs) ReportsForGuild

func (w *WarcraftLogs) ReportsForGuild(guildName string, realm string, region string) ([]*Report, error)

ReportsForGuild returns a list of all reports available for provided guild. Warcraftlogs retention time of reports differs depending on reports tier.

func (*WarcraftLogs) ReportsForUser

func (w *WarcraftLogs) ReportsForUser(userName string) ([]*Report, error)

ReportsForUser returns a list of all reports available for provided user. Warcraftlogs retention time of reports differs depending on reports tier.

func (*WarcraftLogs) SetEndpoint

func (w *WarcraftLogs) SetEndpoint(endpoint string)

SetEndpoint allows customizing API Endpoint that client will use. If provided endoint does not end with a trailing slash, it will be added

func (*WarcraftLogs) SetTokens

func (w *WarcraftLogs) SetTokens(tokens []string)

SetTokens - set list of tokens to api client

func (*WarcraftLogs) Zones

func (w *WarcraftLogs) Zones() ([]*Zone, error)

Get zones from api

type Zone

type Zone struct {
	Id         int              `json:"id"`
	Name       string           `json:"name"`
	Frozen     bool             `json:"frozen"`
	Encounters []*ZoneEncounter `json:"encounters"`
	Brackets   *ZoneBrackets    `json:"brackets"`
}

type ZoneBrackets

type ZoneBrackets struct {
	Min  float32 `json:"min"`
	Max  float32 `json:"max"`
	Type string  `json:"type"`
}

Zone requirements, type may be patch, ilvl, etc.

type ZoneEncounter

type ZoneEncounter struct {
	Id    int    `json:"id"`
	NpcId int    `json:"npcID,omitempty"`
	Name  string `json:"name"`
}

Zone Boss, id - warcraft logs internal id, NpcId - real id

Jump to

Keyboard shortcuts

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