user

package
v0.0.0-...-e849032 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFoundUser = errors.New("not found user")
)

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) AddUser

func (m *Manager) AddUser(user *User) int32

AddUser 添加用户

func (*Manager) GetUser

func (m *Manager) GetUser(account string) (*User, error)

GetUser 获取用户

func (*Manager) HasUser

func (m *Manager) HasUser(account string) bool

HasUser 是否存在用户

type User

type User struct {
	ID       int32  `json:"id"`
	Nickname string `json:"nickname"`
	Account  string `json:"account"`
	Password string `json:"password"`
	Age      int    `json:"age"`
}

Jump to

Keyboard shortcuts

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