exp

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromCacheHit

func PromCacheHit(name string)

PromCacheHit prometheus cache hit count.

func PromCacheMiss

func PromCacheMiss(name string)

PromCacheMiss prometheus cache hit count.

func PromError

func PromError(name string)

PromError prometheus error count.

func PromInfo

func PromInfo(name string)

PromInfo prometheus info count.

Types

type Dao

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

Dao exp dao

func NewExpDao

func NewExpDao(c *conf.Config) (dao *Dao)

NewExpDao init mysql db

func (*Dao) AddRexp

func (d *Dao) AddRexp(c context.Context, uid int64, rexp int64) (affect int64, err error)

AddRexp 添加主播经验

func (*Dao) AddUexp

func (d *Dao) AddUexp(c context.Context, uid int64, uexp int64) (affect int64, err error)

AddUexp 添加用户经验

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) DelExpFromMemCache

func (d *Dao) DelExpFromMemCache(c context.Context, mid int64) (err error)

DelExpFromMemCache 删除获取用户经验cache,不支持批量

func (*Dao) Exp

func (d *Dao) Exp(c context.Context, uid int64) (exp *expm.Exp, err error)

Exp 查询一条记录

func (*Dao) GetExpFromMemCache

func (d *Dao) GetExpFromMemCache(ctx context.Context, mids []int64) (expList map[int64]*expModel.LevelInfo, missedUids []int64, err error)

GetExpFromMemCache 对外接口

func (*Dao) InitExp

func (d *Dao) InitExp(c context.Context, uid int64, uexp int64, rexp int64) (row int64, err error)

InitExp 初始化用户经验,用于首次查询

func (*Dao) MultiExp

func (d *Dao) MultiExp(c context.Context, uids []int64) (exps []*expm.Exp, err error)

MultiExp 批量查询

func (*Dao) Ping

func (d *Dao) Ping(ctx context.Context) error

Ping dao ping

func (*Dao) SetExpListCache

func (d *Dao) SetExpListCache(c context.Context, expList map[int64]*expModel.LevelInfo) (err error)

SetExpListCache 批量设置用户经验cache

Jump to

Keyboard shortcuts

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