dao

package
v0.0.0-...-c242be3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	Mysql *Mysql
	// contains filtered or unexported fields
}

func NewDao

func NewDao() (dao *Dao)

func (*Dao) GetOnline

func (dao *Dao) GetOnline(ctx context.Context, uid int64) (res int, err error)

func (*Dao) RegisterAccess

func (dao *Dao) RegisterAccess(ctx context.Context, uid int64, accessAddr string) (err error)

func (*Dao) RouterAccess

func (dao *Dao) RouterAccess(ctx context.Context, uid int64) (res string, err error)

func (*Dao) SetOnline

func (dao *Dao) SetOnline(ctx context.Context, uid int64) (err error)

func (*Dao) SetToken

func (dao *Dao) SetToken(ctx context.Context, uid int64, token string) (err error)

func (*Dao) Token

func (dao *Dao) Token(ctx context.Context, uid int64) (res string, err error)

type Mysql

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

func NewMysql

func NewMysql() (mysql *Mysql)

func (*Mysql) GetUser

func (mysql *Mysql) GetUser(c context.Context, uid int64) (res *model.User, err error)

func (*Mysql) GetUsersByGroupID

func (mysql *Mysql) GetUsersByGroupID(c context.Context, gid int64) (uids []int64, err error)

func (*Mysql) InsertGroup

func (mysql *Mysql) InsertGroup(c context.Context, gid, ownerID int64, groupName string) (rows int64, err error)

func (*Mysql) InsertUser

func (mysql *Mysql) InsertUser(c context.Context, uid int64, userName, password string) (rows int64, err error)

func (*Mysql) InsertUserGroup

func (mysql *Mysql) InsertUserGroup(c context.Context, uid, gid int64) (rows int64, err error)

func (*Mysql) InsertUserMsgID

func (mysql *Mysql) InsertUserMsgID(c context.Context, uid, currentMsgID, totalMsgID int64) (rows int64, err error)

Jump to

Keyboard shortcuts

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