Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendUser ¶
AppendUser add a user to specific group
AppendUser godoc @Summary Append User @Description Add a user to a group @ID groups.AppendUser @Security ApiKeyAuth @Tags Groups @Accept json @Produce json @Param user body userModificationRequest true "Username" @Param gid path uint true "Group ID" @Param Authorization header string true "Access Token" @Success 200 {object} usersResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /groups/{gid}/users [patch]
func Create ¶
Create receive a group object from request and update the specific record in DB
Create godoc @Summary Create Group @Description Create a group @ID groups.Create @Security ApiKeyAuth @Tags Groups @Accept json @Produce json @Param group body models.Group true "Group Object" @Param Authorization header string true "Access Token" @Success 200 {object} createResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /groups [post]
func Destroy ¶
Destroy receive a id from request and delete in from DB
Destroy godoc @Summary Destroy Group @Description Destroy Group according to gid @ID groups.Destroy @Security ApiKeyAuth @Tags Groups @Accept json @Produce json @Param gid path uint true "Group ID" @Param Authorization header string true "Access Token" @Success 200 {object} destroyResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /groups/{gid} [delete]
func Index ¶
Index handle GET /groups which simply list out all groups
Index godoc @Summary All Groups @Description Simply list out all groups @ID groups.Index @Security ApiKeyAuth @Tags Groups @Accept json @Produce json @Param Authorization header string true "Access Token" @Success 200 {object} indexResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /groups [get]
func RemoveUser ¶
RemoveUser remove a user from a specific group
RemoveUser godoc @Summary Remove User @Description Remove a user from a group @ID groups.RemoveUser @Security ApiKeyAuth @Tags Groups @Accept json @Produce json @Param gid path uint true "Group ID" @Param username path string true "Username" @Param Authorization header string true "Access Token" @Success 200 {object} usersResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /groups/{gid}/users/{username} [delete]
func Show ¶
Show receive a id from request url and return the group of the specific id
Show godoc @Summary Show Group @Description Show Group according to gid @ID groups.Show @Security ApiKeyAuth @Tags Groups @Accept json @Produce json @Param gid path uint true "Group ID" @Param Authorization header string true "Access Token" @Success 200 {object} showResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /groups/{gid} [get]
func Update ¶
Update receive a id and a group object from request and update the specific record in DB
Update godoc @Summary Update Group @Description Update a group @ID groups.Update @Security ApiKeyAuth @Tags Groups @Accept json @Produce json @Param gid path uint true "Group ID" @Param group body models.Group true "Group Object" @Param Authorization header string true "Access Token" @Success 200 {object} updateResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /groups/{gid} [patch]
func Users ¶
Users return all users a group have
Users godoc @Summary Get Group Users @Description Simply list out all users belong to a certain group @ID groups.Users @Security ApiKeyAuth @Tags Groups @Accept json @Produce json @Param gid path uint true "Group ID" @Param Authorization header string true "Access Token" @Success 200 {object} usersResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /groups/{gid}/users [get]
Types ¶
This section is empty.