blizzard

package
v0.0.0-...-dd5b6bf Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WowTokenGracePeriod int64 = 20 // Minutes

)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlizzardAuthTokenAPIResponse

type BlizzardAuthTokenAPIResponse struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int64  `json:"expires_in"`
}

type BlizzardClient

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

func New

func New(
	ctx context.Context,
	config *config.Config,
	secrets *secrets.Secrets,
	db *database.Queries,
) *BlizzardClient

func (*BlizzardClient) FetchTokenPrice

func (b *BlizzardClient) FetchTokenPrice() (WowTokenPrice, error)

func (*BlizzardClient) GeneratePriceChart

func (b *BlizzardClient) GeneratePriceChart(
	unit string,
	period int,
) (*bytes.Buffer, time.Time, error)

func (*BlizzardClient) StartWowTokenFetchInterval

func (b *BlizzardClient) StartWowTokenFetchInterval(ctx context.Context, period time.Duration)

type BlizzardClientToken

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

type WowTokenPrice

type WowTokenPrice struct {
	Updated time.Time
	Price   int64
}

type WowTokenPriceAPIResponse

type WowTokenPriceAPIResponse struct {
	Updated int64 `json:"last_updated_timestamp"`
	Price   int64 `json:"price"`
}

Jump to

Keyboard shortcuts

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