Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Index ¶
- func RegisterHandlers(router gin.IRouter, si ServerInterface)
- func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
- type AvailabilityResult
- type CreateEventJSONRequestBody
- type CreateEventRequest
- type CreateEventResponse
- type CreateTimeSlotUserJSONRequestBody
- type CreateTimeSlotUserRequest
- type DeleteTimeSlotEventParams
- type DeleteTimeSlotUserParams
- type Event
- type GinServerOptions
- type MiddlewareFunc
- type PartialSlotDetail
- type PostUsersJSONBody
- type PostUsersJSONRequestBody
- type Server
- func (server Server) CreateEvent(ctx *gin.Context)
- func (server Server) CreateTimeSlotUser(ctx *gin.Context)
- func (server Server) DeleteEvent(ctx *gin.Context, eventId int)
- func (server Server) DeleteTimeSlotEvent(ctx *gin.Context, params DeleteTimeSlotEventParams)
- func (server Server) DeleteTimeSlotUser(ctx *gin.Context, params DeleteTimeSlotUserParams)
- func (server Server) GetEventByID(ctx *gin.Context, eventId int)
- func (server Server) GetMatchingTimeSlotsForEvent(ctx *gin.Context, eventId int)
- func (server Server) GetTimeSlotsByEvent(ctx *gin.Context, eventId int)
- func (server Server) GetTimeSlotsByUser(ctx *gin.Context, userId int)
- func (server Server) GetUsers(ctx *gin.Context)
- func (server Server) GetUsersId(ctx *gin.Context, id int)
- func (server Server) ListEvents(ctx *gin.Context)
- func (server Server) ListEventsByOrganizer(ctx *gin.Context, organizerId int)
- func (server Server) PostUsers(ctx *gin.Context)
- func (server Server) UpdateEvent(ctx *gin.Context, eventId int)
- func (server Server) UpdateTimeSlotEvent(ctx *gin.Context)
- func (server Server) UpdateTimeSlotUser(ctx *gin.Context)
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreateEvent(c *gin.Context)
- func (siw *ServerInterfaceWrapper) CreateTimeSlotUser(c *gin.Context)
- func (siw *ServerInterfaceWrapper) DeleteEvent(c *gin.Context)
- func (siw *ServerInterfaceWrapper) DeleteTimeSlotEvent(c *gin.Context)
- func (siw *ServerInterfaceWrapper) DeleteTimeSlotUser(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetEventByID(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetMatchingTimeSlotsForEvent(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetTimeSlotsByEvent(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetTimeSlotsByUser(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetUsers(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetUsersId(c *gin.Context)
- func (siw *ServerInterfaceWrapper) ListEvents(c *gin.Context)
- func (siw *ServerInterfaceWrapper) ListEventsByOrganizer(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostUsers(c *gin.Context)
- func (siw *ServerInterfaceWrapper) UpdateEvent(c *gin.Context)
- func (siw *ServerInterfaceWrapper) UpdateTimeSlotEvent(c *gin.Context)
- func (siw *ServerInterfaceWrapper) UpdateTimeSlotUser(c *gin.Context)
- type TimeSlot
- type TimeSlotUserResponse
- type TimeSlotsEventResponse
- type TimeSlotsUser
- type UpdateEventJSONRequestBody
- type UpdateEventResponse
- type UpdateTimeSlotEventJSONRequestBody
- type UpdateTimeSlotUserJSONRequestBody
- type UpdateTimeSlotsEventRequest
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router gin.IRouter, si ServerInterface)
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type AvailabilityResult ¶
type AvailabilityResult struct {
AllAvailableSlots []TimeSlot `json:"all_available_slots"`
PartialSlots []PartialSlotDetail `json:"partial_slots"`
}
func FindBestTimeSlots ¶
func FindBestTimeSlots(matrix [][]int, dividedSlots []TimeSlot, users []int) AvailabilityResult
type CreateEventJSONRequestBody ¶
type CreateEventJSONRequestBody = CreateEventRequest
CreateEventJSONRequestBody defines body for CreateEvent for application/json ContentType.
type CreateEventRequest ¶
type CreateEventRequest struct {
Duration int `json:"duration"`
EndTime []time.Time `json:"end_time"`
EventDescription string `json:"event_description"`
EventName string `json:"event_name"`
OrganizerId int `json:"organizer_id"`
StartTime []time.Time `json:"start_time"`
}
CreateEventRequest defines model for CreateEventRequest.
type CreateEventResponse ¶
type CreateEventResponse struct {
CreatedAt *time.Time `json:"created_at,omitempty"`
EventDescription string `json:"event_description"`
EventId *int `json:"event_id,omitempty"`
EventName string `json:"event_name"`
OrganizerId int `json:"organizer_id"`
}
CreateEventResponse defines model for CreateEventResponse.
type CreateTimeSlotUserJSONRequestBody ¶
type CreateTimeSlotUserJSONRequestBody = CreateTimeSlotUserRequest
CreateTimeSlotUserJSONRequestBody defines body for CreateTimeSlotUser for application/json ContentType.
type CreateTimeSlotUserRequest ¶
type CreateTimeSlotUserRequest struct {
EndTime []time.Time `json:"end_time"`
StartTime []time.Time `json:"start_time"`
UserId int `json:"user_id"`
}
CreateTimeSlotUserRequest defines model for CreateTimeSlotUserRequest.
type DeleteTimeSlotEventParams ¶
type DeleteTimeSlotEventParams struct {
Id int `form:"id" json:"id"`
EventId int `form:"event_id" json:"event_id"`
}
DeleteTimeSlotEventParams defines parameters for DeleteTimeSlotEvent.
type DeleteTimeSlotUserParams ¶
type DeleteTimeSlotUserParams struct {
Id int `form:"id" json:"id"`
UserId int `form:"user_id" json:"user_id"`
}
DeleteTimeSlotUserParams defines parameters for DeleteTimeSlotUser.
type Event ¶
type Event = []struct {
CreatedAt *time.Time `json:"created_at,omitempty"`
Duration *int `json:"duration,omitempty"`
EndTime *[]time.Time `json:"end_time,omitempty"`
EventDescription *string `json:"event_description,omitempty"`
EventId *int `json:"event_id,omitempty"`
EventName *string `json:"event_name,omitempty"`
OrganizerId *int `json:"organizer_id,omitempty"`
StartTime *[]time.Time `json:"start_time,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Event defines model for Event.
type GinServerOptions ¶
type GinServerOptions struct {
BaseURL string
Middlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
GinServerOptions provides options for the Gin server.
type MiddlewareFunc ¶
type PartialSlotDetail ¶
type PartialSlotDetail struct {
Slot TimeSlot `json:"slot"`
}
type PostUsersJSONBody ¶
type PostUsersJSONBody struct {
Name *string `json:"name,omitempty"`
}
PostUsersJSONBody defines parameters for PostUsers.
type PostUsersJSONRequestBody ¶
type PostUsersJSONRequestBody PostUsersJSONBody
PostUsersJSONRequestBody defines body for PostUsers for application/json ContentType.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (Server) CreateTimeSlotUser ¶
(POST /time-slots/user)
func (Server) DeleteEvent ¶
(DELETE /events/{event_id})
func (Server) DeleteTimeSlotEvent ¶
func (server Server) DeleteTimeSlotEvent(ctx *gin.Context, params DeleteTimeSlotEventParams)
(DELETE /time-slots/event)
func (Server) DeleteTimeSlotUser ¶
func (server Server) DeleteTimeSlotUser(ctx *gin.Context, params DeleteTimeSlotUserParams)
(DELETE /time-slots/user)
func (Server) GetEventByID ¶
(GET /events/{event_id})
func (Server) GetMatchingTimeSlotsForEvent ¶
(GET /matching-slots/event/{event_id})
func (Server) GetTimeSlotsByEvent ¶
(GET /time-slots/event)
func (Server) GetTimeSlotsByUser ¶
(GET /time-slots/user)
func (Server) GetUsersId ¶
(GET /users/{id})
func (Server) ListEventsByOrganizer ¶
(GET /events/organiser/{organiser_id}/)
func (Server) UpdateEvent ¶
(PUT /events/{event_id})
func (Server) UpdateTimeSlotEvent ¶
(PUT /time-slots/event)
func (Server) UpdateTimeSlotUser ¶
(PUT /time-slots/user)
type ServerInterface ¶
type ServerInterface interface {
// Create a new event
// (POST /events)
CreateEvent(c *gin.Context)
// List all events
// (GET /events/list)
ListEvents(c *gin.Context)
// List events by organizer
// (GET /events/organizer/{organizer_id})
ListEventsByOrganizer(c *gin.Context, organizerId int)
// Delete an event
// (DELETE /events/{event_id})
DeleteEvent(c *gin.Context, eventId int)
// Get an event by ID
// (GET /events/{event_id})
GetEventByID(c *gin.Context, eventId int)
// Update an event's name, description and duration
// (PUT /events/{event_id})
UpdateEvent(c *gin.Context, eventId int)
// Get matching time slots for event
// (GET /matching-slots/event/{event_id})
GetMatchingTimeSlotsForEvent(c *gin.Context, eventId int)
// Delete an event time slot
// (DELETE /time-slots/event)
DeleteTimeSlotEvent(c *gin.Context, params DeleteTimeSlotEventParams)
// Update an event time slot
// (PUT /time-slots/event)
UpdateTimeSlotEvent(c *gin.Context)
// Get time slots by event
// (GET /time-slots/event/{event_id})
GetTimeSlotsByEvent(c *gin.Context, eventId int)
// Delete a user time slot
// (DELETE /time-slots/user)
DeleteTimeSlotUser(c *gin.Context, params DeleteTimeSlotUserParams)
// Create time slots for a user
// (POST /time-slots/user)
CreateTimeSlotUser(c *gin.Context)
// Update a user time slot
// (PUT /time-slots/user)
UpdateTimeSlotUser(c *gin.Context)
// Get time slots by user
// (GET /time-slots/user/{user_id})
GetTimeSlotsByUser(c *gin.Context, userId int)
// List all users
// (GET /users)
GetUsers(c *gin.Context)
// Create a new user
// (POST /users)
PostUsers(c *gin.Context)
// Get a user by ID
// (GET /users/{id})
GetUsersId(c *gin.Context, id int)
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CreateEvent ¶
func (siw *ServerInterfaceWrapper) CreateEvent(c *gin.Context)
CreateEvent operation middleware
func (*ServerInterfaceWrapper) CreateTimeSlotUser ¶
func (siw *ServerInterfaceWrapper) CreateTimeSlotUser(c *gin.Context)
CreateTimeSlotUser operation middleware
func (*ServerInterfaceWrapper) DeleteEvent ¶
func (siw *ServerInterfaceWrapper) DeleteEvent(c *gin.Context)
DeleteEvent operation middleware
func (*ServerInterfaceWrapper) DeleteTimeSlotEvent ¶
func (siw *ServerInterfaceWrapper) DeleteTimeSlotEvent(c *gin.Context)
DeleteTimeSlotEvent operation middleware
func (*ServerInterfaceWrapper) DeleteTimeSlotUser ¶
func (siw *ServerInterfaceWrapper) DeleteTimeSlotUser(c *gin.Context)
DeleteTimeSlotUser operation middleware
func (*ServerInterfaceWrapper) GetEventByID ¶
func (siw *ServerInterfaceWrapper) GetEventByID(c *gin.Context)
GetEventByID operation middleware
func (*ServerInterfaceWrapper) GetMatchingTimeSlotsForEvent ¶
func (siw *ServerInterfaceWrapper) GetMatchingTimeSlotsForEvent(c *gin.Context)
GetMatchingTimeSlotsForEvent operation middleware
func (*ServerInterfaceWrapper) GetTimeSlotsByEvent ¶
func (siw *ServerInterfaceWrapper) GetTimeSlotsByEvent(c *gin.Context)
GetTimeSlotsByEvent operation middleware
func (*ServerInterfaceWrapper) GetTimeSlotsByUser ¶
func (siw *ServerInterfaceWrapper) GetTimeSlotsByUser(c *gin.Context)
GetTimeSlotsByUser operation middleware
func (*ServerInterfaceWrapper) GetUsers ¶
func (siw *ServerInterfaceWrapper) GetUsers(c *gin.Context)
GetUsers operation middleware
func (*ServerInterfaceWrapper) GetUsersId ¶
func (siw *ServerInterfaceWrapper) GetUsersId(c *gin.Context)
GetUsersId operation middleware
func (*ServerInterfaceWrapper) ListEvents ¶
func (siw *ServerInterfaceWrapper) ListEvents(c *gin.Context)
ListEvents operation middleware
func (*ServerInterfaceWrapper) ListEventsByOrganizer ¶
func (siw *ServerInterfaceWrapper) ListEventsByOrganizer(c *gin.Context)
ListEventsByOrganizer operation middleware
func (*ServerInterfaceWrapper) PostUsers ¶
func (siw *ServerInterfaceWrapper) PostUsers(c *gin.Context)
PostUsers operation middleware
func (*ServerInterfaceWrapper) UpdateEvent ¶
func (siw *ServerInterfaceWrapper) UpdateEvent(c *gin.Context)
UpdateEvent operation middleware
func (*ServerInterfaceWrapper) UpdateTimeSlotEvent ¶
func (siw *ServerInterfaceWrapper) UpdateTimeSlotEvent(c *gin.Context)
UpdateTimeSlotEvent operation middleware
func (*ServerInterfaceWrapper) UpdateTimeSlotUser ¶
func (siw *ServerInterfaceWrapper) UpdateTimeSlotUser(c *gin.Context)
UpdateTimeSlotUser operation middleware
type TimeSlotUserResponse ¶
type TimeSlotUserResponse struct {
EndTime *time.Time `json:"end_time,omitempty"`
Id *int `json:"id,omitempty"`
StartTime *time.Time `json:"start_time,omitempty"`
UserId *int `json:"user_id,omitempty"`
}
TimeSlotUserResponse defines model for TimeSlotUserResponse.
type TimeSlotsEventResponse ¶
type TimeSlotsEventResponse struct {
EndTime *time.Time `json:"end_time,omitempty"`
EventId *int `json:"event_id,omitempty"`
Id *int `json:"id,omitempty"`
StartTime *time.Time `json:"start_time,omitempty"`
}
TimeSlotsEventResponse defines model for TimeSlotsEventResponse.
type TimeSlotsUser ¶
type TimeSlotsUser struct {
EndTime time.Time `json:"end_time"`
Id int `json:"id"`
StartTime time.Time `json:"start_time"`
UserId int `json:"user_id"`
}
TimeSlotsUser defines model for TimeSlotsUser.
type UpdateEventJSONRequestBody ¶
type UpdateEventJSONRequestBody = UpdateEventResponse
UpdateEventJSONRequestBody defines body for UpdateEvent for application/json ContentType.
type UpdateEventResponse ¶
type UpdateEventResponse struct {
Duration int `json:"duration"`
EventDescription string `json:"event_description"`
EventName string `json:"event_name"`
}
UpdateEventResponse defines model for UpdateEventResponse.
type UpdateTimeSlotEventJSONRequestBody ¶
type UpdateTimeSlotEventJSONRequestBody = UpdateTimeSlotsEventRequest
UpdateTimeSlotEventJSONRequestBody defines body for UpdateTimeSlotEvent for application/json ContentType.
type UpdateTimeSlotUserJSONRequestBody ¶
type UpdateTimeSlotUserJSONRequestBody = TimeSlotsUser
UpdateTimeSlotUserJSONRequestBody defines body for UpdateTimeSlotUser for application/json ContentType.