Documentation
¶
Index ¶
- func CreateEvent(w http.ResponseWriter, r *http.Request)
- func CreateEventPosition(w http.ResponseWriter, r *http.Request)
- func CreateEventRouting(w http.ResponseWriter, r *http.Request)
- func CreateEventSignup(w http.ResponseWriter, r *http.Request)
- func DeleteEvent(w http.ResponseWriter, r *http.Request)
- func DeleteEventPosition(w http.ResponseWriter, r *http.Request)
- func DeleteEventRouting(w http.ResponseWriter, r *http.Request)
- func DeleteEventSignup(w http.ResponseWriter, r *http.Request)
- func DeleteEventTemplate(w http.ResponseWriter, r *http.Request)
- func EventRouter(r chi.Router)
- func GetAllEvents(w http.ResponseWriter, r *http.Request)
- func GetEvent(w http.ResponseWriter, r *http.Request)
- func GetEventPosition(w http.ResponseWriter, r *http.Request)
- func GetEventPositions(w http.ResponseWriter, r *http.Request)
- func GetEventRouting(w http.ResponseWriter, r *http.Request)
- func GetEventSignup(w http.ResponseWriter, r *http.Request)
- func GetEventSignups(w http.ResponseWriter, r *http.Request)
- func GetEventTemplates(w http.ResponseWriter, r *http.Request)
- func GetEvents(w http.ResponseWriter, r *http.Request)
- func GetEventsPrevious(w http.ResponseWriter, r *http.Request)
- func NewEventListResponse(es []models.Event) []render.Renderer
- func NewEventPositionListResponse(eps []models.EventPosition) []render.Renderer
- func NewEventRoutingListResponse(ers []models.EventRouting) []render.Renderer
- func NewEventSignupListResponse(ess []models.EventSignup) []render.Renderer
- func NewEventTemplateListResponse(ets []models.EventTemplate) []render.Renderer
- func PatchEvent(w http.ResponseWriter, r *http.Request)
- func PatchEventPosition(w http.ResponseWriter, r *http.Request)
- func PatchEventRouting(w http.ResponseWriter, r *http.Request)
- func TemplateRouter(r chi.Router)
- func UpdateEvent(w http.ResponseWriter, r *http.Request)
- func UpdateEventTemplate(w http.ResponseWriter, r *http.Request)
- type EventPositionRequest
- type EventPositionResponse
- type EventRequest
- type EventResponse
- type EventRoutingRequest
- type EventRoutingResponse
- type EventSignupRequest
- type EventSignupResponse
- type EventTemplateRequest
- type EventTemplateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEvent ¶
func CreateEvent(w http.ResponseWriter, r *http.Request)
CreateEvent godoc @Summary Create an Event @Description Create an Event @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param event body EventRequest true "Event" @Success 201 {object} EventResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events [post]
func CreateEventPosition ¶
func CreateEventPosition(w http.ResponseWriter, r *http.Request)
CreateEventPosition godoc @Summary Create an Event Position @Description Create an Event Position @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Param event body EventPositionRequest true "Event Position" @Success 201 {object} EventPositionResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/positions [post]
func CreateEventRouting ¶
func CreateEventRouting(w http.ResponseWriter, r *http.Request)
CreateEventRouting godoc @Summary Create an Event Routing @Description Create an Event Routing @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Param event body EventRoutingRequest true "Event Routing" @Success 201 {object} EventRoutingResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/routing [post]
func CreateEventSignup ¶
func CreateEventSignup(w http.ResponseWriter, r *http.Request)
CreateEventSignup godoc @Summary Create an Event Signup @Description Create an Event Signup @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Param event body EventSignupRequest true "Event Signup" @Success 201 {object} EventSignupResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/signups [post]
func DeleteEvent ¶
func DeleteEvent(w http.ResponseWriter, r *http.Request)
DeleteEvent godoc @Summary Delete Event @Description Delete Event by ID @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Success 204 @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID} [delete]
func DeleteEventPosition ¶
func DeleteEventPosition(w http.ResponseWriter, r *http.Request)
DeleteEventPosition godoc @Summary Delete an Event Position @Description Delete an Event Position @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Param EventPositionID path string true "Event Position ID" @Success 204 @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/positions/{EventPositionID} [delete]
func DeleteEventRouting ¶
func DeleteEventRouting(w http.ResponseWriter, r *http.Request)
DeleteEventRouting godoc @Summary Delete an Event Routing @Description Delete an Event Routing @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Param EventRoutingID path string true "Event Routing ID" @Success 204 @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/routing/{EventRoutingID} [delete]
func DeleteEventSignup ¶
func DeleteEventSignup(w http.ResponseWriter, r *http.Request)
DeleteEventSignup godoc @Summary Delete an Event Signup @Description Delete an Event Signup @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Param EventSignupID path string true "Event Signup ID" @Success 204 @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/signups/{EventSignupID} [delete]
func DeleteEventTemplate ¶
func DeleteEventTemplate(w http.ResponseWriter, r *http.Request)
DeleteEventTemplate godoc @Summary Delete an Event Template @Description Delete an Event Template @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventTemplateID path string true "Event Template ID" @Success 204 @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/event-templates/{EventTemplateID} [delete]
func EventRouter ¶
func GetAllEvents ¶
func GetAllEvents(w http.ResponseWriter, r *http.Request)
GetAllEvents godoc @Summary Get All Events @Description Get All Events (Paginated, default 10, limit 25) @Tags event @Accept json @Produce json @Param page query int false "Page" @Param limit query int false "Limit" @Success 200 {object} []EventResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /events [get]
func GetEvent ¶
func GetEvent(w http.ResponseWriter, r *http.Request)
GetEvent godoc @Summary Get Event @Description Get Event by ID @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Success 200 {object} EventResponse @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID} [get]
func GetEventPosition ¶
func GetEventPosition(w http.ResponseWriter, r *http.Request)
GetEventPosition godoc @Summary Get Event Position @Description Get Event Position @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Param EventPositionID path string true "Event Position ID" @Success 200 {object} EventPositionResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/positions/{EventPositionID} [get]
func GetEventPositions ¶
func GetEventPositions(w http.ResponseWriter, r *http.Request)
GetEventPositions godoc @Summary Get Event Positions @Description Get Event Positions @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Success 200 {object} []EventPositionResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/positions [get]
func GetEventRouting ¶
func GetEventRouting(w http.ResponseWriter, r *http.Request)
GetEventRouting godoc @Summary Get Event Routing @Description Get Event Routing @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Success 200 {object} []EventRoutingResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/routing [get]
func GetEventSignup ¶
func GetEventSignup(w http.ResponseWriter, r *http.Request)
GetEventSignup godoc @Summary Get an Event Signup @Description Get an Event Signup @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Param EventSignupID path string true "Event Signup ID" @Success 200 {object} EventSignupResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/signups/{EventSignupID} [get]
func GetEventSignups ¶
func GetEventSignups(w http.ResponseWriter, r *http.Request)
GetEventSignups godoc @Summary Get Event Signups @Description Get Event Signups @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Success 200 {object} []EventSignupResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/signups [get]
func GetEventTemplates ¶
func GetEventTemplates(w http.ResponseWriter, r *http.Request)
GetEventTemplates godoc @Summary Get Event Templates @Description Get Event Templates by Facility @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Success 200 {object} []EventTemplateResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/event-templates [get]
func GetEvents ¶
func GetEvents(w http.ResponseWriter, r *http.Request)
GetEvents godoc @Summary Get Events @Description Get Events by Facility @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Success 200 {object} []EventResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events [get]
func GetEventsPrevious ¶
func GetEventsPrevious(w http.ResponseWriter, r *http.Request)
GetEventsPrevious godoc @Summary Get Previous Events @Description Get Previous Events by Facility @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Success 200 {object} []EventResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/previous [get]
func NewEventPositionListResponse ¶
func NewEventPositionListResponse(eps []models.EventPosition) []render.Renderer
func NewEventRoutingListResponse ¶
func NewEventRoutingListResponse(ers []models.EventRouting) []render.Renderer
func NewEventSignupListResponse ¶
func NewEventSignupListResponse(ess []models.EventSignup) []render.Renderer
func NewEventTemplateListResponse ¶
func NewEventTemplateListResponse(ets []models.EventTemplate) []render.Renderer
func PatchEvent ¶
func PatchEvent(w http.ResponseWriter, r *http.Request)
PatchEvent godoc @Summary Patch Event @Description Patch Event by ID @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Param event body EventRequest true "Event" @Success 200 {object} EventResponse @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID} [patch]
func PatchEventPosition ¶
func PatchEventPosition(w http.ResponseWriter, r *http.Request)
PatchEventPosition godoc @Summary Patch an Event Position @Description Patch an Event Position @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Param EventPositionID path string true "Event Position ID" @Param event body EventPositionRequest true "Event Position" @Success 200 {object} EventPositionResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/positions/{EventPositionID} [patch]
func PatchEventRouting ¶
func PatchEventRouting(w http.ResponseWriter, r *http.Request)
PatchEventRouting godoc @Summary Patch an Event Routing @Description Patch an Event Routing @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Param EventRoutingID path string true "Event Routing ID" @Param event body EventRoutingRequest true "Event Routing" @Success 200 {object} EventRoutingResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID}/routing/{EventRoutingID} [patch]
func TemplateRouter ¶
func UpdateEvent ¶
func UpdateEvent(w http.ResponseWriter, r *http.Request)
UpdateEvent godoc @Summary Update Event @Description Update Event by ID @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventID path string true "Event ID" @Param event body EventRequest true "Event" @Success 200 {object} EventResponse @Failure 400 {object} utils.ErrResponse @Failure 404 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/events/{EventID} [put]
func UpdateEventTemplate ¶
func UpdateEventTemplate(w http.ResponseWriter, r *http.Request)
UpdateEventTemplate godoc @Summary Update an Event Template @Description Update an Event Template @Tags event @Accept json @Produce json @Param FacilityID path string true "Facility ID" @Param EventTemplateID path string true "Event Template ID" @Param event body EventTemplateRequest true "Event Template" @Success 200 {object} EventTemplateResponse @Failure 400 {object} utils.ErrResponse @Failure 500 {object} utils.ErrResponse @Router /facility/{FacilityID}/event-templates/{EventTemplateID} [put]
Types ¶
type EventPositionRequest ¶
type EventPositionRequest struct {
Position string `json:"position" example:"ZDV_APP" validate:"required"`
Assignee *uint `json:"assignee" example:"1293257"`
Shifts *bool `json:"shifts" example:"true"`
SecondaryAssignee *uint `json:"secondary_assignee" example:"1293257"`
}
func (*EventPositionRequest) Validate ¶
func (req *EventPositionRequest) Validate() error
type EventPositionResponse ¶
type EventPositionResponse struct {
*models.EventPosition
AssigneeName string `json:"assignee_name" example:"John Doe"`
SecondaryAssigneeName string `json:"secondary_assignee_name" example:"Jane Doe"`
}
func NewEventPositionResponse ¶
func NewEventPositionResponse(ep *models.EventPosition) *EventPositionResponse
func (*EventPositionResponse) Render ¶
func (res *EventPositionResponse) Render(w http.ResponseWriter, r *http.Request) error
type EventRequest ¶
type EventRequest struct {
Title string `json:"title" example:"ZDV FNO" validate:"required"`
Description string `json:"description" example:"Join us for a fun night of flying in and out of Denver!" validate:"required"`
BannerURL string `json:"banner_url" example:"https://zdvartcc.org/banner.jpg"`
StartDate time.Time `json:"start_date" example:"2021-01-01T00:00:00Z" validate:"required"`
EndDate time.Time `json:"end_date" example:"2021-01-01T00:00:00Z" validate:"required"`
Fields []string `json:"fields" example:"KDEN" validate:"required"`
Facilities []constants.FacilityID `json:"facilities" example:"ZDV" validate:"required"`
}
func (*EventRequest) Validate ¶
func (req *EventRequest) Validate() error
type EventResponse ¶
func NewEventResponse ¶
func NewEventResponse(e *models.Event) *EventResponse
func (*EventResponse) Render ¶
func (res *EventResponse) Render(w http.ResponseWriter, r *http.Request) error
type EventRoutingRequest ¶
type EventRoutingRequest struct {
Origin string `json:"origin" example:"ZDV" validate:"required"`
Destination string `json:"destination" example:"ZAB" validate:"required"`
Routing string `json:"routing" example:"ZDV J80 DBL J80 FQF J80 HCT J80 HBU J80 HCT J80 FQF J80 DBL J80 ZAB" validate:"required"`
Notes string `json:"notes" example:"Expect vectors to final at DBL" validate:"required"`
}
func (*EventRoutingRequest) Validate ¶
func (req *EventRoutingRequest) Validate() error
type EventRoutingResponse ¶
type EventRoutingResponse struct {
*models.EventRouting
}
func NewEventRoutingResponse ¶
func NewEventRoutingResponse(er *models.EventRouting) *EventRoutingResponse
func (*EventRoutingResponse) Render ¶
func (res *EventRoutingResponse) Render(w http.ResponseWriter, r *http.Request) error
type EventSignupRequest ¶
type EventSignupRequest struct {
PositionID uint `json:"position_id" example:"1" validate:"required"`
CID uint `json:"cid" example:"1293257" validate:"required"`
Shift uint `json:"shift" example:"1" validate:"required"` // 1 = Primary, 2 = Secondary
}
func (*EventSignupRequest) Validate ¶
func (req *EventSignupRequest) Validate() error
type EventSignupResponse ¶
type EventSignupResponse struct {
*models.EventSignup
}
func NewEventSignupResponse ¶
func NewEventSignupResponse(es *models.EventSignup) *EventSignupResponse
func (*EventSignupResponse) Render ¶
func (res *EventSignupResponse) Render(w http.ResponseWriter, r *http.Request) error
type EventTemplateRequest ¶
type EventTemplateRequest struct {
Title string `json:"title" example:"KDEN FNO" validate:"required"`
Positions []string `json:"positions" example:"ZDV_APP" validate:"required"`
Facilities []constants.FacilityID `json:"facilities" example:"ZDV" validate:"required"`
Fields []string `json:"fields" example:"KDEN" validate:"required"`
Shifts bool `json:"shifts" example:"true"`
}
func (*EventTemplateRequest) Validate ¶
func (req *EventTemplateRequest) Validate() error
type EventTemplateResponse ¶
type EventTemplateResponse struct {
*models.EventTemplate
}
func NewEventTemplateResponse ¶
func NewEventTemplateResponse(et *models.EventTemplate) *EventTemplateResponse
func (*EventTemplateResponse) Render ¶
func (res *EventTemplateResponse) Render(w http.ResponseWriter, r *http.Request) error