repository

package
v0.0.0-...-91b10cc Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListSubmissionsParams

type ListSubmissionsParams struct {
	Class   string
	Mode    string
	OrderBy string
	Limit   int
	Offset  int
}

type Repository

type Repository struct {
	Seasons           SeasonsRepository
	SeasonSubmissions SeasonSubmissionsRepository
	// contains filtered or unexported fields
}

func New

func New(db *pgxpool.Pool) *Repository

type SeasonSubmissionsRepository

type SeasonSubmissionsRepository interface {
	List(seasonId int, params ListSubmissionsParams) ([]*models.Submission, int, error)
	Create(submission *models.Submission) (*models.Submission, error)
}

SeasonSubmissionsRepository is the interface that a season submissions repository should conform to.

func NewSeasonSubmissionsRepository

func NewSeasonSubmissionsRepository(db *pgxpool.Pool) SeasonSubmissionsRepository

NewSeasonSubmissionsRepository returns a new instance of a season submissions repository.

type SeasonsRepository

type SeasonsRepository interface {
	// List returns a list of seasons.
	List(limit, offset int) ([]*models.Season, int, error)
	// Current returns the current season.
	Current() (*models.Season, error)
	// Create creates a new season.
	Create(season *models.Season) (*models.Season, error)
	Statistics(seasonId int) (*models.Statistics, []*models.Statistics, error)
}

SeasonsRepository is the interface that a seasons repository should conform to.

func NewSeasonsRepository

func NewSeasonsRepository(db *pgxpool.Pool) SeasonsRepository

NewSeasonsRepository returns a new instance of a seasonsRepository.

Jump to

Keyboard shortcuts

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