game

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YGO = "YGO"
	POC = "POC"
	VG  = "VG"
	OPC = "OPC"
	WS  = "WS"
)

Constants for active game codes.

Variables

View Source
var ErrGameNotFound = errors.New("game not found")

Functions

This section is empty.

Types

type Game

type Game struct {
	Title          string
	Image          string
	Code           string
	Endpoint       string
	ImageEndpoint  string
	DetailEndpoint string
	CodeFormat     string
}

type Games

type Games map[string]*Game

func (Games) FetchAll

func (g Games) FetchAll() []*Game

func (Games) GameByCode

func (g Games) GameByCode(code string, logger *slog.Logger) (*Game, error)

type Service

type Service interface {
	Fetch(ctx context.Context, code string) (*Game, error)
	FetchAll(ctx context.Context) ([]*Game, error)
}

func NewService

func NewService(logger *slog.Logger) Service

Jump to

Keyboard shortcuts

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