handler

package
v1.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResponseMessageInternalServerError = ResponseMessage("sorry, that went wrong on the server side")
	ResponseMessageNotFound            = ResponseMessage("entity not found")
	ResponseMessageNoID                = ResponseMessage("missing ID in request")
	ResponseMessageUnauthorized        = ResponseMessage("Unauthorized")
	ResponseMessageUnknownType         = ResponseMessage("type is not known")
	ResponseMessageMissingURL          = ResponseMessage("url is missing")
	ResponseMessageInvalidData         = ResponseMessage("invalid data")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CalendarHandler

type CalendarHandler struct {
	// contains filtered or unexported fields
}

CalendarHandler groups the handlers for the calendars

func NewCalendarHandler

func NewCalendarHandler(database types.Database) *CalendarHandler

NewCalendarHandler makes a new handler

func (*CalendarHandler) GetCalendarICal

func (calendarHandler *CalendarHandler) GetCalendarICal(ctx *gin.Context)

GetCalendarICal godoc @Summary Get calendar (iCal) @Description Get calendar as iCal @Tags Calendars @Produce plain @Param id path int true "Calendar ID" @Param token query string true "authentication token" @Success 200 "" @Failure 401 {object} types.MessageErrorResponse @Failure 500 "" @Router /calendar/{id}/ical [get]

func (*CalendarHandler) GetCalendars

func (calendarHandler *CalendarHandler) GetCalendars(ctx *gin.Context)

GetCalendars godoc @Summary List all calendars @Description List all available calendars @Tags Calendars @Security AdminAuthentication @Produce json @Success 200 {object} types.DataResponse{data=[]calendarResponse} @Failure 401 {object} types.MessageErrorResponse @Failure 500 "" @Router /calendar [get]

func (*CalendarHandler) PatchCalender

func (calendarHandler *CalendarHandler) PatchCalender(ctx *gin.Context)

PatchCalender godoc @Summary Renew calendar secret @Description Regenerates the calendars secret @Tags Calendars @Security AdminAuthentication @Produce json @Param id path int true "Calendar ID" @Success 200 {object} types.MessageSuccessResponse @Failure 401 {object} types.MessageErrorResponse @Failure 422 {object} types.MessageErrorResponse "Input validation failed" @Failure 404 {object} types.MessageErrorResponse @Failure 500 "" @Router /calendar/{id} [patch]

type DatabaseHandler

type DatabaseHandler struct {
	// contains filtered or unexported fields
}

DatabaseHandler groups the handlers for the calendars

func NewDatabaseHandler

func NewDatabaseHandler(database types.Database) *DatabaseHandler

NewDatabaseHandler makes a new handler

func (*DatabaseHandler) DeleteChannel

func (databaseHandler *DatabaseHandler) DeleteChannel(ctx *gin.Context)

DeleteChannel godoc @Summary Delete a channel @Description Delete a channel and remove access for this user. If the bot is open for invites the user can simply start a new chat. @Tags Channels @Security AdminAuthentication @Produce json @Param id path string true "Internal channel ID" @Success 200 {object} types.MessageSuccessResponse @Failure 401 {object} types.MessageErrorResponse @Failure 404 {object} types.MessageErrorResponse @Failure 422 {object} types.MessageErrorResponse "Input validation failed" @Failure 500 "" @Router /channel/{id} [delete]

func (*DatabaseHandler) DeleteChannelThirdPartyResource added in v1.8.4

func (databaseHandler *DatabaseHandler) DeleteChannelThirdPartyResource(ctx *gin.Context)

DeleteChannelThirdPartyResource godoc @Summary Delete a third party resource @Description Delete a third party resource. @Tags Channels @Security AdminAuthentication @Produce json @Param id path string true "Internal channel ID" @Param id2 path string true "Internal third party resource ID" @Param payload body postChannelThirdPartyResourceData true "payload" @Success 200 {object} types.MessageSuccessResponse @Failure 401 {object} types.MessageErrorResponse @Failure 404 {object} types.MessageErrorResponse @Failure 422 {object} types.MessageErrorResponse "Input validation failed" @Failure 500 "" @Router /channel/{id}/thirdpartyresources/{id2} [delete]

func (*DatabaseHandler) GetChannelThirdPartyResource added in v1.8.4

func (databaseHandler *DatabaseHandler) GetChannelThirdPartyResource(ctx *gin.Context)

GetChannelThirdPartyResource godoc @Summary Get third party resources @Description Lists all third party resources in this channel. @Tags Channels @Security AdminAuthentication @Produce json @Param id path string true "Internal channel ID" @Success 200 {object} types.DataResponse{data=[]thirdPartyResourceResponse} @Failure 401 {object} types.MessageErrorResponse @Failure 404 {object} types.MessageErrorResponse @Failure 422 {object} types.MessageErrorResponse "Input validation failed" @Failure 500 "" @Router /channel/{id}/thirdpartyresources [get]

func (*DatabaseHandler) GetChannels

func (databaseHandler *DatabaseHandler) GetChannels(ctx *gin.Context)

GetChannels godoc @Summary List all channels @Description List all channels @Tags Channels @Security AdminAuthentication @Produce json @Success 200 {object} types.DataResponse{data=[]channelResponse} @Failure 401 {object} types.MessageErrorResponse @Failure 500 "" @Router /channel [get]

func (*DatabaseHandler) GetUsers

func (databaseHandler *DatabaseHandler) GetUsers(ctx *gin.Context)

GetUsers godoc @Summary Get all Users @Description Lists all users and their channels @Tags Users @Security AdminAuthentication @Produce json @Param include[] query []string false "Comma separated list of additional users to include. One of: blocked" collectionFormat(multi) @Success 200 {object} types.DataResponse{data=[]userResponse} @Failure 401 {object} types.MessageErrorResponse @Failure 422 {object} types.MessageErrorResponse "Input validation failed" @Failure 500 "" @Router /user [get]

func (*DatabaseHandler) PostChannelThirdPartyResource added in v1.8.4

func (databaseHandler *DatabaseHandler) PostChannelThirdPartyResource(ctx *gin.Context)

PostChannelThirdPartyResource godoc @Summary Add a third party resource to a channel @Description Add a third party resource to a channel. @Tags Channels @Security AdminAuthentication @Produce json @Param id path string true "Internal channel ID" @Param payload body postChannelThirdPartyResourceData true "payload" @Success 200 {object} types.MessageSuccessResponse @Failure 401 {object} types.MessageErrorResponse @Failure 404 {object} types.MessageErrorResponse @Failure 422 {object} types.MessageErrorResponse "Input validation failed" @Failure 500 "" @Router /channel/{id}/thirdpartyresources [post]

func (*DatabaseHandler) PutUser

func (databaseHandler *DatabaseHandler) PutUser(ctx *gin.Context)

PutUser godoc @Summary Change a User @Description Changes the settings or data for a matrix user. @Tags Users @Security AdminAuthentication @Accept json @Produce json @Param id path string true "Matrix account ID, use URL encoding" @Param payload body putUserData true "payload" @Success 200 {object} types.MessageSuccessResponse @Failure 401 {object} types.MessageErrorResponse @Failure 422 {object} types.MessageErrorResponse "Input validation failed" @Failure 500 "" @Router /user/{id} [put]

type ResponseMessage

type ResponseMessage string

ResponseMessage is a data type for response messages send out via the api.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL