Documentation
¶
Index ¶
- type CreateInput
- type Handlers
- type Programme
- type Public
- type PublicSeason
- type Season
- type SeasonInput
- type Service
- func (s *Service) Create(ctx context.Context, in CreateInput, file *upload.File) (Public, error)
- func (s *Service) CreateSeason(ctx context.Context, name string) (PublicSeason, error)
- func (s *Service) Delete(ctx context.Context, id int) (Public, error)
- func (s *Service) DeleteSeason(ctx context.Context, id int) (PublicSeason, error)
- func (s *Service) List(ctx context.Context, seasonID int) ([]Public, error)
- func (s *Service) RenameSeason(ctx context.Context, id int, name string) (PublicSeason, error)
- func (s *Service) Seasons(ctx context.Context) ([]PublicSeason, error)
- type Store
- func (s *Store) AddProgramme(ctx context.Context, programmeParam Programme) (Programme, error)
- func (s *Store) AddSeason(ctx context.Context, seasonParam Season) (Season, error)
- func (s *Store) DeleteProgramme(ctx context.Context, programmeParam Programme) error
- func (s *Store) DeleteSeason(ctx context.Context, seasonParam Season) error
- func (s *Store) EditProgramme(ctx context.Context, programmeParam Programme) (Programme, error)
- func (s *Store) EditSeason(ctx context.Context, seasonParam Season) (Season, error)
- func (s *Store) GetProgramme(ctx context.Context, programmeParam Programme) (Programme, error)
- func (s *Store) GetProgrammes(ctx context.Context) ([]Programme, error)
- func (s *Store) GetProgrammesSeason(ctx context.Context, seasonParam Season) ([]Programme, error)
- func (s *Store) GetSeason(ctx context.Context, seasonParam Season) (Season, error)
- func (s *Store) GetSeasons(ctx context.Context) ([]Season, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateInput ¶
CreateInput is a new programme; a file is required. SeasonID 0 means none.
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers serves /programmes and /seasons.
func NewHandlers ¶
type Public ¶
type Public struct {
ID int `json:"id"`
Name string `json:"name"`
Date time.Time `json:"date"`
FileURL string `json:"fileUrl"`
Season *PublicSeason `json:"season,omitempty"`
}
Public is a match programme as the API returns it.
type PublicSeason ¶
PublicSeason is a programme season.
type SeasonInput ¶
type SeasonInput struct {
Season string `json:"season"`
}
SeasonInput is the JSON body for creating or renaming a season.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the programme and season logic.
func NewService ¶
func (*Service) CreateSeason ¶
func (*Service) DeleteSeason ¶
DeleteSeason unlinks the season's programmes (they are kept) and deletes it.
func (*Service) RenameSeason ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store stores the dependencies
func NewProgrammeRepo ¶
NewProgrammeRepo stores our dependency
func (*Store) AddProgramme ¶
func (*Store) DeleteProgramme ¶
func (*Store) DeleteSeason ¶
func (*Store) EditProgramme ¶
func (*Store) EditSeason ¶
func (*Store) GetProgramme ¶
func (*Store) GetProgrammes ¶
func (*Store) GetProgrammesSeason ¶
Click to show internal directories.
Click to hide internal directories.