user

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUser

func CreateUser(args *User, logger *zap.SugaredLogger) (*models.User, error)

func DeleteUserByUID

func DeleteUserByUID(uid string, logger *zap.SugaredLogger) error

func Reset

func Reset(args *ResetParams, logger *zap.SugaredLogger) error

func SearchAndSyncUser

func SearchAndSyncUser(ldapId string, logger *zap.SugaredLogger) error

func SyncUser

func SyncUser(syncUserInfo *SyncUserInfo, logger *zap.SugaredLogger) (*models.User, error)

func UpdatePassword

func UpdatePassword(args *Password, logger *zap.SugaredLogger) error

func UpdateUser

func UpdateUser(uid string, args *UpdateUserInfo, _ *zap.SugaredLogger) error

Types

type Password

type Password struct {
	Uid         string `json:"uid"`
	OldPassword string `json:"oldPassword"`
	NewPassword string `json:"newPassword"`
}

type QueryArgs

type QueryArgs struct {
	Name         string   `json:"name,omitempty"`
	Account      string   `json:"account,omitempty"`
	IdentityType string   `json:"identity_type,omitempty"`
	UIDs         []string `json:"uids,omitempty"`
	PerPage      int      `json:"per_page,omitempty"`
	Page         int      `json:"page,omitempty"`
}

type ResetParams

type ResetParams struct {
	Uid      string `json:"uid"`
	Password string `json:"password"`
}

type RetrieveResp

type RetrieveResp struct {
	Email string `json:"email"`
}

func Retrieve

func Retrieve(account string, logger *zap.SugaredLogger) (*RetrieveResp, error)

type SyncUserInfo

type SyncUserInfo struct {
	Account      string `json:"account"`
	IdentityType string `json:"identityType"`
	Name         string `json:"name"`
	Email        string `json:"email"`
}

type UpdateUserInfo

type UpdateUserInfo struct {
	Name  string `json:"name,omitempty"`
	Email string `json:"email,omitempty"`
	Phone string `json:"phone,omitempty"`
}

type User

type User struct {
	Name     string `json:"name"`
	Password string `json:"password"`
	Email    string `json:"email"`
	Account  string `json:"account"`
	Phone    string `json:"phone,omitempty"`
}

type UserInfo

type UserInfo struct {
	LastLoginTime int64  `json:"lastLoginTime"`
	Uid           string `json:"uid"`
	Name          string `json:"name"`
	IdentityType  string `gorm:"default:'unknown'" json:"identity_type"`
	Email         string `json:"email"`
	Phone         string `json:"phone"`
	Account       string `json:"account"`
}

func GetUser

func GetUser(uid string, logger *zap.SugaredLogger) (*UserInfo, error)

type UsersResp

type UsersResp struct {
	Users      []UserInfo `json:"users"`
	TotalCount int64      `json:"totalCount"`
}

func SearchUserByAccount

func SearchUserByAccount(args *QueryArgs, logger *zap.SugaredLogger) (*UsersResp, error)

func SearchUsers

func SearchUsers(args *QueryArgs, logger *zap.SugaredLogger) (*UsersResp, error)

func SearchUsersByUIDs

func SearchUsersByUIDs(uids []string, logger *zap.SugaredLogger) (*UsersResp, error)

Jump to

Keyboard shortcuts

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