groups

package
v0.0.0-...-aa13637 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendUser

func AppendUser(c *gin.Context)

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

func Create(c *gin.Context)

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

func Destroy(c *gin.Context)

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

func Index(c *gin.Context)

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

func RemoveUser(c *gin.Context)

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

func Show(c *gin.Context)

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

func Update(c *gin.Context)

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

func Users(c *gin.Context)

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.

Jump to

Keyboard shortcuts

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