Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EventNotFoundError = errors.New("event not found") EventInternalError = errors.New("event internal error") )
Functions ¶
Types ¶
type Event ¶
type Event struct { //gorm.Model ID uint `json:"id" gorm:"primaryKey; not null; autoIncrement"` Title string `json:"Title"` Date string `json:"Date"` Status bool `json:"Status" gorm:"not null; default:true"` Description string `json:"Description"` }
func (*Event) ValidateEvent ¶
type EventsHandler ¶
type EventsHandler struct {
// contains filtered or unexported fields
}
func BuildEventsHandler ¶
func BuildEventsHandler(eventsService IEventsService) *EventsHandler
func (*EventsHandler) GetAll ¶
func (handler *EventsHandler) GetAll(w http.ResponseWriter, r *http.Request)
func (*EventsHandler) GetByEventID ¶
func (handler *EventsHandler) GetByEventID(w http.ResponseWriter, r *http.Request)
type EventsRepository ¶
func BuildEventsRepository ¶
func BuildEventsRepository(dbConn *gorm.DB) *EventsRepository
func (*EventsRepository) CreateEvent ¶
func (*EventsRepository) GetAll ¶
func (r *EventsRepository) GetAll(ctx context.Context) ([]Event, error)
func (*EventsRepository) GetByEventID ¶
type EventsService ¶
type EventsService struct {
Repository IEventsRepository
}
func BuildEventsService ¶
func BuildEventsService(eventsRepository IEventsRepository) *EventsService
func (*EventsService) GetAll ¶
func (service *EventsService) GetAll(ctx context.Context) ([]Event, error)
func (*EventsService) GetByEventID ¶
type IEventsHandler ¶
type IEventsHandler interface { GetAll(w http.ResponseWriter, r *http.Request) GetByEventID(w http.ResponseWriter, r *http.Request) }
type IEventsRepository ¶
Click to show internal directories.
Click to hide internal directories.