model

package
v0.0.0-...-2bf1368 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserStatusOnline  = 1
	UserStatusOffline = iota
)

Variables

View Source
var ErrInvalidParams error = fmt.Errorf("ErrInvalidParams")
View Source
var ErrInvalidPasswd error = fmt.Errorf("ErrInvalidPasswd")
View Source
var ErrUserExist error = fmt.Errorf("ErrUserExist")
View Source
var ErrUserNotExist error = fmt.Errorf("ErrUserNotExist")
View Source
var (
	UserTable = "users"
)

Functions

This section is empty.

Types

type User

type User struct {
	UserId    int    `json:"user_id"`
	Passwd    string `json:"passwd"`
	Nick      string `json:"nick"`
	Sex       string `json:"sex"`
	Header    string `json:"header"`
	LastLogin string `json:"last_login"`
	Status    int    `json:"status"`
}

type UserMgr

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

func NewUserMgr

func NewUserMgr(pool *redis.Pool) (mgr *UserMgr)

func (*UserMgr) Login

func (p *UserMgr) Login(id int, passwd string) (user *User, err error)

func (*UserMgr) Register

func (p *UserMgr) Register(user *User) (err error)

Jump to

Keyboard shortcuts

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