Documentation ¶ Index ¶ Variables type Manager func NewManager() *Manager func (m *Manager) AddUser(user *User) int32 func (m *Manager) GetUser(account string) (*User, error) func (m *Manager) HasUser(account string) bool type User 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"` } Source Files ¶ View all Source files user.go Click to show internal directories. Click to hide internal directories.