content

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseRepository

type DatabaseRepository interface {
	GetEvent(id entities.ID) (*entities.Event, error)
	ListEvents(includePastEvents bool) ([]*entities.Event, error)
	CreateEvent(e *entities.Event) (*entities.Event, error)
	UpdateEvent(e *entities.Event) (*entities.Event, error)
	DeleteEvent(id entities.ID) error

	GetContent(name string) (*entities.Content, error)
	ListContent() ([]*entities.Content, error)
	CreateContent(e *entities.Content) (*entities.Content, error)
	UpdateContent(e *entities.Content) (*entities.Content, error)
	DeleteContent(name string) error
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(db DatabaseRepository, content []entities.Content, eventsWholeDaysOnly bool) (*Service, error)

func (*Service) CreateContent

func (s *Service) CreateContent(content *entities.Content) (*entities.Content, error)

CreateContent creates a new content

func (*Service) CreateEvent

func (s *Service) CreateEvent(event *entities.Event) (*entities.Event, error)

CreateEvent creates a new event

func (*Service) DeleteContent

func (s *Service) DeleteContent(name string) error

DeleteContent deletes a single content by ID

func (*Service) DeleteEvent

func (s *Service) DeleteEvent(id entities.ID) error

DeleteEvent deletes a single event by ID

func (*Service) GetContent

func (s *Service) GetContent(name string) (*entities.Content, error)

GetContent fetches a single content by ID

func (*Service) GetEvent

func (s *Service) GetEvent(id entities.ID) (*entities.Event, error)

GetEvent fetches a single event by ID

func (*Service) ListContent

func (s *Service) ListContent() ([]*entities.Content, error)

ListContents fetches all contents

func (*Service) ListEvents

func (s *Service) ListEvents(includePastEvents bool) ([]*entities.Event, error)

ListEvents fetches all events

func (*Service) UpdateContent

func (s *Service) UpdateContent(content *entities.Content) (*entities.Content, error)

UpdateContent persists the provided content

func (*Service) UpdateEvent

func (s *Service) UpdateEvent(event *entities.Event) (*entities.Event, error)

UpdateEvent persists the provided event

type Usecase

type Usecase interface {
	GetEvent(id entities.ID) (*entities.Event, error)
	ListEvents(includePastEvents bool) ([]*entities.Event, error)
	CreateEvent(e *entities.Event) (*entities.Event, error)
	UpdateEvent(e *entities.Event) (*entities.Event, error)
	DeleteEvent(id entities.ID) error

	GetContent(name string) (*entities.Content, error)
	ListContent() ([]*entities.Content, error)
	CreateContent(e *entities.Content) (*entities.Content, error)
	UpdateContent(e *entities.Content) (*entities.Content, error)
	DeleteContent(name string) error
}

Jump to

Keyboard shortcuts

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