warcraftlogs

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 16 Imported by: 0

README

go-wcl

Go Reference

go-wcl is a Go client for the Warcraft Logs v2 GraphQL API.

It handles OAuth 2.0 authentication, request retries, and rate-limit inspection. Typed methods are generated from the API schema, and Client.Execute runs arbitrary queries for anything the typed methods do not cover.

Features

  • OAuth 2.0 client-credentials, authorization-code, and PKCE flows.
  • Type-safe methods and models generated from the live schema with genqlient.
  • Execute runs any raw GraphQL query the generated methods don't cover.
  • Automatic retries with exponential backoff, honoring Retry-After.
  • Rate-limit inspection and typed error helpers.
  • Minimal runtime dependencies.

Requirements

  • Go 1.25 or later.
  • A Warcraft Logs API client. Create one on the client management page to get a client ID and secret.

Installation

go get github.com/math280h/go-wcl

Usage

package main

import (
	"context"
	"errors"
	"fmt"
	"log"

	warcraftlogs "github.com/math280h/go-wcl"
)

func main() {
	ctx := context.Background()

	client, err := warcraftlogs.New(ctx,
		warcraftlogs.WithClientCredentials("client-id", "client-secret"))
	if err != nil {
		log.Fatal(err)
	}

	char, err := client.CharacterByName(ctx, "Asmongold", "area-52", "us")
	if errors.Is(err, warcraftlogs.ErrNotFound) {
		log.Fatal("character not found")
	} else if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%s - %s (%s)\n", char.Name, char.Server.Name, char.Server.Region.Name)
}

Lookups that resolve to a missing entity return ErrNotFound, as shown above. An unknown report code is rejected by the API itself and arrives as a GraphQL error instead. See GraphQLErrors.

Authentication

Public data is accessed with the client-credentials flow against ClientEndpoint:

client, err := warcraftlogs.New(ctx,
	warcraftlogs.WithClientCredentials(id, secret))

