Documentation ¶
Overview ¶
Package user implements the user handler.
Index ¶
- type ChangePasswordRequest
- type UserController
- func (u *UserController) ChangePassword(c *gin.Context)
- func (u *UserController) Create(c *gin.Context)
- func (u *UserController) Delete(c *gin.Context)
- func (u *UserController) DeleteCollection(c *gin.Context)
- func (u *UserController) Get(c *gin.Context)
- func (u *UserController) List(c *gin.Context)
- func (u *UserController) Update(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangePasswordRequest ¶
type ChangePasswordRequest struct { // Old password. // Required: true OldPassword string `json:"oldPassword" binding:"omitempty"` // New password. // Required: true NewPassword string `json:"newPassword" binding:"password"` }
ChangePasswordRequest defines the ChangePasswordRequest data format.
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
UserController create a user handler used to handle request for user resource.
func NewUserController ¶
func NewUserController(store store.Factory) *UserController
NewUserController creates a user handler.
func (*UserController) ChangePassword ¶
func (u *UserController) ChangePassword(c *gin.Context)
ChangePassword change the user's password by the user identifier.
func (*UserController) Create ¶
func (u *UserController) Create(c *gin.Context)
Create add new user to the storage.
func (*UserController) Delete ¶
func (u *UserController) Delete(c *gin.Context)
Delete delete an user by the user identifier. Only administrator can call this function.
func (*UserController) DeleteCollection ¶
func (u *UserController) DeleteCollection(c *gin.Context)
DeleteCollection batch delete users by multiple usernames. Only administrator can call this function.
func (*UserController) Get ¶
func (u *UserController) Get(c *gin.Context)
Get get an user by the user identifier.
func (*UserController) List ¶
func (u *UserController) List(c *gin.Context)
List list the users in the storage. Only administrator can call this function.
func (*UserController) Update ¶
func (u *UserController) Update(c *gin.Context)
Update update a user info by the user identifier.