users

package
v0.0.0-...-7b45942 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminizeUser

func AdminizeUser(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

func CreateUser

func CreateUser(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@Tags User (Admin) @Summary Create User @Description Create a new user. @Router /v1/auth/admin/user [post] @Security BearerAuth @Accept application/json @Accept application/msgpack @Produce application/json @Produce application/msgpack @Param form body object{firstName=string,lastName=string,username=string,email=string,password=string,passwordConfirm=string,roles=[]int} true "Create user form" @Success 200 {object} object{data=object{uid=string,username=string,email=string,firstName=string,lastName=string,roles=[]object{level=int,name=string,since=string},createdAt=time,updatedAt=time}} @Failure 401 {object} object{message=string} @Failure 422 {object} object{message=string} @Failure 500 {object} object{message=string}

func DeadminizeUser

func DeadminizeUser(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

func DeleteUser

func DeleteUser(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@Tags User (Admin) @Summary Delete User (Permanent) @Description Delete a user (permanent). @Router /v1/auth/admin/user/{uid}/permanent [delete] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "User's UID" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 422 {object} object{message=string} @Failure 500 {object} object{message=string}

func DetrashUser

func DetrashUser(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@Tags User (Admin) @Summary Restore user (Soft) @Description Restore a deleted user (soft-deleted). @Router /v1/auth/admin/user/{uid}/detrash [put] @Router /v1/auth/admin/user/{uid}/detrash [patch] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "User's UID" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 422 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetPublicUser

func GetPublicUser(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@Tags User (Public) @Summary Get Public User @Description Get a user that available publicly. @Router /v1/user/{uid} [get] @Produce application/json @Produce application/msgpack @Param uid path string true "User's UID or slug" @Success 200 {object} object{data=object{uid=string,username=string,email=string,firstName=string,lastName=string}} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetPublicUsers

func GetPublicUsers(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@Tags Users (Public) @Summary Get Public Users @Description Get users that available publicly. @Router /v1/users [get] @Produce application/json @Produce application/msgpack @Param show query int false "Number of data to be shown." @Param page query int false "Selected page of data." @Param order query string false "Selected field to order data with." @Param asc query string false "Ascending or descending, e.g.: ?asc=false." @Success 200 {object} object{data=[]object{uid=string,username=string,email=string,firstName=string,lastName=string}} @Success 204 @Failure 500 {object} object{message=string}

func GetUser

func GetUser(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@Tags User (Admin) @Summary Get User @Description Get a user. @Router /v1/auth/admin/user/{uid} [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "User's UID" @Success 200 {object} object{data=object{uid=string,username=string,email=string,firstName=string,lastName=string,roles=[]object{level=int,name=string,since=string},createdAt=time,updatedAt=time}} @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetUsers

func GetUsers(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@Tags User (Admin) @Summary Get Users @Description Get users. @Router /v1/auth/admin/users [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param show query int false "Number of data to be shown." @Param page query int false "Selected page of data." @Param order query string false "Selected field to order data with." @Param asc query string false "Ascending or descending, e.g.: ?asc=false." @Success 200 {object} object{data=[]object{uid=string,username=string,email=string,firstName=string,lastName=string,roles=[]object{level=int,name=string,since=string},createdAt=time,updatedAt=time}} @Success 204 @Failure 401 {object} object{message=string} @Failure 500 {object} object{message=string}

func GetUsersStats

func GetUsersStats(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@Tags User (Admin) @Summary Get Users Stats @Description Get users's stats. @Router /v1/auth/admin/users/stats [get] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param show query int false "Number of data to be shown." @Param page query int false "Selected page of data." @Param order query string false "Selected field to order data with." @Param asc query string false "Ascending or descending, e.g.: ?asc=false." @Success 200 {object} object{data=object{currentPage=int,totalPages=int,itemsPerPage=int,totalItems=int}} @Failure 401 {object} object{message=string} @Failure 500 {object} object{message=string}

func TrashUser

func TrashUser(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@Tags User (Admin) @Summary Delete User (Soft) @Description Delete a user (soft-deleted). @Router /v1/auth/admin/user/{uid} [delete] @Security BearerAuth @Produce application/json @Produce application/msgpack @Param uid path string true "User's UID" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 422 {object} object{message=string} @Failure 500 {object} object{message=string}

func UpdateUser

func UpdateUser(
	maxCtxDuration time.Duration,
	svc *service.Service,
) (handler gin.HandlerFunc)

@Tags User (Admin) @Summary Update User @Description Update User @Router /v1/auth/admin/user/{uid} [put] @Router /v1/auth/admin/user/{uid} [patch] @Security BearerAuth @Accept application/json @Accept application/msgpack @Produce application/json @Produce application/msgpack @Param uid path string true "User's UID" @Param form body object{firstName=string,lastName=string,username=string,email=string,password=string,passwordConfirm=string,roles=[]int} true "Update user form" @Success 204 @Failure 401 {object} object{message=string} @Failure 404 {object} object{message=string} @Failure 422 {object} object{message=string} @Failure 500 {object} object{message=string}

Types

This section is empty.

Jump to

Keyboard shortcuts

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