user

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2020 Talhuang<talhuang1231@gmail.com>. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.

Index

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)

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.

Jump to

Keyboard shortcuts

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