guard

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

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 GuardDao

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

GuardDao vip dao

func NewGuardDao

func NewGuardDao(c *conf.Config) (dao *GuardDao)

NewGuardDao init mysql db

func (*GuardDao) AddGuard

func (d *GuardDao) AddGuard(ctx context.Context, req *model.GuardBuy) (err error)

AddGuard insert guard

func (*GuardDao) ClearCache

func (d *GuardDao) ClearCache(ctx context.Context, uid int64, ruid int64) (err error)

ClearCache delete cache for guard

func (*GuardDao) Close

func (d *GuardDao) Close()

Close close the resource.

func (*GuardDao) DelDHHFromRedis

func (d *GuardDao) DelDHHFromRedis(c context.Context, mid int64) (err error)

DelDHHFromRedis 删除获取用户守护cache,不支持批量

func (*GuardDao) GetAnchorAllGuardFromRedis

func (d *GuardDao) GetAnchorAllGuardFromRedis(ctx context.Context, anchorUIDs []int64) (dhhList []*dahanghaiModel.DaHangHaiRedis2, err error)

GetAnchorAllGuardFromRedis 获取单个主播的全量被守护信息(同一个主播仅获取最高级别)

func (*GuardDao) GetAnchorRecentTopGuardCache

func (d *GuardDao) GetAnchorRecentTopGuardCache(ctx context.Context, uid int64) (resp map[int64]int64, err error)

GetAnchorRecentTopGuardCache 获取单个主播最近的总督信息

func (*GuardDao) GetByAnchorUIDs

func (d *GuardDao) GetByAnchorUIDs(c context.Context, uids []int64) (dhhs []*dhhm.DHHDB, err error)

GetByAnchorUIDs 批量查询

func (*GuardDao) GetByUIDs

func (d *GuardDao) GetByUIDs(c context.Context, uids []int64) (dhhs []*dhhm.DHHDB, err error)

GetByUIDs 批量查询

func (*GuardDao) GetByUIDsWithMap

func (d *GuardDao) GetByUIDsWithMap(c context.Context, uids []int64) (dhhs map[int64][]*dhhm.DHHDB, err error)

GetByUIDsWithMap 批量查询

func (*GuardDao) GetGuardByUID

func (d *GuardDao) GetGuardByUID(ctx context.Context, uid int64) (info []*model.GuardInfo, err error)

GetGuardByUID get guard info by uid

func (*GuardDao) GetGuardByUIDRuid

func (d *GuardDao) GetGuardByUIDRuid(ctx context.Context, uid int64, ruid int64) (info []*model.GuardInfo, err error)

GetGuardByUIDRuid get guard info by uid and ruid

func (*GuardDao) GetGuardTopListCache

func (d *GuardDao) GetGuardTopListCache(ctx context.Context, uid int64) (dhhList []*dahanghaiModel.DaHangHaiRedis2, err error)

GetGuardTopListCache 获取单个用户的全量守护信息

func (*GuardDao) GetUIDAllGuardFromRedis

func (d *GuardDao) GetUIDAllGuardFromRedis(ctx context.Context, mids []int64) (dhhList []*dahanghaiModel.DaHangHaiRedis2, err error)

GetUIDAllGuardFromRedis 获取单个用户的全量守护信息

func (*GuardDao) GetUIDAllGuardFromRedisBatch

func (d *GuardDao) GetUIDAllGuardFromRedisBatch(ctx context.Context, mids []int64) (dhhList []*dahanghaiModel.DaHangHaiRedis2, err error)

GetUIDAllGuardFromRedisBatch 获取批量用户的全量守护信息

func (*GuardDao) LockOrder

func (d *GuardDao) LockOrder(ctx context.Context, orderID string) (ok bool, err error)

LockOrder lock for same order

func (*GuardDao) Ping

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

Ping dao ping

func (*GuardDao) SetAnchorGuardListCache

func (d *GuardDao) SetAnchorGuardListCache(c context.Context, dhhList []dahanghaiModel.DaHangHaiRedis2, uid int64) (err error)

SetAnchorGuardListCache ... 批量设置主播维度守护信息cache

func (*GuardDao) SetDHHListCache

func (d *GuardDao) SetDHHListCache(c context.Context, dhhList []dahanghaiModel.DaHangHaiRedis2, uid int64) (err error)

SetDHHListCache ... 批量设置用户守护cache

func (*GuardDao) UnlockOrder

func (d *GuardDao) UnlockOrder(ctx context.Context, orderID string) (err error)

UnlockOrder release lock for same order

func (*GuardDao) UpdateGuard

func (d *GuardDao) UpdateGuard(ctx context.Context, req *model.GuardBuy, cond string) (err error)

UpdateGuard update guard info

func (*GuardDao) UpsertGuard

func (d *GuardDao) UpsertGuard(ctx context.Context, req *model.GuardBuy, expiredTime string) (err error)

UpsertGuard upsert guard info

Jump to

Keyboard shortcuts

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