Documentation
¶
Index ¶
- type CreateInput
- type Event
- type Handlers
- type Period
- type Service
- func (s *Service) Create(ctx context.Context, in CreateInput, image *upload.File) (Event, error)
- func (s *Service) Delete(ctx context.Context, id int) (Event, error)
- func (s *Service) Get(ctx context.Context, id int) (Event, error)
- func (s *Service) List(ctx context.Context, period Period) ([]Event, error)
- func (s *Service) Next(ctx context.Context) (Event, bool, error)
- func (s *Service) Update(ctx context.Context, id int, in UpdateInput, image *upload.File) (Event, error)
- type Store
- func (s *Store) AddWhatsOn(ctx context.Context, whatsOnParam WhatsOn) (WhatsOn, error)
- func (s *Store) DeleteWhatsOn(ctx context.Context, whatsOnParam WhatsOn) error
- func (s *Store) EditWhatsOn(ctx context.Context, whatsOnParam WhatsOn) (WhatsOn, error)
- func (s *Store) GetWhatsOn(ctx context.Context) ([]WhatsOn, error)
- func (s *Store) GetWhatsOnArticle(ctx context.Context, whatsOnParam WhatsOn) (WhatsOn, error)
- func (s *Store) GetWhatsOnFuture(ctx context.Context) ([]WhatsOn, error)
- func (s *Store) GetWhatsOnLatest(ctx context.Context) (WhatsOn, error)
- func (s *Store) GetWhatsOnPast(ctx context.Context) ([]WhatsOn, error)
- type UpdateInput
- type WhatsOn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateInput ¶
CreateInput is a new event. Content is sanitised HTML.
type Event ¶
type Event struct {
ID int `json:"id"`
Title string `json:"title"`
Content string `json:"content"`
Date time.Time `json:"date"`
DateOfEvent time.Time `json:"dateOfEvent"`
ImageURL string `json:"imageUrl,omitempty"`
}
Event is a what's-on entry as the API returns it.
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers serves /whatson.
func NewHandlers ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the what's-on business logic.
func NewService ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store stores the dependencies
func (*Store) AddWhatsOn ¶
func (*Store) DeleteWhatsOn ¶
func (*Store) EditWhatsOn ¶
func (*Store) GetWhatsOnArticle ¶
func (*Store) GetWhatsOnFuture ¶
func (*Store) GetWhatsOnLatest ¶
type UpdateInput ¶
UpdateInput changes an event; nil fields are left unchanged.
type WhatsOn ¶
type WhatsOn struct {
ID int `db:"id" json:"id"`
Title string `db:"title" json:"title"`
FileName null.String `db:"file_name" json:"file_name"`
Content null.String `db:"content" json:"content"`
Date time.Time `db:"date" json:"date"`
DateOfEvent time.Time `db:"date_of_event" json:"date_of_event"`
}
WhatsOn represents relevant whatsOn fields
Click to show internal directories.
Click to hide internal directories.