center

package
v0.0.0-...-9be9f3c Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserExist             = errors.New("user exist")
	ErrNotFound              = errors.New("not found")
	ErrAmountMustBigThanZero = errors.New("amount must big than zero")
	ErrCoinNotEnough         = errors.New("coin not enough")
	ErrGemNotEnough          = errors.New("gem not enough")
	ErrGiftNotEnough         = errors.New("gift not enough")
	ErrBankNotEnough         = errors.New("bank balance not enough")
	ErrPwdEmpty              = errors.New("password can not be empty")
	ErrPwdNotSet             = errors.New("password not set yet")
	ErrPwdWrong              = errors.New("wrong password")
	ErrNickEmpty             = errors.New("nick can not be empty")
	ErrSetValueExist         = errors.New("can not use the same value")
)

Functions

This section is empty.

Types

type Account

type Account struct {
	Id          int64
	Uid         int64
	Unionid     string
	Uuid        string
	Username    string
	Password    string
	Nick        string
	Gender      bool
	Addr        string
	Avatar      string
	Isguest     bool
	Condays     int32
	Signdate    int64
	Vipsigndate int64
	Status      bool
	Mtime       int64
	Ctime       int64
	Bankpwd     string
	Forbid      string
	Imsi        string
	Imei        string
	Mac         string
	Did         string
	Psystem     string
	Pmodel      string
	Others      map[string]int32
}

type AccountInfo

type AccountInfo struct {
	Accounts_uid int64
	Token        string
	Coin         int64
	Gem          int32
	Bank         int64
	Growth       int32
	Level        int32
	Viptype      int32
	Vipexpiry    int64
	Voucher      int32
	Online       int32
	Props        map[string]int32
	Gifts        map[string]int32
	Medals       map[string]int32
	Friends      []int64
	Tags         []string
	Records      map[string]int32
}

type DBRepository

type DBRepository interface {
	FindUserById(id int64) (*User, error)
}

type MQRepository

type MQRepository interface {
	SaveUser(user *User) (err error)
}

type User

type User struct {
	Account
	AccountInfo
	sync.RWMutex
	MQ MQRepository
}

type UserManager

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

func NewUserManager

func NewUserManager(dbRepository DBRepository, mqRepository MQRepository) *UserManager

func (*UserManager) AddUser

func (um *UserManager) AddUser(uid int64, user *User, mq MQRepository) error

func (*UserManager) GetUser

func (um *UserManager) GetUser(uid int64) (user *User, err error)

func (*UserManager) IsUserExist

func (um *UserManager) IsUserExist(uid int64) bool

func (*UserManager) RemoveUser

func (um *UserManager) RemoveUser(uid int64) error

type UserMap

type UserMap map[int64]*User

Jump to

Keyboard shortcuts

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