dao

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: 16 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 {
	// contains filtered or unexported fields
}

Dao dao

func New

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

New init mysql db

func (*Dao) AddCacheFrozen

func (d *Dao) AddCacheFrozen(c context.Context, mid int64, vipFrozenFlag int) (err error)

AddCacheFrozen add cache frozen.

func (*Dao) AddCacheInfo

func (d *Dao) AddCacheInfo(c context.Context, mid int64, v *model.VipUserInfo) (err error)

AddCacheInfo add vip info cache.

func (*Dao) AddCacheInfos

func (d *Dao) AddCacheInfos(c context.Context, vs map[int64]*model.VipUserInfo) (err error)

AddCacheInfos set account infos cache.

func (*Dao) CacheInfo

func (d *Dao) CacheInfo(c context.Context, mid int64) (v *model.VipUserInfo, err error)

CacheInfo get vip info cache.

func (*Dao) CacheInfos

func (d *Dao) CacheInfos(c context.Context, mids []int64) (res map[int64]*model.VipUserInfo, err error)

CacheInfos multi get account info from cache.

func (*Dao) CacheVipFrozen

func (d *Dao) CacheVipFrozen(c context.Context, mid int64) (val int, err error)

CacheVipFrozen get vip frozen flag.

func (*Dao) CacheVipFrozens

func (d *Dao) CacheVipFrozens(c context.Context, mids []int64) (res map[int64]int, err error)

CacheVipFrozens multi get vip frozens from cache.

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) DelInfoCache

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

DelInfoCache del vip info cache.

func (*Dao) Info

func (d *Dao) Info(c context.Context, id int64) (res *model.VipUserInfo, err error)

Info get data from cache if miss will call source method, then add to cache.

func (*Dao) Infos

func (d *Dao) Infos(c context.Context, keys []int64) (res map[int64]*model.VipUserInfo, err error)

Infos get data from cache if miss will call source method, then add to cache.

func (*Dao) Ping

func (d *Dao) Ping(c context.Context) (err error)

Ping dao ping

func (*Dao) RawInfo

func (d *Dao) RawInfo(c context.Context, mid int64) (r *model.VipUserInfo, err error)

RawInfo select user info by mid.

func (*Dao) RawInfos

func (d *Dao) RawInfos(c context.Context, mids []int64) (res map[int64]*model.VipUserInfo, err error)

RawInfos get user infos.

Jump to

Keyboard shortcuts

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