Documentation ¶
Index ¶
- func CreateEvent(db *gorm.DB, event models.Event) ([]models.Event, *errors.Error)
- func CreateEventSeries(db *gorm.DB, series models.Series) ([]models.Event, *errors.Error)
- func DeleteEvent(db *gorm.DB, id uuid.UUID) *errors.Error
- func DeleteSeriesByEventID(db *gorm.DB, eventID uuid.UUID) *errors.Error
- func DeleteSeriesByID(db *gorm.DB, seriesID uuid.UUID) *errors.Error
- func Event(eventParams types.RouteParams)
- func GetEvent(db *gorm.DB, eventID uuid.UUID, preloads ...transactions.OptionalQuery) ([]models.Event, *errors.Error)
- func GetEvents(db *gorm.DB, limit int, page int) ([]models.Event, *errors.Error)
- func GetHostsByEventID(db *gorm.DB, eventID uuid.UUID) ([]models.Club, *errors.Error)
- func GetSeriesByEventID(db *gorm.DB, id uuid.UUID) ([]models.Event, *errors.Error)
- func GetSeriesByID(db *gorm.DB, id uuid.UUID) ([]models.Event, *errors.Error)
- func GetSeriesID(db *gorm.DB, eventID uuid.UUID) (*uuid.UUID, *errors.Error)
- func GetTagsByEventID(db *gorm.DB, eventID uuid.UUID) ([]models.Tag, *errors.Error)
- func UpdateEvent(db *gorm.DB, id uuid.UUID, event models.Event) ([]models.Event, *errors.Error)
- func UpdateSeries(db *gorm.DB, seriesID uuid.UUID, series models.Series) ([]models.Event, *errors.Error)
- func UpdateSeriesByEventID(db *gorm.DB, eventID uuid.UUID, series models.Series) ([]models.Event, *errors.Error)
- type EventController
- func (e *EventController) CreateEvent(c *fiber.Ctx) error
- func (e *EventController) DeleteEvent(c *fiber.Ctx) error
- func (e *EventController) DeleteSeriesByEventID(c *fiber.Ctx) error
- func (e *EventController) DeleteSeriesByID(c *fiber.Ctx) error
- func (e *EventController) GetAllEvents(c *fiber.Ctx) error
- func (e *EventController) GetEvent(c *fiber.Ctx) error
- func (e *EventController) GetHostsByEventID(c *fiber.Ctx) error
- func (e *EventController) GetSeriesByEventID(c *fiber.Ctx) error
- func (e *EventController) GetSeriesByID(c *fiber.Ctx) error
- func (e *EventController) GetTagsByEventID(c *fiber.Ctx) error
- func (e *EventController) UpdateEvent(c *fiber.Ctx) error
- func (e *EventController) UpdateSeriesByEventID(c *fiber.Ctx) error
- func (e *EventController) UpdateSeriesByID(c *fiber.Ctx) error
- type EventService
- func (e *EventService) CreateEvent(eventBody models.CreateEventRequestBody) ([]models.Event, *errors.Error)
- func (e *EventService) DeleteEvent(eventID string) *errors.Error
- func (e *EventService) DeleteSeriesByEventID(eventID string) *errors.Error
- func (e *EventService) DeleteSeriesByID(seriesID string) *errors.Error
- func (e *EventService) GetEvent(eventID string) ([]models.Event, *errors.Error)
- func (e *EventService) GetEvents(limit string, page string) ([]models.Event, *errors.Error)
- func (e *EventService) GetHostsByEventID(eventID string) ([]models.Club, *errors.Error)
- func (e *EventService) GetSeriesByEventID(eventID string) ([]models.Event, *errors.Error)
- func (e *EventService) GetSeriesByID(seriesID string) ([]models.Event, *errors.Error)
- func (e *EventService) GetTagsByEventID(eventID string) ([]models.Tag, *errors.Error)
- func (e *EventService) UpdateEvent(id string, eventBody models.UpdateEventRequestBody) ([]models.Event, *errors.Error)
- func (e *EventService) UpdateSeries(seriesID string, seriesBody models.UpdateSeriesRequestBody) ([]models.Event, *errors.Error)
- func (e *EventService) UpdateSeriesByEventID(eventID string, seriesBody models.UpdateSeriesRequestBody) ([]models.Event, *errors.Error)
- type EventServiceInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEvent ¶
func CreateEventSeries ¶
func DeleteSeriesByEventID ¶
func Event ¶
func Event(eventParams types.RouteParams)
func GetEvent ¶
func GetEvent(db *gorm.DB, eventID uuid.UUID, preloads ...transactions.OptionalQuery) ([]models.Event, *errors.Error)
func GetHostsByEventID ¶
func GetSeriesByEventID ¶
func GetTagsByEventID ¶
func UpdateEvent ¶
func UpdateSeries ¶
Types ¶
type EventController ¶
type EventController struct {
// contains filtered or unexported fields
}
func NewEventController ¶
func NewEventController(eventService EventServiceInterface) *EventController
func (*EventController) CreateEvent ¶
func (e *EventController) CreateEvent(c *fiber.Ctx) error
CreateEvent godoc
@Summary Create an event @Description Creates an event @ID create-event @Tags event @Accept json @Produce json @Param event body models.CreateEventRequestBody true "Event Body" @Success 201 {object} models.Event @Failure 400 {object} errors.Error @Failure 401 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/ [post]
func (*EventController) DeleteEvent ¶
func (e *EventController) DeleteEvent(c *fiber.Ctx) error
DeleteEvent godoc
@Summary Delete an event @Description Deletes an event @ID delete-event @Tags event @Produce json @Param eventID path string true "Event ID" @Success 204 {string} utilities.SuccessResponse @Failure 400 {object} errors.Error @Failure 401 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/{eventID}/ [delete]
func (*EventController) DeleteSeriesByEventID ¶
func (e *EventController) DeleteSeriesByEventID(c *fiber.Ctx) error
DeleteSeriesByEventID godoc
@Summary Delete all series by event @Description Deletes all series associated with an event @ID delete-series-by-event @Tags event @Produce json @Param eventID path string true "Event ID" @Success 204 {string} utilities.SuccessResponse @Failure 400 {object} errors.Error @Failure 401 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/{eventID}/series/ [delete]
func (*EventController) DeleteSeriesByID ¶
func (e *EventController) DeleteSeriesByID(c *fiber.Ctx) error
DeleteSeriesByID godoc
@Summary Delete a series by ID @Description Deletes a series by ID @ID delete-series-by-id @Tags event @Produce json @Param eventID path string true "Event ID" @Param seriesID path string true "Series ID" @Success 204 {string} utilities.SuccessResponse @Failure 400 {object} errors.Error @Failure 401 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/{eventID}/series/{seriesID}/ [delete]
func (*EventController) GetAllEvents ¶
func (e *EventController) GetAllEvents(c *fiber.Ctx) error
GetAllEvents godoc
@Summary Retrieve all events @Description Retrieves all events @ID get-all-events @Tags event @Produce json @Param limit query int false "Limit" @Param page query int false "Page" @Success 200 {object} []models.Event @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/ [get]
func (*EventController) GetEvent ¶
func (e *EventController) GetEvent(c *fiber.Ctx) error
GetEvent godoc
@Summary Retrieve an event @Description Retrieves an event @ID get-event @Tags event @Produce json @Param eventID path string true "Event ID" @Success 200 {object} models.Event @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/{eventID}/ [get]
func (*EventController) GetHostsByEventID ¶
func (e *EventController) GetHostsByEventID(c *fiber.Ctx) error
GetHostsByEventID godoc
@Summary Retrieve all hosts by event @Description Retrieves all hosts associated with an event @ID get-hosts-by-event @Tags event @Produce json @Param eventID path string true "Event ID" @Success 200 {object} []models.Club @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/{eventID}/hosts [get]
func (*EventController) GetSeriesByEventID ¶
func (e *EventController) GetSeriesByEventID(c *fiber.Ctx) error
GetSeriesByEventID godoc
@Summary Retrieve all series by event @Description Retrieves all series associated with an event @ID get-series-by-event @Tags event @Produce json @Param eventID path string true "Event ID" @Success 200 {object} []models.Series @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/{eventID}/series/ [get]
func (*EventController) GetSeriesByID ¶
func (e *EventController) GetSeriesByID(c *fiber.Ctx) error
GetSeriesByID godoc
@Summary Retrieve a series by ID @Description Retrieves a series by ID @ID get-series-by-id @Tags event @Produce json @Param eventID path string true "Event ID" @Param seriesID path string true "Series ID" @Success 200 {object} models.Series @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/{eventID}/series/{seriesID}/ [get]
func (*EventController) GetTagsByEventID ¶
func (e *EventController) GetTagsByEventID(c *fiber.Ctx) error
GetTagsByEventID godoc
@Summary Retrieve all tags by event @Description Retrieves all tags associated with an event @ID get-tags-by-event @Tags event @Produce json @Param eventID path string true "Event ID" @Success 200 {object} []models.Tag @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/{eventID}/tags [get]
func (*EventController) UpdateEvent ¶
func (e *EventController) UpdateEvent(c *fiber.Ctx) error
UpdateEvent godoc
@Summary Create a series @Description Creates a series @ID create-series @Tags event @Accept json @Produce json @Param eventID path string true "Event ID" @Param seriesBody body models.UpdateEventRequestBody true "Series Body" @Success 201 {object} models.Series @Failure 400 {object} errors.Error @Failure 401 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/{eventID}/series/ [patch]
func (*EventController) UpdateSeriesByEventID ¶
func (e *EventController) UpdateSeriesByEventID(c *fiber.Ctx) error
UpdateSeriesByEventID godoc
@Summary Update a series by event ID @Description Updates a series by event ID @ID update-series-by-event-id @Tags event @Accept json @Produce json @Param eventID path string true "Event ID" @Param seriesBody body models.UpdateSeriesRequestBody true "Series Body" @Success 200 {object} models.Series @Failure 400 {object} errors.Error @Failure 401 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/{eventID}/series/{seriesID}/ [patch]
func (*EventController) UpdateSeriesByID ¶
func (e *EventController) UpdateSeriesByID(c *fiber.Ctx) error
UpdateSeriesByID godoc
@Summary Update a series by ID @Description Updates a series by ID. If individual events have been edited prior,
this update will override the previous changes
@ID update-series-by-id @Tags event @Accept json @Produce json @Param seriesID path string true "Series ID" @Param seriesBody body models.UpdateSeriesRequestBody true "Series Body" @Success 200 {object} models.Series @Failure 400 {object} errors.Error @Failure 401 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Router /events/{eventID}/series/{seriesID}/ [patch]
type EventService ¶
type EventService struct {
types.ServiceParams
}
func (*EventService) CreateEvent ¶
func (e *EventService) CreateEvent(eventBody models.CreateEventRequestBody) ([]models.Event, *errors.Error)
right now we are always returning a slice
func (*EventService) DeleteEvent ¶
func (e *EventService) DeleteEvent(eventID string) *errors.Error
func (*EventService) DeleteSeriesByEventID ¶
func (e *EventService) DeleteSeriesByEventID(eventID string) *errors.Error
func (*EventService) DeleteSeriesByID ¶
func (e *EventService) DeleteSeriesByID(seriesID string) *errors.Error
func (*EventService) GetHostsByEventID ¶
func (*EventService) GetSeriesByEventID ¶
func (*EventService) GetSeriesByID ¶
func (*EventService) GetTagsByEventID ¶
func (*EventService) UpdateEvent ¶
func (e *EventService) UpdateEvent(id string, eventBody models.UpdateEventRequestBody) ([]models.Event, *errors.Error)
func (*EventService) UpdateSeries ¶
func (e *EventService) UpdateSeries(seriesID string, seriesBody models.UpdateSeriesRequestBody) ([]models.Event, *errors.Error)
func (*EventService) UpdateSeriesByEventID ¶
func (e *EventService) UpdateSeriesByEventID(eventID string, seriesBody models.UpdateSeriesRequestBody) ([]models.Event, *errors.Error)
type EventServiceInterface ¶
type EventServiceInterface interface { GetEvents(limit string, page string) ([]models.Event, *errors.Error) GetEvent(eventID string) ([]models.Event, *errors.Error) GetSeriesByEventID(eventID string) ([]models.Event, *errors.Error) GetSeriesByID(seriesID string) ([]models.Event, *errors.Error) CreateEvent(eventBodies models.CreateEventRequestBody) ([]models.Event, *errors.Error) UpdateEvent(eventID string, eventBody models.UpdateEventRequestBody) ([]models.Event, *errors.Error) UpdateSeries(seriesID string, seriesBody models.UpdateSeriesRequestBody) ([]models.Event, *errors.Error) UpdateSeriesByEventID(eventID string, seriesBody models.UpdateSeriesRequestBody) ([]models.Event, *errors.Error) DeleteEvent(eventID string) *errors.Error DeleteSeriesByEventID(seriesID string) *errors.Error DeleteSeriesByID(seriesID string) *errors.Error GetHostsByEventID(eventID string) ([]models.Club, *errors.Error) GetTagsByEventID(eventID string) ([]models.Tag, *errors.Error) }
func NewEventService ¶
func NewEventService(serviceParams types.ServiceParams) EventServiceInterface