Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface { List(ctx *gin.Context) Find(ctx *gin.Context) Create(ctx *gin.Context) Update(ctx *gin.Context) Delete(ctx *gin.Context) ResetPassword(ctx *gin.Context) }
Handler defines methods for users to interact with the server
type Users ¶
Users defines the handler for all user routes.
func (*Users) Create ¶
Create
Returns http.StatusOK if the user was created. Returns http.StatusInternalServerError if there was an error creating the user. Returns http.StatusBadRequest if the the validation failed or a user already exists.
func (*Users) Delete ¶
Delete
Returns http.StatusOK if the user was deleted. Returns http.StatusInternalServerError if there was an error deleting the user. Returns http.StatusBadRequest if the the user wasn't found or no ID was passed.
func (*Users) Find ¶
Find
Returns http.StatusOK if the user was obtained. Returns http.StatusInternalServerError if there as an error obtaining the user. Returns http.StatusBadRequest if the ID wasn't passed or failed to convert.
func (*Users) List ¶
List
Returns http.StatusOK if the users were obtained successfully. Returns http.StatusInternalServerError if there was an error getting the users. Returns http.StatusBadRequest if there was conflict or the request was invalid.
func (*Users) ResetPassword ¶
ResetPassword
Returns http.StatusOK if the reset password was successful. Returns http.StatusInternalServerError if there was an error resetting the user failed. Returns http.StatusBadRequest if the the user wasn't found, no ID was passed or validation failed.