status

package
v0.0.0-...-fdc8e6b Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Detect sooner when a skin changes
	UserFreshTTL = 12 * time.Hour
)

Variables

This section is empty.

Functions

func MetricTextureFetchError

func MetricTextureFetchError()

Types

type Status

type Status uint8

Status is for recording the API response status for a specific request It does not correspond to the data validity - simple a record of how the API responded

const (
	StatusUnSet Status = iota
	StatusOk
	StatusErrorGeneric
	StatusErrorUnknownUser
	StatusErrorRateLimit
)

Todo: Username vs. UUID logic??

func NewStatusFromError

func NewStatusFromError(logger log.Logger, query string, err error) Status

Todo: remove the `query` here as it should already be tagged on the logger NOTE: This will record metrics based on the given error

func (Status) Byte

func (s Status) Byte() byte

func (Status) DurationUUID

func (s Status) DurationUUID() time.Duration

func (Status) DurationUser

func (s Status) DurationUser() time.Duration

func (Status) Error

func (s Status) Error() string

func (Status) GetError

func (s Status) GetError() error

Creates an `error` based on the previous API response status This is for raising an error already recorded as a Status

Jump to

Keyboard shortcuts

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