pastgames

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPastGamesRouter

func NewPastGamesRouter() http.Handler

NewPastGamesRouter sets up the routes for the pastgames package.

Types

type ErrPastGameNotFound

type ErrPastGameNotFound struct{}

func (ErrPastGameNotFound) Error

func (ErrPastGameNotFound) Error() string

type GormPastGameRepository

type GormPastGameRepository struct {
	DB *gorm.DB
}

InMemoryPastGameRepository In-mem store for past games

var PastGamesRepo *GormPastGameRepository

func NewGormPastGameRepository

func NewGormPastGameRepository(db *gorm.DB) *GormPastGameRepository

func (*GormPastGameRepository) AddPastGame

func (repo *GormPastGameRepository) AddPastGame(game models.PastGame) (uint, error)

func (*GormPastGameRepository) BrowsePastGamesByID

func (repo *GormPastGameRepository) BrowsePastGamesByID(query string) ([]models.PastGame, error)

func (*GormPastGameRepository) GetAllPastGames

func (repo *GormPastGameRepository) GetAllPastGames() ([]models.PastGame, error)

func (*GormPastGameRepository) GetPastGameByID

func (repo *GormPastGameRepository) GetPastGameByID(id uint) (models.PastGame, error)

type PastGameRepository

type PastGameRepository interface {
	AddPastGame(game models.PastGame) (uint, error)
	GetPastGameByID(id int) (models.PastGame, error)
	GetAllPastGames() ([]models.PastGame, error)
	BrowsePastGamesByID(query string) ([]models.PastGame, error)
}

Jump to

Keyboard shortcuts

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