eqldb

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

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

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) SubmitDropObservations added in v0.2.2

func (c *Client) SubmitDropObservations(ctx context.Context, accessToken string, events []DropObservation) error

func (*Client) SubmitKillObservations added in v0.2.2

func (c *Client) SubmitKillObservations(ctx context.Context, accessToken string, events []KillObservation) error

func (*Client) SubmitPlaneOfSkyEvents added in v0.2.2

func (c *Client) SubmitPlaneOfSkyEvents(ctx context.Context, accessToken, character, server string, events []PlaneOfSkyEvent) 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 DropObservation added in v0.2.2

type DropObservation struct {
	Timestamp string `json:"timestamp"`
	Zone      string `json:"zone"`
	Mob       string `json:"mob"`
	Item      string `json:"item"`
	Amount    int    `json:"amount"`
}

type KillObservation added in v0.2.2

type KillObservation struct {
	Timestamp string `json:"timestamp"`
	Zone      string `json:"zone"`
	Mob       string `json:"mob"`
}

type PlaneOfSkyEvent added in v0.2.2

type PlaneOfSkyEvent struct {
	Type      string `json:"type"`
	Rune      string `json:"rune,omitempty"`
	Amount    int    `json:"amount,omitempty"`
	Quest     string `json:"quest,omitempty"`
	Timestamp string `json:"timestamp"`
}

type State

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

func (State) HasScope added in v0.2.2

func (s State) HasScope(scope string) bool

type Store

type Store struct {
	Path string
}

func DefaultStore

func DefaultStore() (Store, error)

func (Store) AcquireLease added in v0.2.2

func (s Store) AcquireLease(name string, now time.Time, duration time.Duration) (bool, time.Duration, 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) ReleaseLease added in v0.2.2

func (s Store) ReleaseLease(name string) 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