player

package
v0.0.0-...-5888283 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Routes() chi.Router
	List(w http.ResponseWriter, r *http.Request)
	Get(w http.ResponseWriter, r *http.Request)
	UpdatePlayers(w http.ResponseWriter, r *http.Request)
}

func NewHandler

func NewHandler(logger *slog.Logger, playerService Service) Handler

type Service

type Service interface {
	Get(ctx context.Context, playerID string) (api.Player, error)
	ListPlayers(ctx context.Context) ([]api.Player, error)
	UpdatePlayers(ctx context.Context, seasonStartYear int) ([]api.Player, error)
}

func NewService

func NewService(playerStore Store) Service

type Store

type Store interface {
	GetPlayerWithID(ctx context.Context, playerID string) (api.Player, error)
	ListPlayers(ctx context.Context) ([]api.Player, error)
	GetPlayersWithIDs(ctx context.Context, ids []string) ([]api.Player, error)
	UpdatePlayers(ctx context.Context, players []api.Player) ([]api.Player, error)
}

Jump to

Keyboard shortcuts

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