Private data (a user's own reports, CurrentUser) requires the authorization-code or PKCE flow against UserEndpoint. Use OAuthConfig to build the authorization URL and exchange the returned code, then pass the token to the client:

cfg := warcraftlogs.OAuthConfig(id, secret, "https://example.com/callback")

// 1. Redirect the user to the authorization URL.
url := cfg.AuthCodeURL("state-token")

// 2. On the callback, exchange the code for a token.
tok, err := cfg.Exchange(ctx, codeFromCallback)
if err != nil {
	log.Fatal(err)
}

// 3. Build a client for the private API.
client, err := warcraftlogs.New(ctx,
	warcraftlogs.WithTokenSource(cfg.TokenSource(ctx, tok)),
	warcraftlogs.WithEndpoint(warcraftlogs.UserEndpoint))

For PKCE (clients that cannot hold a secret), pass an empty secret and use the verifier options from golang.org/x/oauth2:

cfg := warcraftlogs.OAuthConfig(id, "", "https://example.com/callback")
verifier := oauth2.GenerateVerifier()
url := cfg.AuthCodeURL("state-token", oauth2.S256ChallengeOption(verifier))
tok, err := cfg.Exchange(ctx, codeFromCallback, oauth2.VerifierOption(verifier))

examples/userauth is a runnable version of this flow: a local redirect server, state validation, the PKCE exchange, and a CurrentUser call against UserEndpoint.

go run ./examples/userauth
go run ./examples/userauth -redirect http://localhost:9000/callback
Typed queries

Methods cover characters, guilds, reports, world data, game data, and users.

// Report header only.
report, err := client.Report(ctx, "aBcDeFgHiJkLmN01", false)

// World data.
zones, err := client.Zones(ctx, 0) // 0 = all expansions
encounter, err := client.Encounter(ctx, 3009)
Listing reports

Reports lists a guild's uploaded logs. Identify the guild by GuildID, or by the name/slug/region trio; UserID lists a user's personal logs instead.

page, err := client.Reports(ctx, warcraftlogs.ReportsParams{
	GuildName:         "Skill Issue",
	GuildServerSlug:   "tarren-mill",
	GuildServerRegion: "eu",
})
for _, r := range page.Data {
	fmt.Printf("%s  %s\n", r.Code, r.Title)
}

page.Data holds ReportSummary values: code, title, start and end time, zone, guild and owner. Call Client.Report or Client.ReportWithFights with a code for the rest. Walk the pages by incrementing Page while page.HasMorePages is true; Total, PerPage, CurrentPage, LastPage, From and To are also available.

Reports and fights

ReportWithFights returns the header, the fights and the encounter phases together:

report, err := client.ReportWithFights(ctx, warcraftlogs.ReportWithFightsParams{
	Code:     "aBcDeFgHiJkLmN01",
	KillType: warcraftlogs.KillTypeKills,
})
fmt.Println(report.Title, len(report.Fights))

Fields the schema marks nullable are pointers, because for several of them the Go zero value is also a legal answer. On a trash fight Kill, Difficulty and Size are all nil; on a boss fight Kill is false for a wipe:

for _, f := range report.Fights {
	switch {
	case f.Kill == nil:
		fmt.Printf("%s (trash)\n", f.Name)
	case *f.Kill:
		fmt.Printf("%s (kill)\n", f.Name)
	default:
		fmt.Printf("%s (wipe at %.1f%%)\n", f.Name, *f.FightPercentage)
	}
}

report.Phases carries the phase metadata for every encounter in the log. Join it against a fight's observed transitions to answer which phase the raid was in at a given report-relative timestamp:

fight := report.Fights[0]
if pt, ok := fight.PhaseAt(fight.EndTime); ok {
	for _, p := range report.PhasesFor(fight.EncounterID) {
		if p.Id == pt.Id {
			fmt.Printf("ended in %s\n", p.Name) // e.g. "Stage Three"
		}
	}
}

Prefer PhaseTransitions over the LastPhase* fields: a fight can re-enter a phase it has already been in, and LastPhase numbers normal phases and intermissions separately.

Actors

ReportMasterData returns every actor in a report alongside the full ability table. ReportActors filters server-side:

players, err := client.ReportActors(ctx, warcraftlogs.ReportActorsParams{
	Code: "aBcDeFgHiJkLmN01",
	Type: warcraftlogs.ActorPlayer,
})

SubType narrows further: a class for players ("DeathKnight"), or ActorBoss for NPCs. Leaving a field empty omits that filter.

Analysis endpoints

Rankings, tables, graphs, events, and player details are returned as json.RawMessage, matching the API's JSON type. Decode them into your own structs.

data, err := client.CharacterZoneRankings(ctx, warcraftlogs.ZoneRankingsParams{
	Character: warcraftlogs.CharacterRef{Name: "Asmongold", ServerSlug: "area-52", ServerRegion: "us"},
	Metric:    warcraftlogs.CharacterPageRankingMetricTypeDps,
})

table, err := client.ReportTable(ctx, warcraftlogs.TableDataTypeDamageDone,
	warcraftlogs.ReportAnalysisParams{Code: "aBcDeFgHiJkLmN01"})

CharacterZoneRankings and CharacterEncounterRankings rank a named character. EncounterLeaderboard is the inverse - the leaderboard for one boss:

top, err := client.EncounterLeaderboard(ctx, warcraftlogs.EncounterLeaderboardParams{
	EncounterID: 3009,
	ClassName:   "Mage",
	SpecName:    "Fire",
	Metric:      warcraftlogs.CharacterRankingMetricTypeDps,
})

Events are paginated. ReportEventsAll follows the cursor for you and yields one event at a time, so you never hold more than a page in memory:

params := warcraftlogs.ReportEventsParams{Code: "aBcDeFgHiJkLmN01", FightIDs: []int{12}}
for raw, err := range client.ReportEventsAll(ctx, warcraftlogs.EventDataTypeDeaths, params) {
	if err != nil {
		log.Fatal(err)
	}
	var e deathEvent
	if err := json.Unmarshal(raw, &e); err != nil {
		log.Fatal(err)
	}
	// ... handle e ...
}

Breaking out of the loop stops immediately without fetching another page. If the API ever returns a cursor that does not move forward, iteration stops with ErrPageNotAdvancing instead of re-requesting the same page.

ReportEvents returns a single page if you want to drive pagination yourself; NextPageTimestamp is zero on the last page. Either way, events require either FightIDs or an explicit StartTime/EndTime range.

examples/analysis is a runnable walkthrough of a real log: report metadata, a per-boss pull summary, the damage breakdown of a kill, and every death joined against report master data to resolve actor and ability names.

go run ./examples/analysis
go run ./examples/analysis -report aBcDeFgHiJkLmN01
Raw queries

Execute runs any query and decodes the data field into a pointer. Use it for operations not covered by the typed methods.

var resp struct {
	WorldData struct {
		Regions []struct {
			ID   int    `json:"id"`
			Name string `json:"name"`
		} `json:"regions"`
	} `json:"worldData"`
}
err := client.Execute(ctx, `query { worldData { regions { id name } } }`, nil, &resp)
Rate limiting

The API uses an hourly point budget. Inspect it at any time:

limit, err := client.RateLimit(ctx)
fmt.Printf("%.1f / %d points used, resets in %ds\n",
	limit.PointsSpentThisHour, limit.LimitPerHour, limit.PointsResetIn)

Requests that return HTTP 429 or 5xx are retried automatically with backoff (configurable via WithMaxRetries), including the Cloudflare-specific 520-527 range. A Cloudflare challenge page is reported as a CDNError rather than surfacing as a JSON decode failure.

Errors

Helpers classify errors returned by any method:

if _, err := client.Report(ctx, code, false); err != nil {
	switch {
	case warcraftlogs.IsRateLimited(err):
		// HTTP 429.
	case warcraftlogs.IsUnauthorized(err):
		// HTTP 401 or 403.
	case warcraftlogs.IsBlocked(err):
		// Cloudflare served a challenge page; the request never reached the API.
		var cdn *warcraftlogs.CDNError
		errors.As(err, &cdn)
		log.Printf("blocked: HTTP %d %q", cdn.StatusCode, cdn.Title)
	}
	for _, ge := range warcraftlogs.GraphQLErrors(err) {
		// e.g. "graphql: reportData.report: This report does not exist."
		log.Printf("graphql: %s: %s", ge.Path, ge.Message)
	}
	if status, ok := warcraftlogs.HTTPStatus(err); ok {
		log.Printf("http status: %d", status)
	}
}

The classifiers key off HTTP status only. The API sends no extensions on its GraphQL errors and reports a report you may not read as though it does not exist, so a failure that carries only a GraphQL error is not classifiable beyond its message. Read GraphQLErrors directly for those.

Client options

New accepts functional options:

Option Purpose
WithClientCredentials(id, secret) Client-credentials authentication.
WithTokenSource(ts) Authenticate with a caller-provided oauth2.TokenSource.
WithHTTPClient(hc) Use a preconfigured *http.Client verbatim. Supersedes the other auth and transport options, so combining them is an error.
WithEndpoint(url) Override the GraphQL endpoint (e.g. UserEndpoint).
WithTokenURL(url) Override the OAuth token endpoint (default TokenURL).
WithScopes(scopes...) Scopes for the client-credentials flow.
WithUserAgent(ua) Set the User-Agent header.
WithMaxRetries(n) Retry attempts for 429/5xx responses (default 3).
WithTimeout(d) Per-request timeout (default 60s).
WithBaseTransport(rt) http.RoundTripper beneath the retry and auth layers.
WithLogger(l) Log retried requests to a *slog.Logger. Silent by default.

Development

The typed layer is generated from a committed copy of the schema (schema/schema.graphql) and the operations under operations/.

Copy .env.example to .env and fill in your credentials:

task              # list tasks
task check        # fmt check, vet, build, and unit tests
task regenerate   # refresh the schema, then regenerate the typed client
task test:integration  # run tests against the live API

Each task maps to plain Go commands if you prefer to run them directly:

go generate ./...                 # regenerate from operations + schema
go -C tools run ./introspect      # refresh schema/schema.graphql
go test ./...                     # unit tests
go test -tags integration ./...   # live API tests (skipped without credentials)

Disclaimer

This project is not affiliated with or endorsed by Warcraft Logs or Blizzard Entertainment. It's an unofficial client, maintained independently. All trademarks belong to their respective owners.

You're bound by the Warcraft Logs terms of service when using their API through this library.

License

See LICENSE.

Documentation

Overview

Package warcraftlogs is a client for the Warcraft Logs v2 GraphQL API.

It handles OAuth 2.0 authentication (client credentials, authorization code, and PKCE), request retries, and rate-limit inspection. Typed operations are generated from the API schema; Client.Execute runs arbitrary queries for anything the typed layer does not cover.

client, err := warcraftlogs.New(ctx,
	warcraftlogs.WithClientCredentials(id, secret))
if err != nil {
	return err
}

limit, err := client.RateLimit(ctx)

Index

Examples

Constants

View Source
const (
	// ClientEndpoint is the public API, accessed with the client-credentials flow.
	ClientEndpoint = "https://www.warcraftlogs.com/api/v2/client"
	// UserEndpoint is the private API, accessed with the authorization-code or PKCE flow.
	UserEndpoint = "https://www.warcraftlogs.com/api/v2/user"

	// AuthorizeURL is the OAuth 2.0 authorization endpoint.
	AuthorizeURL = "https://www.warcraftlogs.com/oauth/authorize"
	// TokenURL is the OAuth 2.0 token endpoint.
	TokenURL = "https://www.warcraftlogs.com/oauth/token"
)
View Source
const (
	ActorPlayer = "Player"
	ActorNPC    = "NPC"
	ActorPet    = "Pet"
	ActorBoss   = "Boss"
)

Actor types and sub-types accepted by ReportActorsParams. The API matches these case-sensitively against its own actor classification.

Variables

View Source
var AllCharacterPageRankingMetricType = []CharacterPageRankingMetricType{
	CharacterPageRankingMetricTypeBosscdps,
	CharacterPageRankingMetricTypeBossdps,
	CharacterPageRankingMetricTypeBossndps,
	CharacterPageRankingMetricTypeBossrdps,
	CharacterPageRankingMetricTypeDefault,
	CharacterPageRankingMetricTypeDps,
	CharacterPageRankingMetricTypeHps,
	CharacterPageRankingMetricTypeKrsi,
	CharacterPageRankingMetricTypePlayerscore,
	CharacterPageRankingMetricTypePlayerspeed,
	CharacterPageRankingMetricTypeCdps,
	CharacterPageRankingMetricTypeNdps,
	CharacterPageRankingMetricTypeRdps,
	CharacterPageRankingMetricTypeTankhps,
	CharacterPageRankingMetricTypeWdps,
	CharacterPageRankingMetricTypeHealercombineddps,
	CharacterPageRankingMetricTypeHealercombinedbossdps,
	CharacterPageRankingMetricTypeHealercombinedcdps,
	CharacterPageRankingMetricTypeHealercombinedbosscdps,
	CharacterPageRankingMetricTypeHealercombinedndps,
	CharacterPageRankingMetricTypeHealercombinedbossndps,
	CharacterPageRankingMetricTypeHealercombinedrdps,
	CharacterPageRankingMetricTypeHealercombinedbossrdps,
	CharacterPageRankingMetricTypeTankcombineddps,
	CharacterPageRankingMetricTypeTankcombinedbossdps,
	CharacterPageRankingMetricTypeTankcombinedcdps,
	CharacterPageRankingMetricTypeTankcombinedbosscdps,
	CharacterPageRankingMetricTypeTankcombinedndps,
	CharacterPageRankingMetricTypeTankcombinedbossndps,
	CharacterPageRankingMetricTypeTankcombinedrdps,
	CharacterPageRankingMetricTypeTankcombinedbossrdps,
	CharacterPageRankingMetricTypePointsAndDamage,
	CharacterPageRankingMetricTypePointsAndHealing,
}
View Source
var ErrBlocked = errors.New("warcraftlogs: blocked by CDN")

ErrBlocked reports that a response was served by the CDN in front of the API rather than the API itself. Match it with IsBlocked.

View Source
var ErrConflictingOptions = errors.New("warcraftlogs: WithHTTPClient supersedes other auth and transport options")

ErrConflictingOptions is returned by New when WithHTTPClient is combined with an option it would override.

View Source
var ErrNoCredentials = errors.New("warcraftlogs: no credentials configured (use WithClientCredentials, WithTokenSource, or WithHTTPClient)")

ErrNoCredentials is returned by New when no authentication is configured.

View Source
var ErrNotFound = errors.New("warcraftlogs: not found")

ErrNotFound is returned by single-entity lookups when the API resolves the query but no matching entity exists.

View Source
var ErrPageNotAdvancing = errors.New("warcraftlogs: pagination cursor did not advance")

ErrPageNotAdvancing is returned by Client.ReportEventsAll when the API hands back a next-page cursor that does not move forward.

Functions

func HTTPStatus

func HTTPStatus(err error) (int, bool)

HTTPStatus returns the status code if err was caused by a non-2xx response, whether it came from the API or from the CDN in front of it.

func IsBlocked

func IsBlocked(err error) bool

IsBlocked reports whether the request was rejected by the CDN in front of the API rather than reaching it. See CDNError.

func IsRateLimited

func IsRateLimited(err error) bool

IsRateLimited reports whether err was caused by an HTTP 429 response.

func IsUnauthorized

func IsUnauthorized(err error) bool

IsUnauthorized reports whether err was caused by an HTTP 401 or 403 response. A CDN challenge is not an auth failure, so IsBlocked takes precedence.

func OAuthConfig

func OAuthConfig(clientID, clientSecret, redirectURL string, scopes ...string) *oauth2.Config

OAuthConfig returns an oauth2.Config wired to the Warcraft Logs OAuth endpoints for the authorization-code and PKCE flows, used to access private data via UserEndpoint.

Authorization-code:

cfg := warcraftlogs.OAuthConfig(id, secret, redirect)
url := cfg.AuthCodeURL(state)
// redirect the user, then on the callback:
tok, err := cfg.Exchange(ctx, code)

PKCE (no client secret):

cfg := warcraftlogs.OAuthConfig(id, "", redirect)
verifier := oauth2.GenerateVerifier()
url := cfg.AuthCodeURL(state, oauth2.S256ChallengeOption(verifier))
tok, err := cfg.Exchange(ctx, code, oauth2.VerifierOption(verifier))

In both cases build the client with the resulting token:

client, err := warcraftlogs.New(ctx,
	warcraftlogs.WithTokenSource(cfg.TokenSource(ctx, tok)),
	warcraftlogs.WithEndpoint(warcraftlogs.UserEndpoint))
Example
package main

import (
	"context"
	"fmt"
	"log"

	warcraftlogs "github.com/math280h/go-wcl"
)

func main() {
	ctx := context.Background()
	cfg := warcraftlogs.OAuthConfig("client-id", "client-secret", "https://example.com/callback")

	url := cfg.AuthCodeURL("state-token")
	fmt.Println("visit:", url)

	tok, err := cfg.Exchange(ctx, "code-from-callback")
	if err != nil {
		log.Fatal(err)
	}

	client, err := warcraftlogs.New(ctx,
		warcraftlogs.WithTokenSource(cfg.TokenSource(ctx, tok)),
		warcraftlogs.WithEndpoint(warcraftlogs.UserEndpoint))
	if err != nil {
		log.Fatal(err)
	}
	_ = client
}

Types

type CDNError

type CDNError struct {
	StatusCode int
	URL        string
	// Title is the <title> of the returned page, e.g. "Just a moment...". It is
	// empty if the page had none.
	Title string
}

CDNError is returned when the CDN answers with an HTML challenge or error page instead of a GraphQL response. It unwraps to ErrBlocked.

func (*CDNError) Error

func (e *CDNError) Error() string

func (*CDNError) Unwrap

func (e *CDNError) Unwrap() error

type Character

type Character struct {
	// The ID of the character.
	Id int `json:"id"`
	// The canonical ID of the character. If a character renames or transfers, then the canonical id can be used to identify the most recent version of the character.
	CanonicalID int `json:"canonicalID"`
	// The name of the character.
	Name string `json:"name"`
	// The class id of the character.
	ClassID int `json:"classID"`
	// The level of the character.
	Level int `json:"level"`
	// Whether or not the character has all its rankings hidden.
	Hidden bool `json:"hidden"`
	// The guild rank of the character in their primary guild. This is not the user rank on the site, but the rank according to the game data, e.g., a Warcraft guild rank or an FFXIV Free Company rank.
	GuildRank int `json:"guildRank"`
	// The faction of the character.
	Faction Faction `json:"faction"`
	// The server that the character belongs to.
	Server Server `json:"server"`
}

Character includes the GraphQL fields of Character requested by the fragment Character. The GraphQL type's documentation follows.

A player character. Characters can earn individual rankings and appear in reports.

func (*Character) GetCanonicalID

func (v *Character) GetCanonicalID() int

GetCanonicalID returns Character.CanonicalID, and is useful for accessing the field via an interface.

func (*Character) GetClassID

func (v *Character) GetClassID() int

GetClassID returns Character.ClassID, and is useful for accessing the field via an interface.

func (*Character) GetFaction

func (v *Character) GetFaction() Faction

GetFaction returns Character.Faction, and is useful for accessing the field via an interface.

func (*Character) GetGuildRank

func (v *Character) GetGuildRank() int

GetGuildRank returns Character.GuildRank, and is useful for accessing the field via an interface.

func (*Character) GetHidden

func (v *Character) GetHidden() bool

GetHidden returns Character.Hidden, and is useful for accessing the field via an interface.

func (*Character) GetId

func (v *Character) GetId() int

GetId returns Character.Id, and is useful for accessing the field via an interface.

func (*Character) GetLevel

func (v *Character) GetLevel() int

GetLevel returns Character.Level, and is useful for accessing the field via an interface.

func (*Character) GetName

func (v *Character) GetName() string

GetName returns Character.Name, and is useful for accessing the field via an interface.

func (*Character) GetServer

func (v *Character) GetServer() Server

GetServer returns Character.Server, and is useful for accessing the field via an interface.

type CharacterPageRankingMetricType

type CharacterPageRankingMetricType string

All character ranking metrics, plus combined metrics for points and damage/healing that are displayed on character pages.

const (
	// Boss cDPS is unique to FFXIV and is damage done to the boss adjusted for raid-contributing buffs and debuffs.
	CharacterPageRankingMetricTypeBosscdps CharacterPageRankingMetricType = "bosscdps"
	// Boss damage per second.
	CharacterPageRankingMetricTypeBossdps CharacterPageRankingMetricType = "bossdps"
	// Boss nDPS is unique to FFXIV and is damage done to the boss adjusted for raid-contributing buffs and debuffs.
	CharacterPageRankingMetricTypeBossndps CharacterPageRankingMetricType = "bossndps"
	// Boss rDPS is unique to FFXIV and is damage done to the boss adjusted for raid-contributing buffs and debuffs.
	CharacterPageRankingMetricTypeBossrdps CharacterPageRankingMetricType = "bossrdps"
	// Choose an appropriate default depending on the other selected parameters.
	CharacterPageRankingMetricTypeDefault CharacterPageRankingMetricType = "default"
	// Damage per second.
	CharacterPageRankingMetricTypeDps CharacterPageRankingMetricType = "dps"
	// Healing per second.
	CharacterPageRankingMetricTypeHps CharacterPageRankingMetricType = "hps"
	// Survivability ranking for tanks. Deprecated. Only supported for some older WoW zones.
	CharacterPageRankingMetricTypeKrsi CharacterPageRankingMetricType = "krsi"
	// Score. Used by WoW Mythic dungeons and by ESO trials.
	CharacterPageRankingMetricTypePlayerscore CharacterPageRankingMetricType = "playerscore"
	// Speed. Not supported by every zone.
	CharacterPageRankingMetricTypePlayerspeed CharacterPageRankingMetricType = "playerspeed"
	// cDPS is unique to FFXIV and is damage done adjusted for raid-contributing buffs and debuffs.
	CharacterPageRankingMetricTypeCdps CharacterPageRankingMetricType = "cdps"
	// nDPS is unique to FFXIV and is damage done adjusted for raid-contributing buffs and debuffs.
	CharacterPageRankingMetricTypeNdps CharacterPageRankingMetricType = "ndps"
	// rDPS is unique to FFXIV and is damage done adjusted for raid-contributing buffs and debuffs.
	CharacterPageRankingMetricTypeRdps CharacterPageRankingMetricType = "rdps"
	// Healing done per second to tanks.
	CharacterPageRankingMetricTypeTankhps CharacterPageRankingMetricType = "tankhps"
	// Weighted damage per second. Unique to WoW currently. Used to remove pad damage and reward damage done to high priority targets.
	CharacterPageRankingMetricTypeWdps CharacterPageRankingMetricType = "wdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterPageRankingMetricTypeHealercombineddps CharacterPageRankingMetricType = "healercombineddps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterPageRankingMetricTypeHealercombinedbossdps CharacterPageRankingMetricType = "healercombinedbossdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterPageRankingMetricTypeHealercombinedcdps CharacterPageRankingMetricType = "healercombinedcdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterPageRankingMetricTypeHealercombinedbosscdps CharacterPageRankingMetricType = "healercombinedbosscdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterPageRankingMetricTypeHealercombinedndps CharacterPageRankingMetricType = "healercombinedndps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterPageRankingMetricTypeHealercombinedbossndps CharacterPageRankingMetricType = "healercombinedbossndps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterPageRankingMetricTypeHealercombinedrdps CharacterPageRankingMetricType = "healercombinedrdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterPageRankingMetricTypeHealercombinedbossrdps CharacterPageRankingMetricType = "healercombinedbossrdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterPageRankingMetricTypeTankcombineddps CharacterPageRankingMetricType = "tankcombineddps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterPageRankingMetricTypeTankcombinedbossdps CharacterPageRankingMetricType = "tankcombinedbossdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterPageRankingMetricTypeTankcombinedcdps CharacterPageRankingMetricType = "tankcombinedcdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterPageRankingMetricTypeTankcombinedbosscdps CharacterPageRankingMetricType = "tankcombinedbosscdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterPageRankingMetricTypeTankcombinedndps CharacterPageRankingMetricType = "tankcombinedndps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterPageRankingMetricTypeTankcombinedbossndps CharacterPageRankingMetricType = "tankcombinedbossndps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterPageRankingMetricTypeTankcombinedrdps CharacterPageRankingMetricType = "tankcombinedrdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterPageRankingMetricTypeTankcombinedbossrdps CharacterPageRankingMetricType = "tankcombinedbossrdps"
	// Combined score and damage. Used by WoW Mythic+ and Fellowship. Returns score rankings plus an additional throughputRankings field with damage data filtered by key and item level.
	CharacterPageRankingMetricTypePointsAndDamage CharacterPageRankingMetricType = "points_and_damage"
	// Combined score and healing. Used by WoW Mythic+ and Fellowship. Returns score rankings plus an additional throughputRankings field with healing data filtered by key and item level.
	CharacterPageRankingMetricTypePointsAndHealing CharacterPageRankingMetricType = "points_and_healing"
)

type CharacterRankingMetricType

type CharacterRankingMetricType string

All the possible metrics.

const (
	// Boss cDPS is unique to FFXIV and is damage done to the boss adjusted for raid-contributing buffs and debuffs.
	CharacterRankingMetricTypeBosscdps CharacterRankingMetricType = "bosscdps"
	// Boss damage per second.
	CharacterRankingMetricTypeBossdps CharacterRankingMetricType = "bossdps"
	// Boss nDPS is unique to FFXIV and is damage done to the boss adjusted for raid-contributing buffs and debuffs.
	CharacterRankingMetricTypeBossndps CharacterRankingMetricType = "bossndps"
	// Boss rDPS is unique to FFXIV and is damage done to the boss adjusted for raid-contributing buffs and debuffs.
	CharacterRankingMetricTypeBossrdps CharacterRankingMetricType = "bossrdps"
	// Choose an appropriate default depending on the other selected parameters.
	CharacterRankingMetricTypeDefault CharacterRankingMetricType = "default"
	// Damage per second.
	CharacterRankingMetricTypeDps CharacterRankingMetricType = "dps"
	// Healing per second.
	CharacterRankingMetricTypeHps CharacterRankingMetricType = "hps"
	// Survivability ranking for tanks. Deprecated. Only supported for some older WoW zones.
	CharacterRankingMetricTypeKrsi CharacterRankingMetricType = "krsi"
	// Score. Used by WoW Mythic dungeons and by ESO trials.
	CharacterRankingMetricTypePlayerscore CharacterRankingMetricType = "playerscore"
	// Speed. Not supported by every zone.
	CharacterRankingMetricTypePlayerspeed CharacterRankingMetricType = "playerspeed"
	// cDPS is unique to FFXIV and is damage done adjusted for raid-contributing buffs and debuffs.
	CharacterRankingMetricTypeCdps CharacterRankingMetricType = "cdps"
	// nDPS is unique to FFXIV and is damage done adjusted for raid-contributing buffs and debuffs.
	CharacterRankingMetricTypeNdps CharacterRankingMetricType = "ndps"
	// rDPS is unique to FFXIV and is damage done adjusted for raid-contributing buffs and debuffs.
	CharacterRankingMetricTypeRdps CharacterRankingMetricType = "rdps"
	// Healing done per second to tanks.
	CharacterRankingMetricTypeTankhps CharacterRankingMetricType = "tankhps"
	// Weighted damage per second. Unique to WoW currently. Used to remove pad damage and reward damage done to high priority targets.
	CharacterRankingMetricTypeWdps CharacterRankingMetricType = "wdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterRankingMetricTypeHealercombineddps CharacterRankingMetricType = "healercombineddps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterRankingMetricTypeHealercombinedbossdps CharacterRankingMetricType = "healercombinedbossdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterRankingMetricTypeHealercombinedcdps CharacterRankingMetricType = "healercombinedcdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterRankingMetricTypeHealercombinedbosscdps CharacterRankingMetricType = "healercombinedbosscdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterRankingMetricTypeHealercombinedndps CharacterRankingMetricType = "healercombinedndps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterRankingMetricTypeHealercombinedbossndps CharacterRankingMetricType = "healercombinedbossndps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterRankingMetricTypeHealercombinedrdps CharacterRankingMetricType = "healercombinedrdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of healers in eight player content.
	CharacterRankingMetricTypeHealercombinedbossrdps CharacterRankingMetricType = "healercombinedbossrdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterRankingMetricTypeTankcombineddps CharacterRankingMetricType = "tankcombineddps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterRankingMetricTypeTankcombinedbossdps CharacterRankingMetricType = "tankcombinedbossdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterRankingMetricTypeTankcombinedcdps CharacterRankingMetricType = "tankcombinedcdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterRankingMetricTypeTankcombinedbosscdps CharacterRankingMetricType = "tankcombinedbosscdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterRankingMetricTypeTankcombinedndps CharacterRankingMetricType = "tankcombinedndps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterRankingMetricTypeTankcombinedbossndps CharacterRankingMetricType = "tankcombinedbossndps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterRankingMetricTypeTankcombinedrdps CharacterRankingMetricType = "tankcombinedrdps"
	// Unique to FFXIV. Represents the combined ranking for a pair of tanks in eight player content.
	CharacterRankingMetricTypeTankcombinedbossrdps CharacterRankingMetricType = "tankcombinedbossrdps"
)

type CharacterRef

type CharacterRef struct {
	ID           int
	Name         string
	ServerSlug   string
	ServerRegion string
}

CharacterRef identifies a character by ID, or by name plus server slug and region (e.g. "us", "eu"). Populate one form or the other.

type Client

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

Client is a Warcraft Logs API client. It is safe for concurrent use.

func New

func New(ctx context.Context, opts ...Option) (*Client, error)

New creates a Client. Provide authentication with WithClientCredentials, WithTokenSource, or WithHTTPClient. Canceling ctx does not affect the returned Client.

Example
package main

import (
	"context"
	"log"

	warcraftlogs "github.com/math280h/go-wcl"
)

func main() {
	ctx := context.Background()
	client, err := warcraftlogs.New(ctx,
		warcraftlogs.WithClientCredentials("client-id", "client-secret"))
	if err != nil {
		log.Fatal(err)
	}
	_ = client
}

func (*Client) Ability

func (c *Client) Ability(ctx context.Context, id int) (*GameAbility, error)

Ability looks up a game ability by its ID. It returns ErrNotFound if no ability matches.

func (*Client) Character

func (c *Client) Character(ctx context.Context, id int) (*Character, error)

Character looks up a character by its canonical ID. It returns ErrNotFound if no character matches.

func (*Client) CharacterByName

func (c *Client) CharacterByName(ctx context.Context, name, serverSlug, serverRegion string) (*Character, error)

CharacterByName looks up a character by name, server slug, and server region (e.g. "us", "eu"). It returns ErrNotFound if no character matches.

func (*Client) CharacterEncounterRankings

func (c *Client) CharacterEncounterRankings(ctx context.Context, p EncounterRankingsParams) (json.RawMessage, error)

CharacterEncounterRankings returns a character's ranked performance for a single encounter as raw JSON. It returns ErrNotFound if no character matches.

func (*Client) CharacterZoneRankings

func (c *Client) CharacterZoneRankings(ctx context.Context, p ZoneRankingsParams) (json.RawMessage, error)

CharacterZoneRankings returns a character's ranked performance across a zone as raw JSON. It returns ErrNotFound if no character matches.

func (*Client) Classes

func (c *Client) Classes(ctx context.Context, factionID, zoneID int) ([]GameClass, error)

Classes returns the playable classes, optionally filtered by faction and zone. A zero filter is omitted.

func (*Client) CurrentUser

func (c *Client) CurrentUser(ctx context.Context) (*CurrentUser, error)

CurrentUser returns the authenticated user. It requires UserEndpoint and a token from the authorization-code or PKCE flow, and returns ErrNotFound otherwise.

func (*Client) Encounter

func (c *Client) Encounter(ctx context.Context, id int) (*Encounter, error)

Encounter looks up an encounter by its ID. It returns ErrNotFound if no encounter matches.

func (*Client) EncounterLeaderboard

func (c *Client) EncounterLeaderboard(ctx context.Context, p EncounterLeaderboardParams) (json.RawMessage, error)

EncounterLeaderboard returns an encounter's top-ranked characters as raw JSON. This is the inverse of Client.CharacterEncounterRankings, which ranks one named character. It returns ErrNotFound if no encounter matches.

func (*Client) Endpoint

func (c *Client) Endpoint() string

Endpoint returns the GraphQL endpoint the client targets.

func (*Client) Execute

func (c *Client) Execute(ctx context.Context, query string, variables map[string]any, out any) error

Execute runs a GraphQL query and decodes the "data" field of the response into out, which must be a pointer. Use it for operations not covered by the generated methods.

Example
package main

import (
	"context"
	"fmt"
	"log"

	warcraftlogs "github.com/math280h/go-wcl"
)

func main() {
	ctx := context.Background()
	client, err := warcraftlogs.New(ctx,
		warcraftlogs.WithClientCredentials("client-id", "client-secret"))
	if err != nil {
		log.Fatal(err)
	}

	var resp struct {
		WorldData struct {
			Zones []struct {
				ID   int    `json:"id"`
				Name string `json:"name"`
			} `json:"zones"`
		} `json:"worldData"`
	}
	if err := client.Execute(ctx, `query { worldData { zones { id name } } }`, nil, &resp); err != nil {
		log.Fatal(err)
	}
	for _, z := range resp.WorldData.Zones {
		fmt.Println(z.ID, z.Name)
	}
}

func (*Client) Expansion

func (c *Client) Expansion(ctx context.Context, id int) (*Expansion, error)

Expansion looks up an expansion by its ID. It returns ErrNotFound if no expansion matches.

func (*Client) Expansions

func (c *Client) Expansions(ctx context.Context) ([]Expansion, error)

Expansions returns all expansions.

func (*Client) GraphQL

func (c *Client) GraphQL() graphql.Client

GraphQL returns the underlying genqlient client for use with generated operations or custom tooling.

func (*Client) Guild

func (c *Client) Guild(ctx context.Context, id int) (*Guild, error)

Guild looks up a guild by its ID. It returns ErrNotFound if no guild matches.

func (*Client) GuildByName

func (c *Client) GuildByName(ctx context.Context, name, serverSlug, serverRegion string) (*Guild, error)

GuildByName looks up a guild by name, server slug, and server region (e.g. "us", "eu"). It returns ErrNotFound if no guild matches.

func (*Client) Item

func (c *Client) Item(ctx context.Context, id int) (*GameItem, error)

Item looks up a game item by its ID. It returns ErrNotFound if no item matches.

func (*Client) NPC

func (c *Client) NPC(ctx context.Context, id int) (*GameNPC, error)

NPC looks up a game NPC by its ID. It returns ErrNotFound if no NPC matches.

func (*Client) RateLimit

func (c *Client) RateLimit(ctx context.Context) (RateLimit, error)

RateLimit returns the API point budget for the authenticated key. The budget resets on a rolling one-hour window; costs scale with the amount of data a query requests.

Example
package main

import (
	"context"
	"fmt"
	"log"

	warcraftlogs "github.com/math280h/go-wcl"
)

func main() {
	ctx := context.Background()
	client, err := warcraftlogs.New(ctx,
		warcraftlogs.WithClientCredentials("client-id", "client-secret"))
	if err != nil {
		log.Fatal(err)
	}

	limit, err := client.RateLimit(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%.1f / %d points used\n", limit.PointsSpentThisHour, limit.LimitPerHour)
}

func (*Client) Regions

func (c *Client) Regions(ctx context.Context) ([]Region, error)

Regions returns all regions.

func (*Client) Report

func (c *Client) Report(ctx context.Context, code string, allowUnlisted bool) (*Report, error)

Report looks up a report by its code. It returns ErrNotFound if no report matches. Set allowUnlisted to access unlisted reports the authenticated key may view.

func (*Client) ReportActors

func (c *Client) ReportActors(ctx context.Context, p ReportActorsParams) ([]ReportActor, error)

ReportActors returns a report's actors, filtered by type and sub-type. It is the narrow form of Client.ReportMasterData, which always returns every actor alongside the full ability table. It returns ErrNotFound if no report matches.

func (*Client) ReportEvents

func (c *Client) ReportEvents(ctx context.Context, dataType EventDataType, p ReportEventsParams) (EventPage, error)

ReportEvents returns a page of report events as raw JSON. It returns ErrNotFound if no report matches.

func (*Client) ReportEventsAll

func (c *Client) ReportEventsAll(ctx context.Context, dataType EventDataType, p ReportEventsParams) iter.Seq2[json.RawMessage, error]

ReportEventsAll iterates every event matching p, following EventPage.NextPageTimestamp across pages and yielding one event at a time. Events arrive as raw JSON objects for the caller to decode.

Iteration stops at the first error, which is yielded with a nil event. Stop early by breaking out of the range loop; no further requests are made.

for e, err := range client.ReportEventsAll(ctx, dataType, params) {
	if err != nil {
		return err
	}
	// ... decode e ...
}

Like Client.ReportEvents, this requires either FightIDs or an explicit StartTime and EndTime range. It does not modify p.

func (*Client) ReportGraph

func (c *Client) ReportGraph(ctx context.Context, dataType GraphDataType, p ReportAnalysisParams) (json.RawMessage, error)

ReportGraph returns report graph data as raw JSON. It returns ErrNotFound if no report matches.

func (*Client) ReportMasterData

func (c *Client) ReportMasterData(ctx context.Context, code string, translate bool) (ReportMasterData, error)

ReportMasterData returns the actors and abilities referenced by a report. Set translate to localize names to the request locale. It returns ErrNotFound if no report matches.

func (*Client) ReportPlayerDetails

func (c *Client) ReportPlayerDetails(ctx context.Context, p PlayerDetailsParams) (json.RawMessage, error)

ReportPlayerDetails returns per-player detail for a report as raw JSON. It returns ErrNotFound if no report matches.

func (*Client) ReportRankings

func (c *Client) ReportRankings(ctx context.Context, p ReportRankingsParams) (json.RawMessage, error)

ReportRankings returns a report's rankings as raw JSON. It returns ErrNotFound if no report matches.

func (*Client) ReportTable

func (c *Client) ReportTable(ctx context.Context, dataType TableDataType, p ReportAnalysisParams) (json.RawMessage, error)

ReportTable returns a report analysis table as raw JSON. It returns ErrNotFound if no report matches.

func (*Client) ReportWithFights

func (c *Client) ReportWithFights(ctx context.Context, p ReportWithFightsParams) (*ReportWithFights, error)

ReportWithFights returns a report's header, fights and encounter phases in a single request. Use Client.Report when the header is all you need. It returns ErrNotFound if no report matches.

func (*Client) Reports

func (c *Client) Reports(ctx context.Context, p ReportsParams) (ReportPage, error)

Reports lists uploaded reports for a guild or user. Advance through the result by incrementing Page while ReportPage.HasMorePages is true. Limit defaults to 100, which is also the maximum.

func (*Client) Server

func (c *Client) Server(ctx context.Context, id int) (*Server, error)

Server looks up a server by its ID. It returns ErrNotFound if no server matches.

func (*Client) ServerBySlug

func (c *Client) ServerBySlug(ctx context.Context, region, slug string) (*Server, error)

ServerBySlug looks up a server by its region abbreviation (e.g. "US") and slug. It returns ErrNotFound if no server matches.

func (*Client) User

func (c *Client) User(ctx context.Context, id int) (*User, error)

User looks up a user by ID. It returns ErrNotFound if no user matches. Avatar and battle tag are only readable through Client.CurrentUser.

func (*Client) Zone

func (c *Client) Zone(ctx context.Context, id int) (*Zone, error)

Zone looks up a zone by its ID. It returns ErrNotFound if no zone matches.

func (*Client) Zones

func (c *Client) Zones(ctx context.Context, expansionID int) ([]Zone, error)

Zones returns the zones of an expansion, or of all expansions when expansionID is zero.

type CurrentUser

type CurrentUser struct {
	// The ID of the user.
	Id int `json:"id"`
	// The name of the user.
	Name string `json:"name"`
	// The avatar of the user, typically the main character avatar.
	Avatar string `json:"avatar"`
	// The battle tag of the user if they have linked it.
	BattleTag string `json:"battleTag"`
}

CurrentUser includes the GraphQL fields of User requested by the fragment CurrentUser. The GraphQL type's documentation follows.

A single user of the site. Most fields can only be accessed when authenticated as that user with the "view-user-profile" scope.

func (*CurrentUser) GetAvatar

func (v *CurrentUser) GetAvatar() string

GetAvatar returns CurrentUser.Avatar, and is useful for accessing the field via an interface.

func (*CurrentUser) GetBattleTag

func (v *CurrentUser) GetBattleTag() string

GetBattleTag returns CurrentUser.BattleTag, and is useful for accessing the field via an interface.

func (*CurrentUser) GetId

func (v *CurrentUser) GetId() int

GetId returns CurrentUser.Id, and is useful for accessing the field via an interface.

func (*CurrentUser) GetName

func (v *CurrentUser) GetName() string

GetName returns CurrentUser.Name, and is useful for accessing the field via an interface.

type Encounter

type Encounter struct {
	// The ID of the encounter.
	Id int `json:"id"`
	// The localized name of the encounter.
	Name string `json:"name"`
	// The Blizzard journal ID, used as the identifier in the encounter journal and various Blizzard APIs like progression.
	JournalID int `json:"journalID"`
	// The zone that this encounter is found in.
	Zone ZoneSummary `json:"zone"`
}

Encounter includes the GraphQL fields of Encounter requested by the fragment Encounter. The GraphQL type's documentation follows.

A single encounter for the game.

func (*Encounter) GetId

func (v *Encounter) GetId() int

GetId returns Encounter.Id, and is useful for accessing the field via an interface.

func (*Encounter) GetJournalID

func (v *Encounter) GetJournalID() int

GetJournalID returns Encounter.JournalID, and is useful for accessing the field via an interface.

func (*Encounter) GetName

func (v *Encounter) GetName() string

GetName returns Encounter.Name, and is useful for accessing the field via an interface.

func (*Encounter) GetZone

func (v *Encounter) GetZone() ZoneSummary

GetZone returns Encounter.Zone, and is useful for accessing the field via an interface.

type EncounterLeaderboardParams

type EncounterLeaderboardParams struct {
	EncounterID          int
	Difficulty           int
	ClassName            string
	SpecName             string
	Metric               CharacterRankingMetricType
	Page                 int
	Partition            int
	Bracket              int
	Size                 int
	ServerRegion         string
	ServerSlug           string
	Filter               string
	IncludeCombatantInfo bool
}

EncounterLeaderboardParams selects the leaderboard returned by Client.EncounterLeaderboard. EncounterID is required; other zero fields are omitted.

type EncounterPhases

type EncounterPhases struct {
	EncounterID int `json:"encounterID"`
	// Whether the phases can be used to separate wipes in the report UI.
	SeparatesWipes *bool `json:"separatesWipes"`
	// Phase metadata for all phases in this encounter.
	Phases []PhaseMetadata `json:"phases"`
}

EncounterPhases includes the GraphQL fields of EncounterPhases requested by the fragment EncounterPhases.

func (*EncounterPhases) GetEncounterID

func (v *EncounterPhases) GetEncounterID() int

GetEncounterID returns EncounterPhases.EncounterID, and is useful for accessing the field via an interface.

func (*EncounterPhases) GetPhases

func (v *EncounterPhases) GetPhases() []PhaseMetadata

GetPhases returns EncounterPhases.Phases, and is useful for accessing the field via an interface.

func (*EncounterPhases) GetSeparatesWipes

func (v *EncounterPhases) GetSeparatesWipes() *bool

GetSeparatesWipes returns EncounterPhases.SeparatesWipes, and is useful for accessing the field via an interface.

type EncounterRankingsParams

type EncounterRankingsParams struct {
	Character            CharacterRef
	EncounterID          int
	Metric               CharacterRankingMetricType
	Difficulty           int
	Partition            int
	Role                 RoleType
	Size                 int
	ClassName            string
	SpecName             string
	ByBracket            bool
	Timeframe            RankingTimeframeType
	Compare              RankingCompareType
	IncludeCombatantInfo bool
}

EncounterRankingsParams filters character encounter rankings. Zero fields are omitted.

type EventDataType

type EventDataType string

The type of events or tables to examine.

const (
	// All Events
	EventDataTypeAll EventDataType = "All"
	// Buffs.
	EventDataTypeBuffs EventDataType = "Buffs"
	// Casts.
	EventDataTypeCasts EventDataType = "Casts"
	// Combatant info events (includes gear).
	EventDataTypeCombatantInfo EventDataType = "CombatantInfo"
	// Damage done.
	EventDataTypeDamageDone EventDataType = "DamageDone"
	// Damage taken.
	EventDataTypeDamageTaken EventDataType = "DamageTaken"
	// Deaths.
	EventDataTypeDeaths EventDataType = "Deaths"
	// Debuffs.
	EventDataTypeDebuffs EventDataType = "Debuffs"
	// Dispels.
	EventDataTypeDispels EventDataType = "Dispels"
	// Healing done.
	EventDataTypeHealing EventDataType = "Healing"
	// Interrupts.
	EventDataTypeInterrupts EventDataType = "Interrupts"
	// Resources.
	EventDataTypeResources EventDataType = "Resources"
	// Summons
	EventDataTypeSummons EventDataType = "Summons"
	// Threat.
	EventDataTypeThreat EventDataType = "Threat"
)

type EventPage

type EventPage struct {
	Data              json.RawMessage
	NextPageTimestamp float64
}

EventPage is one page of report events. NextPageTimestamp is zero when there are no further pages; otherwise pass it as StartTime to fetch the next page.

type Expansion

type Expansion struct {
	// The ID of the expansion.
	Id int `json:"id"`
	// The localized name of the expansion.
	Name string `json:"name"`
	// The zones (e.g., raids and dungeons) supported for this expansion.
	Zones []ExpansionZonesZone `json:"zones"`
}

Expansion includes the GraphQL fields of Expansion requested by the fragment Expansion. The GraphQL type's documentation follows.

A single expansion for the game.

func (*Expansion) GetId

func (v *Expansion) GetId() int

GetId returns Expansion.Id, and is useful for accessing the field via an interface.

func (*Expansion) GetName

func (v *Expansion) GetName() string

GetName returns Expansion.Name, and is useful for accessing the field via an interface.

func (*Expansion) GetZones

func (v *Expansion) GetZones() []ExpansionZonesZone

GetZones returns Expansion.Zones, and is useful for accessing the field via an interface.

type ExpansionSummary

type ExpansionSummary struct {
	// The ID of the expansion.
	Id int `json:"id"`
	// The localized name of the expansion.
	Name string `json:"name"`
}

ExpansionSummary includes the GraphQL fields of Expansion requested by the fragment ExpansionSummary. The GraphQL type's documentation follows.

A single expansion for the game.

func (*ExpansionSummary) GetId

func (v *ExpansionSummary) GetId() int

GetId returns ExpansionSummary.Id, and is useful for accessing the field via an interface.

func (*ExpansionSummary) GetName

func (v *ExpansionSummary) GetName() string

GetName returns ExpansionSummary.Name, and is useful for accessing the field via an interface.

type ExpansionZonesZone

type ExpansionZonesZone struct {
	// The ID of the zone.
	Id int `json:"id"`
	// The name of the zone.
	Name string `json:"name"`
}

ExpansionZonesZone includes the requested fields of the GraphQL type Zone. The GraphQL type's documentation follows.

A single zone from an expansion that represents a raid, dungeon, arena, etc.

func (*ExpansionZonesZone) GetId

func (v *ExpansionZonesZone) GetId() int

GetId returns ExpansionZonesZone.Id, and is useful for accessing the field via an interface.

func (*ExpansionZonesZone) GetName

func (v *ExpansionZonesZone) GetName() string

GetName returns ExpansionZonesZone.Name, and is useful for accessing the field via an interface.

type Faction

type Faction struct {
	// An integer representing the faction id.
	Id int `json:"id"`
	// The localized name of the faction.
	Name string `json:"name"`
}

Faction includes the GraphQL fields of GameFaction requested by the fragment Faction. The GraphQL type's documentation follows.

A faction that a player or guild can belong to. Factions have an integer id used to identify them throughout the API and a localized name describing the faction.

func (*Faction) GetId

func (v *Faction) GetId() int

GetId returns Faction.Id, and is useful for accessing the field via an interface.

func (*Faction) GetName

func (v *Faction) GetName() string

GetName returns Faction.Name, and is useful for accessing the field via an interface.

type GameAbility

type GameAbility struct {
	// The ID of the ability.
	Id int `json:"id"`
	// The icon for the ability.
	Icon string `json:"icon"`
	// The localized name of the ability. Will be null if no localization information exists for the ability.
	Name string `json:"name"`
}

GameAbility includes the GraphQL fields of GameAbility requested by the fragment GameAbility. The GraphQL type's documentation follows.

A single ability for the game.

func (*GameAbility) GetIcon

func (v *GameAbility) GetIcon() string

GetIcon returns GameAbility.Icon, and is useful for accessing the field via an interface.

func (*GameAbility) GetId

func (v *GameAbility) GetId() int

GetId returns GameAbility.Id, and is useful for accessing the field via an interface.

func (*GameAbility) GetName

func (v *GameAbility) GetName() string

GetName returns GameAbility.Name, and is useful for accessing the field via an interface.

type GameClass

type GameClass struct {
	// An integer used to identify the class.
	Id int `json:"id"`
	// The localized name of the class.
	Name string `json:"name"`
	// A slug used to identify the class.
	Slug string `json:"slug"`
	// The specs supported by the class.
	Specs []GameClassSpecsGameSpec `json:"specs"`
}

GameClass includes the GraphQL fields of GameClass requested by the fragment GameClass. The GraphQL type's documentation follows.

A single player class for the game.

func (*GameClass) GetId

func (v *GameClass) GetId() int

GetId returns GameClass.Id, and is useful for accessing the field via an interface.

func (*GameClass) GetName

func (v *GameClass) GetName() string

GetName returns GameClass.Name, and is useful for accessing the field via an interface.

func (*GameClass) GetSlug

func (v *GameClass) GetSlug() string

GetSlug returns GameClass.Slug, and is useful for accessing the field via an interface.

func (*GameClass) GetSpecs

func (v *GameClass) GetSpecs() []GameClassSpecsGameSpec

GetSpecs returns GameClass.Specs, and is useful for accessing the field via an interface.

type GameClassSpecsGameSpec

type GameClassSpecsGameSpec struct {
	// An integer used to identify the spec.
	Id int `json:"id"`
	// The localized name of the class.
	Name string `json:"name"`
	// A slug used to identify the spec.
	Slug string `json:"slug"`
}

GameClassSpecsGameSpec includes the requested fields of the GraphQL type GameSpec. The GraphQL type's documentation follows.

A spec for a given player class.

func (*GameClassSpecsGameSpec) GetId

func (v *GameClassSpecsGameSpec) GetId() int

GetId returns GameClassSpecsGameSpec.Id, and is useful for accessing the field via an interface.

func (*GameClassSpecsGameSpec) GetName

func (v *GameClassSpecsGameSpec) GetName() string

GetName returns GameClassSpecsGameSpec.Name, and is useful for accessing the field via an interface.

func (*GameClassSpecsGameSpec) GetSlug

func (v *GameClassSpecsGameSpec) GetSlug() string

GetSlug returns GameClassSpecsGameSpec.Slug, and is useful for accessing the field via an interface.

type GameItem

type GameItem struct {
	// The ID of the item.
	Id int `json:"id"`
	// The icon for the item.
	Icon string `json:"icon"`
	// The localized name of the item. Will be null if no localization information exists for the item.
	Name string `json:"name"`
}

GameItem includes the GraphQL fields of GameItem requested by the fragment GameItem. The GraphQL type's documentation follows.

A single item for the game.

func (*GameItem) GetIcon

func (v *GameItem) GetIcon() string

GetIcon returns GameItem.Icon, and is useful for accessing the field via an interface.

func (*GameItem) GetId

func (v *GameItem) GetId() int

GetId returns GameItem.Id, and is useful for accessing the field via an interface.

func (*GameItem) GetName

func (v *GameItem) GetName() string

GetName returns GameItem.Name, and is useful for accessing the field via an interface.

type GameNPC

type GameNPC struct {
	// The ID of the NPC.
	Id int `json:"id"`
	// The localized name of the NPC. Will be null if no localization information exists for the NPC.
	Name string `json:"name"`
}

GameNPC includes the GraphQL fields of GameNPC requested by the fragment GameNPC. The GraphQL type's documentation follows.

A single NPC for the game.

func (*GameNPC) GetId

func (v *GameNPC) GetId() int

GetId returns GameNPC.Id, and is useful for accessing the field via an interface.

func (*GameNPC) GetName

func (v *GameNPC) GetName() string

GetName returns GameNPC.Name, and is useful for accessing the field via an interface.

type GameZoneSummary

type GameZoneSummary struct {
	// The ID of the zone.
	Id float64 `json:"id"`
	// The localized name of the zone. Will be null if no localization information exists for the zone.
	Name string `json:"name"`
}

GameZoneSummary includes the GraphQL fields of GameZone requested by the fragment GameZoneSummary. The GraphQL type's documentation follows.

A single zone for the game.

func (*GameZoneSummary) GetId

func (v *GameZoneSummary) GetId() float64

GetId returns GameZoneSummary.Id, and is useful for accessing the field via an interface.

func (*GameZoneSummary) GetName

func (v *GameZoneSummary) GetName() string

GetName returns GameZoneSummary.Name, and is useful for accessing the field via an interface.

type GraphDataType

type GraphDataType string

The type of graph to examine.

const (
	// Summary Overview
	GraphDataTypeSummary GraphDataType = "Summary"
	// Buffs.
	GraphDataTypeBuffs GraphDataType = "Buffs"
	// Casts.
	GraphDataTypeCasts GraphDataType = "Casts"
	// Damage done.
	GraphDataTypeDamageDone GraphDataType = "DamageDone"
	// Damage taken.
	GraphDataTypeDamageTaken GraphDataType = "DamageTaken"
	// Deaths.
	GraphDataTypeDeaths GraphDataType = "Deaths"
	// Debuffs.
	GraphDataTypeDebuffs GraphDataType = "Debuffs"
	// Dispels.
	GraphDataTypeDispels GraphDataType = "Dispels"
	// Healing done.
	GraphDataTypeHealing GraphDataType = "Healing"
	// Interrupts.
	GraphDataTypeInterrupts GraphDataType = "Interrupts"
	// Resources.
	GraphDataTypeResources GraphDataType = "Resources"
	// Summons
	GraphDataTypeSummons GraphDataType = "Summons"
	// Survivability (death info across multiple pulls).
	GraphDataTypeSurvivability GraphDataType = "Survivability"
	// Threat.
	GraphDataTypeThreat GraphDataType = "Threat"
)

type GraphQLError

type GraphQLError struct {
	Message string
	// Path is the dotted response path the error applies to, such as
	// "reportData.report", with list elements as "[0]". It is empty when the
	// error is not tied to a field.
	Path       string
	Locations  []Location
	Extensions map[string]any
}

GraphQLError is a single error entry from a GraphQL response.

func GraphQLErrors

func GraphQLErrors(err error) []GraphQLError

GraphQLErrors returns the GraphQL-level errors carried by err, or nil if err is not one. A response may contain both partial data and errors.

func (GraphQLError) Error

func (e GraphQLError) Error() string

type Guild

type Guild struct {
	// The ID of the guild.
	Id int `json:"id"`
	// The name of the guild.
	Name string `json:"name"`
	// The description for the guild that is displayed with the guild name on the site.
	Description string `json:"description"`
	// Whether or not the guild has competition mode enabled.
	CompetitionMode bool `json:"competitionMode"`
	// Whether or not the guild has stealth mode enabled.
	StealthMode bool `json:"stealthMode"`
	// The type of the guild. A value of 0 indicates a guild. A value of 1 indicates a raid/mythic+ team.
	Type int `json:"type"`
	// The faction of the guild.
	Faction Faction `json:"faction"`
	// The server that the guild belongs to.
	Server Server `json:"server"`
}

Guild includes the GraphQL fields of Guild requested by the fragment Guild. The GraphQL type's documentation follows.

A single guild. Guilds earn their own rankings and contain characters. They may correspond to a guild in-game or be a custom guild created just to hold reports and rankings.

func (*Guild) GetCompetitionMode

func (v *Guild) GetCompetitionMode() bool

GetCompetitionMode returns Guild.CompetitionMode, and is useful for accessing the field via an interface.

func (*Guild) GetDescription

func (v *Guild) GetDescription() string

GetDescription returns Guild.Description, and is useful for accessing the field via an interface.

func (*Guild) GetFaction

func (v *Guild) GetFaction() Faction

GetFaction returns Guild.Faction, and is useful for accessing the field via an interface.

func (*Guild) GetId

func (v *Guild) GetId() int

GetId returns Guild.Id, and is useful for accessing the field via an interface.

func (*Guild) GetName

func (v *Guild) GetName() string

GetName returns Guild.Name, and is useful for accessing the field via an interface.

func (*Guild) GetServer

func (v *Guild) GetServer() Server

GetServer returns Guild.Server, and is useful for accessing the field via an interface.

func (*Guild) GetStealthMode

func (v *Guild) GetStealthMode() bool

GetStealthMode returns Guild.StealthMode, and is useful for accessing the field via an interface.

func (*Guild) GetType

func (v *Guild) GetType() int

GetType returns Guild.Type, and is useful for accessing the field via an interface.

type GuildSummary

type GuildSummary struct {
	// The ID of the guild.
	Id int `json:"id"`
	// The name of the guild.
	Name string `json:"name"`
}

GuildSummary includes the GraphQL fields of Guild requested by the fragment GuildSummary. The GraphQL type's documentation follows.

A single guild. Guilds earn their own rankings and contain characters. They may correspond to a guild in-game or be a custom guild created just to hold reports and rankings.

func (*GuildSummary) GetId

func (v *GuildSummary) GetId() int

GetId returns GuildSummary.Id, and is useful for accessing the field via an interface.

func (*GuildSummary) GetName

func (v *GuildSummary) GetName() string

GetName returns GuildSummary.Name, and is useful for accessing the field via an interface.

type HostilityType

type HostilityType string

Whether or not to fetch information for friendlies or enemies.

const (
	// Fetch information for friendlies.
	HostilityTypeFriendlies HostilityType = "Friendlies"
	// Fetch information for enemies.
	HostilityTypeEnemies HostilityType = "Enemies"
)

type KillType

type KillType string

A filter for kills vs wipes and encounters vs trash.

const (
	// Include trash and encounters.
	KillTypeAll KillType = "All"
	// Only include encounters (kills and wipes).
	KillTypeEncounters KillType = "Encounters"
	// Only include encounters that end in a kill.
	KillTypeKills KillType = "Kills"
	// Only include trash.
	KillTypeTrash KillType = "Trash"
	// Only include encounters that end in a wipe.
	KillTypeWipes KillType = "Wipes"
)

type Location

type Location struct {
	Line   int
	Column int
}

Location is a position in the request document that an error refers to.

type Option

type Option func(*options)

Option configures a Client.

func WithBaseTransport

func WithBaseTransport(rt http.RoundTripper) Option

WithBaseTransport sets the http.RoundTripper beneath the retry and auth layers. Defaults to http.DefaultTransport.

func WithClientCredentials

func WithClientCredentials(id, secret string) Option

WithClientCredentials authenticates using the OAuth 2.0 client-credentials flow against ClientEndpoint.

func WithEndpoint

func WithEndpoint(url string) Option

WithEndpoint overrides the GraphQL endpoint, e.g. UserEndpoint or a region-specific host.

func WithHTTPClient

func WithHTTPClient(hc *http.Client) Option

WithHTTPClient uses a fully preconfigured HTTP client verbatim, including its authentication transport. It supersedes every other auth and transport option, so combining it with one returns ErrConflictingOptions rather than dropping it. WithEndpoint still applies.

func WithLogger

func WithLogger(l *slog.Logger) Option

WithLogger logs retried requests at debug level to l. Request headers are never logged. Nothing is logged by default.

func WithMaxRetries

func WithMaxRetries(n int) Option

WithMaxRetries sets how many times a retryable request (HTTP 429 or 5xx) is retried with exponential backoff. Zero disables retries.

func WithScopes

func WithScopes(scopes ...string) Option

WithScopes sets the OAuth scopes requested by the client-credentials flow.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets the per-request timeout of the underlying HTTP client.

func WithTokenSource

func WithTokenSource(ts oauth2.TokenSource) Option

WithTokenSource authenticates using a caller-provided token source, such as one obtained from the authorization-code or PKCE flow (see OAuthConfig). Pair it with WithEndpoint(UserEndpoint) to access private data.

func WithTokenURL

func WithTokenURL(url string) Option

WithTokenURL overrides the OAuth 2.0 token endpoint used by WithClientCredentials. Defaults to TokenURL.

func WithUserAgent

func WithUserAgent(ua string) Option

WithUserAgent sets the User-Agent header sent with every request.

type PhaseMetadata

type PhaseMetadata struct {
	// Phase ID. 1-indexed
	Id   int    `json:"id"`
	Name string `json:"name"`
	// Whether this phase represents an intermission.
	IsIntermission *bool `json:"isIntermission"`
}

PhaseMetadata includes the GraphQL fields of PhaseMetadata requested by the fragment PhaseMetadata. The GraphQL type's documentation follows.

Information about a phase from a boss encounter.

func (*PhaseMetadata) GetId

func (v *PhaseMetadata) GetId() int

GetId returns PhaseMetadata.Id, and is useful for accessing the field via an interface.

func (*PhaseMetadata) GetIsIntermission

func (v *PhaseMetadata) GetIsIntermission() *bool

GetIsIntermission returns PhaseMetadata.IsIntermission, and is useful for accessing the field via an interface.

func (*PhaseMetadata) GetName

func (v *PhaseMetadata) GetName() string

GetName returns PhaseMetadata.Name, and is useful for accessing the field via an interface.

type PhaseTransition

type PhaseTransition struct {
	// The 1-indexed id of the phase. Phase IDs are absolute within a fight: phases with the same ID correspond to the same semantic phase.
	Id int `json:"id"`
	// The report-relative timestamp of the transition into the phase. The phase ends at the beginning of the next phase, or at the end of the fight.
	StartTime float64 `json:"startTime"`
}

PhaseTransition includes the GraphQL fields of PhaseTransition requested by the fragment PhaseTransition. The GraphQL type's documentation follows.

A spartan representation of phase transitions during a fight.

func (*PhaseTransition) GetId

func (v *PhaseTransition) GetId() int

GetId returns PhaseTransition.Id, and is useful for accessing the field via an interface.

func (*PhaseTransition) GetStartTime

func (v *PhaseTransition) GetStartTime() float64

GetStartTime returns PhaseTransition.StartTime, and is useful for accessing the field via an interface.

type PlayerDetailsParams

type PlayerDetailsParams struct {
	Code                 string
	StartTime            float64
	EndTime              float64
	FightIDs             []int
	EncounterID          int
	Difficulty           int
	KillType             KillType
	IncludeCombatantInfo bool
	Translate            bool
}

PlayerDetailsParams filters the Client.ReportPlayerDetails query. Code is required; other zero fields are omitted.

type RankingCompareType

type RankingCompareType string

Whether or not rankings are compared against best scores for the entire tier or against all parses in a two week window.

const (
	// Compare against rankings.
	RankingCompareTypeRankings RankingCompareType = "Rankings"
	// Compare against all parses in a two week window.
	RankingCompareTypeParses RankingCompareType = "Parses"
)

type RankingTimeframeType

type RankingTimeframeType string

Whether or not rankings are today or historical.

const (
	// Compare against today's rankings.
	RankingTimeframeTypeToday RankingTimeframeType = "Today"
	// Compare against historical rankings.
	RankingTimeframeTypeHistorical RankingTimeframeType = "Historical"
)

type RateLimit

type RateLimit struct {
	// The total amount of points this API key can spend per hour.
	LimitPerHour int `json:"limitPerHour"`
	// The total amount of points spent during this hour.
	PointsSpentThisHour float64 `json:"pointsSpentThisHour"`
	// The number of seconds remaining until the points reset.
	PointsResetIn int `json:"pointsResetIn"`
}

RateLimit includes the GraphQL fields of RateLimitData requested by the fragment RateLimit. The GraphQL type's documentation follows.

A way to obtain your current rate limit usage.

func (*RateLimit) GetLimitPerHour

func (v *RateLimit) GetLimitPerHour() int

GetLimitPerHour returns RateLimit.LimitPerHour, and is useful for accessing the field via an interface.

func (*RateLimit) GetPointsResetIn

func (v *RateLimit) GetPointsResetIn() int

GetPointsResetIn returns RateLimit.PointsResetIn, and is useful for accessing the field via an interface.

func (*RateLimit) GetPointsSpentThisHour

func (v *RateLimit) GetPointsSpentThisHour() float64

GetPointsSpentThisHour returns RateLimit.PointsSpentThisHour, and is useful for accessing the field via an interface.

type Region

type Region struct {
	// The ID of the region.
	Id int `json:"id"`
	// The localized name of the region.
	Name string `json:"name"`
	// The slug for the region, usable when looking up characters and guilds by server.
	Slug string `json:"slug"`
	// The localized compact name of the region, e.g., US for United States.
	CompactName string `json:"compactName"`
	// The subregions found within this region.
	Subregions []RegionSubregionsSubregion `json:"subregions"`
}

Region includes the GraphQL fields of Region requested by the fragment Region. The GraphQL type's documentation follows.

A single region for the game.

func (*Region) GetCompactName

func (v *Region) GetCompactName() string

GetCompactName returns Region.CompactName, and is useful for accessing the field via an interface.

func (*Region) GetId

func (v *Region) GetId() int

GetId returns Region.Id, and is useful for accessing the field via an interface.

func (*Region) GetName

func (v *Region) GetName() string

GetName returns Region.Name, and is useful for accessing the field via an interface.

func (*Region) GetSlug

func (v *Region) GetSlug() string

GetSlug returns Region.Slug, and is useful for accessing the field via an interface.

func (*Region) GetSubregions

func (v *Region) GetSubregions() []RegionSubregionsSubregion

GetSubregions returns Region.Subregions, and is useful for accessing the field via an interface.

type RegionSubregionsSubregion

type RegionSubregionsSubregion struct {
	// The ID of the subregion.
	Id int `json:"id"`
	// The localized name of the subregion.
	Name string `json:"name"`
}

RegionSubregionsSubregion includes the requested fields of the GraphQL type Subregion. The GraphQL type's documentation follows.

A single subregion. Subregions are used to divide a region into sub-categories, such as French or German subregions of a Europe region.

func (*RegionSubregionsSubregion) GetId

func (v *RegionSubregionsSubregion) GetId() int

GetId returns RegionSubregionsSubregion.Id, and is useful for accessing the field via an interface.

func (*RegionSubregionsSubregion) GetName

func (v *RegionSubregionsSubregion) GetName() string

GetName returns RegionSubregionsSubregion.Name, and is useful for accessing the field via an interface.

type RegionSummary

type RegionSummary struct {
	// The ID of the region.
	Id int `json:"id"`
	// The localized name of the region.
	Name string `json:"name"`
	// The slug for the region, usable when looking up characters and guilds by server.
	Slug string `json:"slug"`
	// The localized compact name of the region, e.g., US for United States.
	CompactName string `json:"compactName"`
}

RegionSummary includes the GraphQL fields of Region requested by the fragment RegionSummary. The GraphQL type's documentation follows.

A single region for the game.

func (*RegionSummary) GetCompactName

func (v *RegionSummary) GetCompactName() string

GetCompactName returns RegionSummary.CompactName, and is useful for accessing the field via an interface.

func (*RegionSummary) GetId

func (v *RegionSummary) GetId() int

GetId returns RegionSummary.Id, and is useful for accessing the field via an interface.

func (*RegionSummary) GetName

func (v *RegionSummary) GetName() string

GetName returns RegionSummary.Name, and is useful for accessing the field via an interface.

func (*RegionSummary) GetSlug

func (v *RegionSummary) GetSlug() string

GetSlug returns RegionSummary.Slug, and is useful for accessing the field via an interface.

type Report

type Report struct {
	ReportSummary `json:"-"`
	// The visibility level of the report. The possible values are 'public', 'private', and 'unlisted'.
	Visibility string `json:"visibility"`
	// The revision of the report. This number is increased when reports get re-exported.
	Revision int `json:"revision"`
	// The number of uploaded segments in the report.
	Segments int `json:"segments"`
	// The number of exported segments in the report. This is how many segments have been processed for rankings.
	ExportedSegments int `json:"exportedSegments"`
	// The region of the report.
	Region ReportRegion `json:"region"`
	// Whether this report has been archived. Events, tables, and graphs for archived reports are inaccessible unless the retrieving user has a subscription including archive access.
	ArchiveStatus ReportArchiveStatus `json:"archiveStatus"`
}

Report includes the GraphQL fields of Report requested by the fragment Report. The GraphQL type's documentation follows.

A single report uploaded by a player to a guild or personal logs.

func (*Report) GetArchiveStatus

func (v *Report) GetArchiveStatus() ReportArchiveStatus

GetArchiveStatus returns Report.ArchiveStatus, and is useful for accessing the field via an interface.

func (*Report) GetCode

func (v *Report) GetCode() string

GetCode returns Report.Code, and is useful for accessing the field via an interface.

func (*Report) GetEndTime

func (v *Report) GetEndTime() float64

GetEndTime returns Report.EndTime, and is useful for accessing the field via an interface.

func (*Report) GetExportedSegments

func (v *Report) GetExportedSegments() int

GetExportedSegments returns Report.ExportedSegments, and is useful for accessing the field via an interface.

func (*Report) GetGuild

func (v *Report) GetGuild() GuildSummary

GetGuild returns Report.Guild, and is useful for accessing the field via an interface.

func (*Report) GetOwner

func (v *Report) GetOwner() User

GetOwner returns Report.Owner, and is useful for accessing the field via an interface.

func (*Report) GetRegion

func (v *Report) GetRegion() ReportRegion

GetRegion returns Report.Region, and is useful for accessing the field via an interface.

func (*Report) GetRevision

func (v *Report) GetRevision() int

GetRevision returns Report.Revision, and is useful for accessing the field via an interface.

func (*Report) GetSegments

func (v *Report) GetSegments() int

GetSegments returns Report.Segments, and is useful for accessing the field via an interface.

func (*Report) GetStartTime

func (v *Report) GetStartTime() float64

GetStartTime returns Report.StartTime, and is useful for accessing the field via an interface.

func (*Report) GetTitle

func (v *Report) GetTitle() string

GetTitle returns Report.Title, and is useful for accessing the field via an interface.

func (*Report) GetVisibility

func (v *Report) GetVisibility() string

GetVisibility returns Report.Visibility, and is useful for accessing the field via an interface.

func (*Report) GetZone

func (v *Report) GetZone() ZoneSummary

GetZone returns Report.Zone, and is useful for accessing the field via an interface.

func (*Report) MarshalJSON

func (v *Report) MarshalJSON() ([]byte, error)

func (*Report) UnmarshalJSON

func (v *Report) UnmarshalJSON(b []byte) error

type ReportAbility

type ReportAbility struct {
	// The game ID of the ability.
	GameID float64 `json:"gameID"`
	// An icon to use for the ability.
	Icon string `json:"icon"`
	// The name of the actor.
	Name string `json:"name"`
	// The type of the ability. This represents the type of damage (e.g., the spell school in WoW).
	Type string `json:"type"`
}

ReportAbility includes the GraphQL fields of ReportAbility requested by the fragment ReportAbility. The GraphQL type's documentation follows.

The ReportAbility represents a single ability that occurs in the report.

func (*ReportAbility) GetGameID

func (v *ReportAbility) GetGameID() float64

GetGameID returns ReportAbility.GameID, and is useful for accessing the field via an interface.

func (*ReportAbility) GetIcon

func (v *ReportAbility) GetIcon() string

GetIcon returns ReportAbility.Icon, and is useful for accessing the field via an interface.

func (*ReportAbility) GetName

func (v *ReportAbility) GetName() string

GetName returns ReportAbility.Name, and is useful for accessing the field via an interface.

func (*ReportAbility) GetType

func (v *ReportAbility) GetType() string

GetType returns ReportAbility.Type, and is useful for accessing the field via an interface.

type ReportActor

type ReportActor struct {
	// The game ID of the actor.
	GameID float64 `json:"gameID"`
	// The report ID of the actor. This ID is used in events to identify sources and targets.
	Id int `json:"id"`
	// The name of the actor.
	Name string `json:"name"`
	// The type of the actor, i.e., if it is a player, pet or NPC.
	Type string `json:"type"`
	// The sub-type of the actor, for players it's their class, and for NPCs, they are further subdivided into normal NPCs and bosses.
	SubType string `json:"subType"`
	// An icon to use for the actor. For pets and NPCs, this will be the icon the site chose to represent that actor.
	Icon string `json:"icon"`
	// The report ID of the actor's owner if the actor is a pet.
	PetOwner int `json:"petOwner"`
	// The normalized server name of the actor.
	Server string `json:"server"`
}

ReportActor includes the GraphQL fields of ReportActor requested by the fragment ReportActor. The GraphQL type's documentation follows.

The ReportActor represents a single player, pet or NPC that occurs in the report.

func (*ReportActor) GetGameID

func (v *ReportActor) GetGameID() float64

GetGameID returns ReportActor.GameID, and is useful for accessing the field via an interface.

func (*ReportActor) GetIcon

func (v *ReportActor) GetIcon() string

GetIcon returns ReportActor.Icon, and is useful for accessing the field via an interface.

func (*ReportActor) GetId

func (v *ReportActor) GetId() int

GetId returns ReportActor.Id, and is useful for accessing the field via an interface.

func (*ReportActor) GetName

func (v *ReportActor) GetName() string

GetName returns ReportActor.Name, and is useful for accessing the field via an interface.

func (*ReportActor) GetPetOwner

func (v *ReportActor) GetPetOwner() int

GetPetOwner returns ReportActor.PetOwner, and is useful for accessing the field via an interface.

func (*ReportActor) GetServer

func (v *ReportActor) GetServer() string

GetServer returns ReportActor.Server, and is useful for accessing the field via an interface.

func (*ReportActor) GetSubType

func (v *ReportActor) GetSubType() string

GetSubType returns ReportActor.SubType, and is useful for accessing the field via an interface.

func (*ReportActor) GetType

func (v *ReportActor) GetType() string

GetType returns ReportActor.Type, and is useful for accessing the field via an interface.

type ReportActorsParams

type ReportActorsParams struct {
	Code      string
	Type      string
	SubType   string
	Translate bool
}

ReportActorsParams filters the actors returned by Client.ReportActors. Code is required; other zero fields are omitted from the query. Type selects players, NPCs or pets; SubType selects a player's class or an NPC's classification.

type ReportAnalysisParams

type ReportAnalysisParams struct {
	Code             string
	StartTime        float64
	EndTime          float64
	FightIDs         []int
	EncounterID      int
	Difficulty       int
	KillType         KillType
	HostilityType    HostilityType
	SourceID         int
	TargetID         int
	AbilityID        float64
	FilterExpression string
	ViewBy           ViewType
}

ReportAnalysisParams filters the Client.ReportTable and Client.ReportGraph queries. Code is required; other zero fields are omitted. For arguments not exposed here, use Client.Execute.

type ReportArchiveStatus

type ReportArchiveStatus struct {
	// Whether the report has been archived.
	IsArchived bool `json:"isArchived"`
	// Whether the current user can access the report. Always true if the report is not archived, and always false if not using user authentication.
	IsAccessible bool `json:"isAccessible"`
	// The date on which the report was archived (if it has been archived).
	ArchiveDate int `json:"archiveDate"`
}

ReportArchiveStatus includes the requested fields of the GraphQL type ReportArchiveStatus. The GraphQL type's documentation follows.

The archival status of a report.

func (*ReportArchiveStatus) GetArchiveDate

func (v *ReportArchiveStatus) GetArchiveDate() int

GetArchiveDate returns ReportArchiveStatus.ArchiveDate, and is useful for accessing the field via an interface.

func (*ReportArchiveStatus) GetIsAccessible

func (v *ReportArchiveStatus) GetIsAccessible() bool

GetIsAccessible returns ReportArchiveStatus.IsAccessible, and is useful for accessing the field via an interface.

func (*ReportArchiveStatus) GetIsArchived

func (v *ReportArchiveStatus) GetIsArchived() bool

GetIsArchived returns ReportArchiveStatus.IsArchived, and is useful for accessing the field via an interface.

type ReportEventsParams

type ReportEventsParams struct {
	Code             string
	StartTime        float64
	EndTime          float64
	FightIDs         []int
	EncounterID      int
	Difficulty       int
	KillType         KillType
	HostilityType    HostilityType
	SourceID         int
	TargetID         int
	AbilityID        float64
	FilterExpression string
	IncludeResources bool
	Limit            int
}

ReportEventsParams filters the Client.ReportEvents query. Code is required; other zero fields are omitted.

type ReportFight

type ReportFight struct {
	// The report ID of the fight. This ID can be used to fetch only events, tables or graphs for this fight.
	Id int `json:"id"`
	// The name of the fight.
	Name string `json:"name"`
	// The encounter ID of the fight. If the ID is 0, the fight is considered a trash fight.
	EncounterID int `json:"encounterID"`
	// Some boss fights may be converted to trash fights (encounterID = 0). When this occurs, `originalEncounterID` contains the original ID of the encounter.
	OriginalEncounterID *int `json:"originalEncounterID"`
	// The difficulty setting for the raid, dungeon, or arena. Null for trash.
	Difficulty *int `json:"difficulty"`
	// The group size for the raid, dungeon, or arena. Null for trash.
	Size *int `json:"size"`
	// Whether or not the fight was a boss kill, i.e., successful. If this field is false, it means the fight was a wipe or a failed run, etc..
	Kill *bool `json:"kill"`
	// Whether or not the fight is still in progress. If this field is false, it means the entire fight has been uploaded.
	InProgress *bool `json:"inProgress"`
	// Whether or not a fight represents an entire raid from start to finish, e.g., in Classic WoW a complete run of Blackwing Lair.
	CompleteRaid bool `json:"completeRaid"`
	// The start time of the fight. This is a timestamp with millisecond precision that is relative to the start of the report, i.e., the start of the report is considered time 0.
	StartTime float64 `json:"startTime"`
	// The end time of the fight. This is a timestamp with millisecond precision that is relative to the start of the report, i.e., the start of the report is considered time 0.
	EndTime float64 `json:"endTime"`
	// The actual completion percentage of the fight. This is the field used to indicate how far into a fight a wipe was, since fights can be complicated and have multiple bosses, no bosses, bosses that heal, etc.
	FightPercentage *float64 `json:"fightPercentage"`
	// The percentage health of the active boss or bosses at the end of a fight.
	BossPercentage *float64 `json:"bossPercentage"`
	// The average item level of the players in the fight.
	AverageItemLevel *float64 `json:"averageItemLevel"`
	// The IDs of all players involved in a fight. These players can be referenced in the master data actors table to get detailed information about each participant.
	FriendlyPlayers []int `json:"friendlyPlayers"`
	// The IDs of all players involved in a fight. These players can be referenced in the master data actors table to get detailed information about each participant.
	EnemyPlayers []int `json:"enemyPlayers"`
	// The keystone level for a Mythic+ dungeon.
	KeystoneLevel *int `json:"keystoneLevel"`
	// The completion time for a Challenge Mode or Mythic+ Dungeon. This is the official time used on Blizzard leaderboards.
	KeystoneTime *int `json:"keystoneTime"`
	// The bonus field represents Bronze, Silver or Gold in Challenge Modes, or +1-+3 pushing of Mythic+ keys. It has the values 1, 2, and 3.
	KeystoneBonus *int `json:"keystoneBonus"`
	// The affixes for a Mythic+ dungeon.
	KeystoneAffixes []int `json:"keystoneAffixes"`
	// The hard mode level of the fight. Most fights don't support optional hard modes. This only applies to bosses like Sartharion.
	HardModeLevel *int `json:"hardModeLevel"`
	// The phase that the encounter was in when the fight ended. Counts up from 1 based off the phase type (i.e., normal phase vs intermission).
	LastPhase *int `json:"lastPhase"`
	// The phase that the encounter was in when the fight ended. Always increases from 0, so a fight with three real phases and two intermissions would count up from 0 to 4.
	LastPhaseAsAbsoluteIndex *int `json:"lastPhaseAsAbsoluteIndex"`
	// Whether or not the phase that the encounter was in when the fight ended was an intermission or not.
	LastPhaseIsIntermission *bool `json:"lastPhaseIsIntermission"`
	// List of observed phase transitions during the fight.
	PhaseTransitions []PhaseTransition `json:"phaseTransitions"`
	// The game zone the fight takes place in. This should not be confused with the zones used by the sites for rankings. This is the actual in-game zone info.
	GameZone GameZoneSummary `json:"gameZone"`
}

Nullable fields are generated as pointers so callers can tell absent from the zero value: on a trash fight kill, difficulty and size are all null.

func (*ReportFight) GetAverageItemLevel

func (v *ReportFight) GetAverageItemLevel() *float64

GetAverageItemLevel returns ReportFight.AverageItemLevel, and is useful for accessing the field via an interface.

func (*ReportFight) GetBossPercentage

func (v *ReportFight) GetBossPercentage() *float64

GetBossPercentage returns ReportFight.BossPercentage, and is useful for accessing the field via an interface.

func (*ReportFight) GetCompleteRaid

func (v *ReportFight) GetCompleteRaid() bool

GetCompleteRaid returns ReportFight.CompleteRaid, and is useful for accessing the field via an interface.

func (*ReportFight) GetDifficulty

func (v *ReportFight) GetDifficulty() *int

GetDifficulty returns ReportFight.Difficulty, and is useful for accessing the field via an interface.

func (*ReportFight) GetEncounterID

func (v *ReportFight) GetEncounterID() int

GetEncounterID returns ReportFight.EncounterID, and is useful for accessing the field via an interface.

func (*ReportFight) GetEndTime

func (v *ReportFight) GetEndTime() float64

GetEndTime returns ReportFight.EndTime, and is useful for accessing the field via an interface.

func (*ReportFight) GetEnemyPlayers

func (v *ReportFight) GetEnemyPlayers() []int

GetEnemyPlayers returns ReportFight.EnemyPlayers, and is useful for accessing the field via an interface.

func (*ReportFight) GetFightPercentage

func (v *ReportFight) GetFightPercentage() *float64

GetFightPercentage returns ReportFight.FightPercentage, and is useful for accessing the field via an interface.

func (*ReportFight) GetFriendlyPlayers

func (v *ReportFight) GetFriendlyPlayers() []int

GetFriendlyPlayers returns ReportFight.FriendlyPlayers, and is useful for accessing the field via an interface.

func (*ReportFight) GetGameZone

func (v *ReportFight) GetGameZone() GameZoneSummary

GetGameZone returns ReportFight.GameZone, and is useful for accessing the field via an interface.

func (*ReportFight) GetHardModeLevel

func (v *ReportFight) GetHardModeLevel() *int

GetHardModeLevel returns ReportFight.HardModeLevel, and is useful for accessing the field via an interface.

func (*ReportFight) GetId

func (v *ReportFight) GetId() int

GetId returns ReportFight.Id, and is useful for accessing the field via an interface.

func (*ReportFight) GetInProgress

func (v *ReportFight) GetInProgress() *bool

GetInProgress returns ReportFight.InProgress, and is useful for accessing the field via an interface.

func (*ReportFight) GetKeystoneAffixes

func (v *ReportFight) GetKeystoneAffixes() []int

GetKeystoneAffixes returns ReportFight.KeystoneAffixes, and is useful for accessing the field via an interface.

func (*ReportFight) GetKeystoneBonus

func (v *ReportFight) GetKeystoneBonus() *int

GetKeystoneBonus returns ReportFight.KeystoneBonus, and is useful for accessing the field via an interface.

func (*ReportFight) GetKeystoneLevel

func (v *ReportFight) GetKeystoneLevel() *int

GetKeystoneLevel returns ReportFight.KeystoneLevel, and is useful for accessing the field via an interface.

func (*ReportFight) GetKeystoneTime

func (v *ReportFight) GetKeystoneTime() *int

GetKeystoneTime returns ReportFight.KeystoneTime, and is useful for accessing the field via an interface.

func (*ReportFight) GetKill

func (v *ReportFight) GetKill() *bool

GetKill returns ReportFight.Kill, and is useful for accessing the field via an interface.

func (*ReportFight) GetLastPhase

func (v *ReportFight) GetLastPhase() *int

GetLastPhase returns ReportFight.LastPhase, and is useful for accessing the field via an interface.

func (*ReportFight) GetLastPhaseAsAbsoluteIndex

func (v *ReportFight) GetLastPhaseAsAbsoluteIndex() *int

GetLastPhaseAsAbsoluteIndex returns ReportFight.LastPhaseAsAbsoluteIndex, and is useful for accessing the field via an interface.

func (*ReportFight) GetLastPhaseIsIntermission

func (v *ReportFight) GetLastPhaseIsIntermission() *bool

GetLastPhaseIsIntermission returns ReportFight.LastPhaseIsIntermission, and is useful for accessing the field via an interface.

func (*ReportFight) GetName

func (v *ReportFight) GetName() string

GetName returns ReportFight.Name, and is useful for accessing the field via an interface.

func (*ReportFight) GetOriginalEncounterID

func (v *ReportFight) GetOriginalEncounterID() *int

GetOriginalEncounterID returns ReportFight.OriginalEncounterID, and is useful for accessing the field via an interface.

func (*ReportFight) GetPhaseTransitions

func (v *ReportFight) GetPhaseTransitions() []PhaseTransition

GetPhaseTransitions returns ReportFight.PhaseTransitions, and is useful for accessing the field via an interface.

func (*ReportFight) GetSize

func (v *ReportFight) GetSize() *int

GetSize returns ReportFight.Size, and is useful for accessing the field via an interface.

func (*ReportFight) GetStartTime

func (v *ReportFight) GetStartTime() float64

GetStartTime returns ReportFight.StartTime, and is useful for accessing the field via an interface.

func (*ReportFight) PhaseAt

func (f *ReportFight) PhaseAt(t float64) (PhaseTransition, bool)

PhaseAt returns the phase the fight was in at report-relative timestamp t, and whether one was found. It reports false for a timestamp before the first transition, and for fights with no phase data. Join PhaseTransition.Id against ReportWithFights.PhasesFor to resolve the name.

Prefer this to ReportFight.LastPhase, which numbers normal phases and intermissions separately and so only resolves alongside LastPhaseIsIntermission. A fight may also re-enter a phase it has already been in.

type ReportMasterData

type ReportMasterData struct {
	// The version of the client parser that was used to parse and upload this log file.
	LogVersion int `json:"logVersion"`
	// The version of the game that generated the log file. Used to distinguish Classic and Retail Warcraft primarily.
	GameVersion int `json:"gameVersion"`
	// The auto-detected locale of the report. This is the source language of the original log file.
	Lang string `json:"lang"`
	// A list of every ability that occurs in the report.
	Abilities []ReportAbility `json:"abilities"`
	// A list of every actor (player, NPC, pet) that occurs in the report.
	Actors []ReportActor `json:"actors"`
}

ReportMasterData includes the GraphQL fields of ReportMasterData requested by the fragment ReportMasterData. The GraphQL type's documentation follows.

The ReporMastertData object contains information about the log version of a report, as well as the actors and abilities used in the report.

func (*ReportMasterData) GetAbilities

func (v *ReportMasterData) GetAbilities() []ReportAbility

GetAbilities returns ReportMasterData.Abilities, and is useful for accessing the field via an interface.

func (*ReportMasterData) GetActors

func (v *ReportMasterData) GetActors() []ReportActor

GetActors returns ReportMasterData.Actors, and is useful for accessing the field via an interface.

func (*ReportMasterData) GetGameVersion

func (v *ReportMasterData) GetGameVersion() int

GetGameVersion returns ReportMasterData.GameVersion, and is useful for accessing the field via an interface.

func (*ReportMasterData) GetLang

func (v *ReportMasterData) GetLang() string

GetLang returns ReportMasterData.Lang, and is useful for accessing the field via an interface.

func (*ReportMasterData) GetLogVersion

func (v *ReportMasterData) GetLogVersion() int

GetLogVersion returns ReportMasterData.LogVersion, and is useful for accessing the field via an interface.

type ReportPage

type ReportPage struct {
	// Number of total items selected by the query
	Total int `json:"total"`
	// Number of items returned per page
	PerPage int `json:"perPage"`
	// Current page of the cursor
	CurrentPage int `json:"currentPage"`
	// The last page (number of pages)
	LastPage int `json:"lastPage"`
	// Determines if cursor has more pages after the current page
	HasMorePages bool `json:"hasMorePages"`
	// Number of the first item returned
	From int `json:"from"`
	// Number of the last item returned
	To int `json:"to"`
	// List of items on the current page
	Data []ReportSummary `json:"data"`
}

Aliased because the schema spells these snake_case, which would otherwise generate Go fields like Per_page.

func (*ReportPage) GetCurrentPage

func (v *ReportPage) GetCurrentPage() int

GetCurrentPage returns ReportPage.CurrentPage, and is useful for accessing the field via an interface.

func (*ReportPage) GetData

func (v *ReportPage) GetData() []ReportSummary

GetData returns ReportPage.Data, and is useful for accessing the field via an interface.

func (*ReportPage) GetFrom

func (v *ReportPage) GetFrom() int

GetFrom returns ReportPage.From, and is useful for accessing the field via an interface.

func (*ReportPage) GetHasMorePages

func (v *ReportPage) GetHasMorePages() bool

GetHasMorePages returns ReportPage.HasMorePages, and is useful for accessing the field via an interface.

func (*ReportPage) GetLastPage

func (v *ReportPage) GetLastPage() int

GetLastPage returns ReportPage.LastPage, and is useful for accessing the field via an interface.

func (*ReportPage) GetPerPage

func (v *ReportPage) GetPerPage() int

GetPerPage returns ReportPage.PerPage, and is useful for accessing the field via an interface.

func (*ReportPage) GetTo

func (v *ReportPage) GetTo() int

GetTo returns ReportPage.To, and is useful for accessing the field via an interface.

func (*ReportPage) GetTotal

func (v *ReportPage) GetTotal() int

GetTotal returns ReportPage.Total, and is useful for accessing the field via an interface.

type ReportRankingMetricType

type ReportRankingMetricType string

All the possible metrics.

const (
	// Boss cDPS is unique to FFXIV and is damage done to the boss adjusted for raid-contributing buffs and debuffs.
	ReportRankingMetricTypeBosscdps ReportRankingMetricType = "bosscdps"
	// Boss damage per second.
	ReportRankingMetricTypeBossdps ReportRankingMetricType = "bossdps"
	// Boss nDPS is unique to FFXIV and is damage done to the boss adjusted for raid-contributing buffs and debuffs.
	ReportRankingMetricTypeBossndps ReportRankingMetricType = "bossndps"
	// Boss rDPS is unique to FFXIV and is damage done to the boss adjusted for raid-contributing buffs and debuffs.
	ReportRankingMetricTypeBossrdps ReportRankingMetricType = "bossrdps"
	// Choose an appropriate default depending on the other selected parameters.
	ReportRankingMetricTypeDefault ReportRankingMetricType = "default"
	// Damage per second.
	ReportRankingMetricTypeDps ReportRankingMetricType = "dps"
	// Healing per second.
	ReportRankingMetricTypeHps ReportRankingMetricType = "hps"
	// Survivability ranking for tanks. Deprecated. Only supported for some older WoW zones.
	ReportRankingMetricTypeKrsi ReportRankingMetricType = "krsi"
	// Score. Used by WoW Mythic dungeons and by ESO trials.
	ReportRankingMetricTypePlayerscore ReportRankingMetricType = "playerscore"
	// Speed. Not supported by every zone.
	ReportRankingMetricTypePlayerspeed ReportRankingMetricType = "playerspeed"
	// cDPS is unique to FFXIV and is damage done adjusted for raid-contributing buffs and debuffs.
	ReportRankingMetricTypeCdps ReportRankingMetricType = "cdps"
	// nDPS is unique to FFXIV and is damage done adjusted for raid-contributing buffs and debuffs.
	ReportRankingMetricTypeNdps ReportRankingMetricType = "ndps"
	// rDPS is unique to FFXIV and is damage done adjusted for raid-contributing buffs and debuffs.
	ReportRankingMetricTypeRdps ReportRankingMetricType = "rdps"
	// Healing done per second to tanks.
	ReportRankingMetricTypeTankhps ReportRankingMetricType = "tankhps"
	// Weighted damage per second. Unique to WoW currently. Used to remove pad damage and reward damage done to high priority targets.
	ReportRankingMetricTypeWdps ReportRankingMetricType = "wdps"
)

type ReportRankingsParams

type ReportRankingsParams struct {
	Code         string
	EncounterID  int
	Difficulty   int
	FightIDs     []int
	PlayerMetric ReportRankingMetricType
	Compare      RankingCompareType
	Timeframe    RankingTimeframeType
}

ReportRankingsParams filters the Client.ReportRankings query. Code is required; other zero fields are omitted.

type ReportRegion

type ReportRegion struct {
	// The ID of the region.
	Id int `json:"id"`
	// The localized name of the region.
	Name string `json:"name"`
}

ReportRegion includes the requested fields of the GraphQL type Region. The GraphQL type's documentation follows.

A single region for the game.

func (*ReportRegion) GetId

func (v *ReportRegion) GetId() int

GetId returns ReportRegion.Id, and is useful for accessing the field via an interface.

func (*ReportRegion) GetName

func (v *ReportRegion) GetName() string

GetName returns ReportRegion.Name, and is useful for accessing the field via an interface.

type ReportSummary

type ReportSummary struct {
	// The report code, a unique value used to identify the report.
	Code string `json:"code"`
	// A title for the report.
	Title string `json:"title"`
	// The start time of the report. This is a UNIX timestamp representing the timestamp of the first event contained in the report.
	StartTime float64 `json:"startTime"`
	// The end time of the report. This is a UNIX timestamp representing the timestamp of the last event contained in the report.
	EndTime float64 `json:"endTime"`
	// The principal zone that the report contains fights for. Null if no supported zone exists.
	Zone ZoneSummary `json:"zone"`
	// The guild that the report belongs to. If this is null, then the report was uploaded to the user's personal logs.
	Guild GuildSummary `json:"guild"`
	// The user that uploaded the report.
	Owner User `json:"owner"`
}

The fields a listing needs. Spread this rather than Report where the selection is repeated per row.

func (*ReportSummary) GetCode

func (v *ReportSummary) GetCode() string

GetCode returns ReportSummary.Code, and is useful for accessing the field via an interface.

func (*ReportSummary) GetEndTime

func (v *ReportSummary) GetEndTime() float64

GetEndTime returns ReportSummary.EndTime, and is useful for accessing the field via an interface.

func (*ReportSummary) GetGuild

func (v *ReportSummary) GetGuild() GuildSummary

GetGuild returns ReportSummary.Guild, and is useful for accessing the field via an interface.

func (*ReportSummary) GetOwner

func (v *ReportSummary) GetOwner() User

GetOwner returns ReportSummary.Owner, and is useful for accessing the field via an interface.

func (*ReportSummary) GetStartTime

func (v *ReportSummary) GetStartTime() float64

GetStartTime returns ReportSummary.StartTime, and is useful for accessing the field via an interface.

func (*ReportSummary) GetTitle

func (v *ReportSummary) GetTitle() string

GetTitle returns ReportSummary.Title, and is useful for accessing the field via an interface.

func (*ReportSummary) GetZone

func (v *ReportSummary) GetZone() ZoneSummary

GetZone returns ReportSummary.Zone, and is useful for accessing the field via an interface.

type ReportWithFights

type ReportWithFights struct {
	Report
	Fights []ReportFight
	Phases []EncounterPhases
}

ReportWithFights is a report header together with its fights and the phase metadata of every boss encounter the report observed.

func (*ReportWithFights) PhasesFor

func (r *ReportWithFights) PhasesFor(encounterID int) []PhaseMetadata

PhasesFor returns the phase metadata for an encounter, or nil if the report carries none. PhaseMetadata.Id lines up with PhaseTransition.Id.

type ReportWithFightsParams

type ReportWithFightsParams struct {
	Code          string
	AllowUnlisted bool
	EncounterID   int
	Difficulty    int
	KillType      KillType
	FightIDs      []int
	Translate     bool
}

ReportWithFightsParams filters the fights returned by Client.ReportWithFights. Code is required; other zero fields are omitted from the query.

type ReportsParams

type ReportsParams struct {
	GuildID           int
	GuildName         string
	GuildServerSlug   string
	GuildServerRegion string
	GuildTagID        int
	UserID            int
	ZoneID            int
	GameZoneID        int
	StartTime         float64
	EndTime           float64
	Limit             int
	Page              int
}

ReportsParams selects the reports returned by Client.Reports. Zero fields are omitted from the query. Identify a guild either by GuildID or by the GuildName, GuildServerSlug and GuildServerRegion trio; GuildTagID takes precedence over both. UserID lists a user's personal logs instead.

type RoleType

type RoleType string

Used to specify a tank, healer or DPS role.

const (
	// Fetch any role..
	RoleTypeAny RoleType = "Any"
	// Fetch the DPS role only.
	RoleTypeDPS RoleType = "DPS"
	// Fetch the healer role only.
	RoleTypeHealer RoleType = "Healer"
	// Fetch the tanking role only.
	RoleTypeTank RoleType = "Tank"
)

type Server

type Server struct {
	// The ID of the server.
	Id int `json:"id"`
	// The name of the server in the locale of the subregion that the server belongs to.
	Name string `json:"name"`
	// The normalized name is a transformation of the name, dropping spaces. It is how the server appears in a World of Warcraft log file.
	NormalizedName string `json:"normalizedName"`
	// The server slug, also a transformation of the name following Blizzard rules. For retail World of Warcraft realms, this slug will be in English. For all other games, the slug is just a transformation of the name field.
	Slug string `json:"slug"`
	// The Blizzard ID of the server.
	BlizzardID int `json:"blizzardID"`
	// The connected realm ID of the server.
	ConnectedRealmID int `json:"connectedRealmID"`
	// The region that this server belongs to.
	Region RegionSummary `json:"region"`
}

Server includes the GraphQL fields of Server requested by the fragment Server. The GraphQL type's documentation follows.

A single server. Servers correspond to actual game servers that characters and guilds reside on.

func (*Server) GetBlizzardID

func (v *Server) GetBlizzardID() int

GetBlizzardID returns Server.BlizzardID, and is useful for accessing the field via an interface.

func (*Server) GetConnectedRealmID

func (v *Server) GetConnectedRealmID() int

GetConnectedRealmID returns Server.ConnectedRealmID, and is useful for accessing the field via an interface.

func (*Server) GetId

func (v *Server) GetId() int

GetId returns Server.Id, and is useful for accessing the field via an interface.

func (*Server) GetName

func (v *Server) GetName() string

GetName returns Server.Name, and is useful for accessing the field via an interface.

func (*Server) GetNormalizedName

func (v *Server) GetNormalizedName() string

GetNormalizedName returns Server.NormalizedName, and is useful for accessing the field via an interface.

func (*Server) GetRegion

func (v *Server) GetRegion() RegionSummary

GetRegion returns Server.Region, and is useful for accessing the field via an interface.

func (*Server) GetSlug

func (v *Server) GetSlug() string

GetSlug returns Server.Slug, and is useful for accessing the field via an interface.

type TableDataType

type TableDataType string

The type of table to examine.

const (
	// Summary Overview
	TableDataTypeSummary TableDataType = "Summary"
	// Buffs.
	TableDataTypeBuffs TableDataType = "Buffs"
	// Casts.
	TableDataTypeCasts TableDataType = "Casts"
	// Damage done.
	TableDataTypeDamageDone TableDataType = "DamageDone"
	// Damage taken.
	TableDataTypeDamageTaken TableDataType = "DamageTaken"
	// Deaths.
	TableDataTypeDeaths TableDataType = "Deaths"
	// Debuffs.
	TableDataTypeDebuffs TableDataType = "Debuffs"
	// Dispels.
	TableDataTypeDispels TableDataType = "Dispels"
	// Healing done.
	TableDataTypeHealing TableDataType = "Healing"
	// Interrupts.
	TableDataTypeInterrupts TableDataType = "Interrupts"
	// Resources.
	TableDataTypeResources TableDataType = "Resources"
	// Summons
	TableDataTypeSummons TableDataType = "Summons"
	// Survivability (death info across multiple pulls).
	TableDataTypeSurvivability TableDataType = "Survivability"
	// Threat.
	TableDataTypeThreat TableDataType = "Threat"
)

type User

type User struct {
	// The ID of the user.
	Id int `json:"id"`
	// The name of the user.
	Name string `json:"name"`
}

User includes the GraphQL fields of User requested by the fragment User. The GraphQL type's documentation follows.

A single user of the site. Most fields can only be accessed when authenticated as that user with the "view-user-profile" scope.

func (*User) GetId

func (v *User) GetId() int

GetId returns User.Id, and is useful for accessing the field via an interface.

func (*User) GetName

func (v *User) GetName() string

GetName returns User.Name, and is useful for accessing the field via an interface.

type ViewType

type ViewType string

Whether the view is by source, target, or ability.

const (
	// Use the same default that the web site picks based off the other selected parameters.
	ViewTypeDefault ViewType = "Default"
	// View by ability.
	ViewTypeAbility ViewType = "Ability"
	// View. by source.
	ViewTypeSource ViewType = "Source"
	// View by target.
	ViewTypeTarget ViewType = "Target"
)

type Zone

type Zone struct {
	// The ID of the zone.
	Id int `json:"id"`
	// The name of the zone.
	Name string `json:"name"`
	// Whether or not the entire zone (including all its partitions) is permanently frozen. When a zone is frozen, data involving that zone will never change and can be cached forever.
	Frozen bool `json:"frozen"`
	// The expansion that this zone belongs to.
	Expansion ExpansionSummary `json:"expansion"`
	// A list of all the difficulties supported for this zone.
	Difficulties []ZoneDifficultiesDifficulty `json:"difficulties"`
	// The encounters found within this zone.
	Encounters []ZoneEncountersEncounter `json:"encounters"`
	// A list of all the partitions supported for this zone.
	Partitions []ZonePartitionsPartition `json:"partitions"`
	// The bracket information for this zone. This field will be null if the zone does not support brackets.
	Brackets ZoneBracketsBracket `json:"brackets"`
}

Zone includes the GraphQL fields of Zone requested by the fragment Zone. The GraphQL type's documentation follows.

A single zone from an expansion that represents a raid, dungeon, arena, etc.

func (*Zone) GetBrackets

func (v *Zone) GetBrackets() ZoneBracketsBracket

GetBrackets returns Zone.Brackets, and is useful for accessing the field via an interface.

func (*Zone) GetDifficulties

func (v *Zone) GetDifficulties() []ZoneDifficultiesDifficulty

GetDifficulties returns Zone.Difficulties, and is useful for accessing the field via an interface.

func (*Zone) GetEncounters

func (v *Zone) GetEncounters() []ZoneEncountersEncounter

GetEncounters returns Zone.Encounters, and is useful for accessing the field via an interface.

func (*Zone) GetExpansion

func (v *Zone) GetExpansion() ExpansionSummary

GetExpansion returns Zone.Expansion, and is useful for accessing the field via an interface.

func (*Zone) GetFrozen

func (v *Zone) GetFrozen() bool

GetFrozen returns Zone.Frozen, and is useful for accessing the field via an interface.

func (*Zone) GetId

func (v *Zone) GetId() int

GetId returns Zone.Id, and is useful for accessing the field via an interface.

func (*Zone) GetName

func (v *Zone) GetName() string

GetName returns Zone.Name, and is useful for accessing the field via an interface.

func (*Zone) GetPartitions

func (v *Zone) GetPartitions() []ZonePartitionsPartition

GetPartitions returns Zone.Partitions, and is useful for accessing the field via an interface.

type ZoneBracketsBracket

type ZoneBracketsBracket struct {
	// An integer representing the minimum value used by bracket number 1, etc.
	Min float64 `json:"min"`
	// An integer representing the value used by bracket N when there are a total of N brackets, etc.
	Max float64 `json:"max"`
	// A float representing the value to increment when moving from bracket 1 to bracket N, etc.
	Bucket float64 `json:"bucket"`
	// The localized name of the bracket type.
	Type string `json:"type"`
}

ZoneBracketsBracket includes the requested fields of the GraphQL type Bracket. The GraphQL type's documentation follows.

A bracket description for a given raid zone. Brackets have a minimum value, maximum value, and a bucket that can be used to establish all of the possible brackets. The type field indicates what the brackets represent, e.g., item levels or game patches, etc.

func (*ZoneBracketsBracket) GetBucket

func (v *ZoneBracketsBracket) GetBucket() float64

GetBucket returns ZoneBracketsBracket.Bucket, and is useful for accessing the field via an interface.

func (*ZoneBracketsBracket) GetMax

func (v *ZoneBracketsBracket) GetMax() float64

GetMax returns ZoneBracketsBracket.Max, and is useful for accessing the field via an interface.

func (*ZoneBracketsBracket) GetMin

func (v *ZoneBracketsBracket) GetMin() float64

GetMin returns ZoneBracketsBracket.Min, and is useful for accessing the field via an interface.

func (*ZoneBracketsBracket) GetType

func (v *ZoneBracketsBracket) GetType() string

GetType returns ZoneBracketsBracket.Type, and is useful for accessing the field via an interface.

type ZoneDifficultiesDifficulty

type ZoneDifficultiesDifficulty struct {
	// An integer representing a specific difficulty level within a zone. For example, in World of Warcraft, this could be Mythic. In FF, it could be Savage, etc.
	Id int `json:"id"`
	// The localized name for the difficulty level.
	Name string `json:"name"`
	// A list of supported sizes for the difficulty level. An empty result means that the difficulty level has a flexible raid size.
	Sizes []int `json:"sizes"`
}

ZoneDifficultiesDifficulty includes the requested fields of the GraphQL type Difficulty. The GraphQL type's documentation follows.

A single difficulty for a given raid zone. Difficulties have an integer value representing the actual difficulty, a localized name that describes the difficulty level, and a list of valid sizes for the difficulty level.

func (*ZoneDifficultiesDifficulty) GetId

func (v *ZoneDifficultiesDifficulty) GetId() int

GetId returns ZoneDifficultiesDifficulty.Id, and is useful for accessing the field via an interface.

func (*ZoneDifficultiesDifficulty) GetName

func (v *ZoneDifficultiesDifficulty) GetName() string

GetName returns ZoneDifficultiesDifficulty.Name, and is useful for accessing the field via an interface.

func (*ZoneDifficultiesDifficulty) GetSizes

func (v *ZoneDifficultiesDifficulty) GetSizes() []int

GetSizes returns ZoneDifficultiesDifficulty.Sizes, and is useful for accessing the field via an interface.

type ZoneEncountersEncounter

type ZoneEncountersEncounter struct {
	// The ID of the encounter.
	Id int `json:"id"`
	// The localized name of the encounter.
	Name string `json:"name"`
}

ZoneEncountersEncounter includes the requested fields of the GraphQL type Encounter. The GraphQL type's documentation follows.

A single encounter for the game.

func (*ZoneEncountersEncounter) GetId

func (v *ZoneEncountersEncounter) GetId() int

GetId returns ZoneEncountersEncounter.Id, and is useful for accessing the field via an interface.

func (*ZoneEncountersEncounter) GetName

func (v *ZoneEncountersEncounter) GetName() string

GetName returns ZoneEncountersEncounter.Name, and is useful for accessing the field via an interface.

type ZonePartitionsPartition

type ZonePartitionsPartition struct {
	// An integer representing a specific partition within a zone.
	Id int `json:"id"`
	// The localized name for partition.
	Name string `json:"name"`
	// The compact localized name for the partition. Typically an abbreviation to conserve space.
	CompactName string `json:"compactName"`
	// Whether or not the partition is the current default when viewing rankings or statistics for the zone.
	Default bool `json:"default"`
}

ZonePartitionsPartition includes the requested fields of the GraphQL type Partition. The GraphQL type's documentation follows.

A single partition for a given raid zone. Partitions have an integer value representing the actual partition and a localized name that describes what the partition represents. Partitions contain their own rankings, statistics and all stars.

func (*ZonePartitionsPartition) GetCompactName

func (v *ZonePartitionsPartition) GetCompactName() string

GetCompactName returns ZonePartitionsPartition.CompactName, and is useful for accessing the field via an interface.

func (*ZonePartitionsPartition) GetDefault

func (v *ZonePartitionsPartition) GetDefault() bool

GetDefault returns ZonePartitionsPartition.Default, and is useful for accessing the field via an interface.

func (*ZonePartitionsPartition) GetId

func (v *ZonePartitionsPartition) GetId() int

GetId returns ZonePartitionsPartition.Id, and is useful for accessing the field via an interface.

func (*ZonePartitionsPartition) GetName

func (v *ZonePartitionsPartition) GetName() string

GetName returns ZonePartitionsPartition.Name, and is useful for accessing the field via an interface.

type ZoneRankingsParams

type ZoneRankingsParams struct {
	Character          CharacterRef
	ZoneID             int
	Metric             CharacterPageRankingMetricType
	Difficulty         int
	Partition          int
	Role               RoleType
	Size               int
	ClassName          string
	SpecName           string
	ByBracket          bool
	Timeframe          RankingTimeframeType
	Compare            RankingCompareType
	IncludePrivateLogs bool
}

ZoneRankingsParams filters character zone rankings. Zero fields are omitted.

type ZoneSummary

type ZoneSummary struct {
	// The ID of the zone.
	Id int `json:"id"`
	// The name of the zone.
	Name string `json:"name"`
}

ZoneSummary includes the GraphQL fields of Zone requested by the fragment ZoneSummary. The GraphQL type's documentation follows.

A single zone from an expansion that represents a raid, dungeon, arena, etc.

func (*ZoneSummary) GetId

func (v *ZoneSummary) GetId() int

GetId returns ZoneSummary.Id, and is useful for accessing the field via an interface.

func (*ZoneSummary) GetName

func (v *ZoneSummary) GetName() string

GetName returns ZoneSummary.Name, and is useful for accessing the field via an interface.

Directories

Path Synopsis
examples
analysis command
Command analysis walks a single report end to end: metadata, a fight summary, the damage breakdown of the last boss kill, and the deaths of the costliest pull.
Command analysis walks a single report end to end: metadata, a fight summary, the damage breakdown of the last boss kill, and the deaths of the costliest pull.
basic command
userauth command
Command userauth runs the OAuth 2.0 authorization-code flow with PKCE and calls an endpoint that only works with user authentication.
Command userauth runs the OAuth 2.0 authorization-code flow with PKCE and calls an endpoint that only works with user authentication.

Jump to

Keyboard shortcuts

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