Documentation
¶
Index ¶
- func SetupRoutes(router *gin.Engine, database *mongo.Database, ...)
- func SetupRoutesWithMock(router *gin.Engine, calendarRepo repositories.CalendarRepositoryInterface, ...)
- type Controller
- func (c *Controller) CreateCalendar(ctx *gin.Context)
- func (c *Controller) DeleteCalendar(ctx *gin.Context)
- func (c *Controller) GetAllCalendars(ctx *gin.Context)
- func (c *Controller) GetCalendarByID(ctx *gin.Context)
- func (c *Controller) GetCalendarsSince(ctx *gin.Context)
- func (c *Controller) UpdateCalendar(ctx *gin.Context)
- type CreateCalendarRequest
- type PaginatedCalendarResponse
- type UpdateCalendarRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupRoutes ¶
func SetupRoutes(router *gin.Engine, database *mongo.Database, amqpService amqpinterfaces.AMQPServiceInterface)
SetupRoutes sets up calendar routes
func SetupRoutesWithMock ¶
func SetupRoutesWithMock(router *gin.Engine, calendarRepo repositories.CalendarRepositoryInterface, amqpService amqpinterfaces.AMQPServiceInterface)
SetupRoutesWithMock sets up routes with mocks for testing
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller handles calendar operations
func NewCalendarController ¶
func NewCalendarController(calendarRepo repositories.CalendarRepositoryInterface, amqpService amqpinterfaces.AMQPServiceInterface) *Controller
NewCalendarController creates a new calendar controller
func (*Controller) CreateCalendar ¶
func (c *Controller) CreateCalendar(ctx *gin.Context)
CreateCalendar creates a new calendar
func (*Controller) DeleteCalendar ¶
func (c *Controller) DeleteCalendar(ctx *gin.Context)
DeleteCalendar deletes a calendar
func (*Controller) GetAllCalendars ¶
func (c *Controller) GetAllCalendars(ctx *gin.Context)
GetAllCalendars returns all calendars for the user with pagination
func (*Controller) GetCalendarByID ¶
func (c *Controller) GetCalendarByID(ctx *gin.Context)
GetCalendarByID retrieves a calendar by id
func (*Controller) GetCalendarsSince ¶
func (c *Controller) GetCalendarsSince(ctx *gin.Context)
GetCalendarsSince retrieves calendars updated since a specific date
func (*Controller) UpdateCalendar ¶
func (c *Controller) UpdateCalendar(ctx *gin.Context)
UpdateCalendar updates an existing calendar
type CreateCalendarRequest ¶
type CreateCalendarRequest struct {
Calendar *models.Calendar `json:"calendar" binding:"required"`
}
CreateCalendarRequest is the request payload for creating a calendar
type PaginatedCalendarResponse ¶
type PaginatedCalendarResponse struct {
Calendars []*models.Calendar `json:"calendars"`
TotalCount int64 `json:"total_count"`
Page int64 `json:"page,omitempty"`
Size int64 `json:"size,omitempty"`
TotalPages int64 `json:"total_pages"`
}
PaginatedCalendarResponse represents paginated calendars
type UpdateCalendarRequest ¶
type UpdateCalendarRequest struct {
Calendar *models.Calendar `json:"calendar" binding:"required"`
}
UpdateCalendarRequest is the payload for updating a calendar