eqldb

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientID       = "eql-log-parser"
	DefaultBaseURL = "https://eqldb.org"
)

Variables

View Source
var ManualRaces = []string{
	"Human",
	"Barbarian",
	"Erudite",
	"Wood Elf",
	"High Elf",
	"Dark Elf",
	"Half Elf",
	"Dwarf",
	"Troll",
	"Ogre",
	"Halfling",
	"Gnome",
	"Iksar",
	"Froglok",
	"Kerran",
}

ManualRaces mirrors the EQLDB playable-race catalogue. Automatically parsed /who races are intentionally not restricted to this list: unknown races and illusions must still reach the server for classification.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Status      int
	Code        string
	Description string
	RetryAfter  time.Duration
}

func (*APIError) Error

func (e *APIError) Error() string

type Client

type Client struct {
	BaseURL string
	HTTP    *http.Client
}

func NewClient

func NewClient() *Client

func (*Client) StartConnection

func (c *Client) StartConnection(ctx context.Context, deviceName string) (DeviceAuthorization, error)

func (*Client) UploadInventory

func (c *Client) UploadInventory(ctx context.Context, accessToken, inventoryPath string, metadata UploadMetadata) (UploadResult, error)

func (*Client) WaitForToken

func (c *Client) WaitForToken(ctx context.Context, authorization DeviceAuthorization) (Token, error)

type DeviceAuthorization

type DeviceAuthorization struct {
	DeviceCode              string
	UserCode                string
	VerificationURI         string
	VerificationURIComplete string
	ExpiresAt               time.Time
	Interval                time.Duration
}

type State

type State struct {
	IntroductionShown bool   `json:"introduction_shown,omitempty"`
	AccessToken       string `json:"access_token,omitempty"`
	ConnectionID      string `json:"connection_id,omitempty"`
}

type Store

type Store struct {
	Path string
}

func DefaultStore

func DefaultStore() (Store, error)

func (Store) AcquireUploadLease

func (s Store) AcquireUploadLease(now time.Time, duration time.Duration) (bool, time.Duration, error)

func (Store) Load

func (s Store) Load() (State, error)

func (Store) Save

func (s Store) Save(state State) error

type Token

type Token struct {
	AccessToken  string
	TokenType    string
	Scope        string
	ConnectionID string
}

type UploadMetadata

type UploadMetadata struct {
	Level   int
	Classes []string
	Race    string
}

type UploadResult

type UploadResult struct {
	Status     string `json:"status"`
	Character  string `json:"character"`
	Server     string `json:"server"`
	ProfileURL string `json:"profile_url"`
	Message    string `json:"message"`
}

Jump to

Keyboard shortcuts

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