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: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromError

func PromError(name string)

PromError prom error

Types

type Dao

type Dao struct {
	BusinessMap   map[string]*model.Business
	BusinessIDMap map[int64]*model.Business
	// contains filtered or unexported fields
}

Dao dao

func New

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

New dao new

func (*Dao) AddCacheItemLikeList

func (d *Dao) AddCacheItemLikeList(c context.Context, messageID int64, miss []*model.UserLikeRecord, businessID int64, state int8) (err error)

AddCacheItemLikeList .

func (*Dao) AddCacheUserLikeList

func (d *Dao) AddCacheUserLikeList(c context.Context, mid int64, miss []*model.ItemLikeRecord, businessID int64, state int8) (err error)

AddCacheUserLikeList .

func (*Dao) AddHashStatsCache

func (d *Dao) AddHashStatsCache(c context.Context, businessID, originID int64, stats ...*model.Stats) (err error)

AddHashStatsCache .

func (*Dao) AddHashStatsCacheMap

func (d *Dao) AddHashStatsCacheMap(c context.Context, businessID, originID int64, stats map[int64]*model.Stats) (err error)

AddHashStatsCacheMap .

func (*Dao) AddStatsCache

func (d *Dao) AddStatsCache(c context.Context, businessID int64, vs ...*model.Stats) (err error)

AddStatsCache .

func (*Dao) AddStatsCacheMap

func (d *Dao) AddStatsCacheMap(c context.Context, businessID int64, stats map[int64]*model.Stats) (err error)

AddStatsCacheMap .

func (*Dao) AppendCacheItemLikeList

func (d *Dao) AppendCacheItemLikeList(c context.Context, messageID int64, item *model.UserLikeRecord, businessID int64, state int8) (err error)

AppendCacheItemLikeList .

func (*Dao) AppendCacheUserLikeList

func (d *Dao) AppendCacheUserLikeList(c context.Context, mid int64, item *model.ItemLikeRecord, businessID int64, state int8) (err error)

AppendCacheUserLikeList .

func (*Dao) Businesses

func (d *Dao) Businesses(c context.Context) (res []*model.Business, err error)

Businesses get business list

func (*Dao) CacheItemLikeList

func (d *Dao) CacheItemLikeList(c context.Context, messageID, businessID int64, state int8, start, end int) (res []*model.UserLikeRecord, err error)

CacheItemLikeList .

func (*Dao) CacheUserLikeList

func (d *Dao) CacheUserLikeList(c context.Context, mid, businessID int64, state int8, start, end int) (res []*model.ItemLikeRecord, err error)

CacheUserLikeList .

func (*Dao) Close

func (d *Dao) Close()

Close close resource.

func (*Dao) DelHashStatsCache

func (d *Dao) DelHashStatsCache(c context.Context, businessID, originID int64) (err error)

DelHashStatsCache del hash cache

func (*Dao) DelItemLikeCache

func (d *Dao) DelItemLikeCache(c context.Context, messageID, businessID int64, mid int64, state int8) (err error)

DelItemLikeCache .

func (*Dao) DelStatsCache

func (d *Dao) DelStatsCache(c context.Context, businessID int64, messageID int64) (err error)

DelStatsCache del stats cache

func (*Dao) DelUserLikeCache

func (d *Dao) DelUserLikeCache(c context.Context, mid, businessID int64, messageID int64, state int8) (err error)

DelUserLikeCache .

func (*Dao) ExpireHashStatsCache

func (d *Dao) ExpireHashStatsCache(c context.Context, businessID, originID int64) (ok bool, err error)

ExpireHashStatsCache .

func (*Dao) ExpireItemLikesCache

func (d *Dao) ExpireItemLikesCache(c context.Context, messageID, businessID int64, state int8) (ok bool, err error)

ExpireItemLikesCache .

func (*Dao) ExpireUserLikesCache

func (d *Dao) ExpireUserLikesCache(c context.Context, mid, businessID int64, state int8) (ok bool, err error)

ExpireUserLikesCache .

func (*Dao) HashStatsCache

func (d *Dao) HashStatsCache(c context.Context, businessID, originID int64, messageIDs []int64) (res map[int64]*model.Stats, err error)

HashStatsCache .

func (*Dao) ItemHasLike

func (d *Dao) ItemHasLike(c context.Context, businessID int64, originID, messageID int64, mids []int64, typ int8) (res map[int64]int64, err error)

ItemHasLike .

func (*Dao) ItemLikeExists

func (d *Dao) ItemLikeExists(c context.Context, messageID, businessID int64, mids []int64, state int8) (res map[int64]int64, err error)

ItemLikeExists .

func (*Dao) ItemLikesCountCache

func (d *Dao) ItemLikesCountCache(c context.Context, businessID, messageID int64) (res int, err error)

ItemLikesCountCache .

func (*Dao) LikeState

func (d *Dao) LikeState(c context.Context, mid, businessID, originID, messageID int64) (res int8, err error)

LikeState get like state

func (*Dao) MessageStats

func (d *Dao) MessageStats(c context.Context, businessID int64, ids []int64) (res map[int64]*model.Stats, err error)

MessageStats .

func (*Dao) OriginStats

func (d *Dao) OriginStats(c context.Context, businessID, originID int64) (res map[int64]*model.Stats, err error)

OriginStats .

func (*Dao) Ping

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

Ping check connection success.

func (*Dao) PubItemMsg

func (d *Dao) PubItemMsg(c context.Context, business string, originID, messageID int64, state int8) (err error)

PubItemMsg .

func (*Dao) PubLikeDatabus

func (d *Dao) PubLikeDatabus(c context.Context, p *model.LikeMsg) (err error)

PubLikeDatabus .

func (*Dao) PubStatDatabus

func (d *Dao) PubStatDatabus(c context.Context, business string, mid int64, s *model.Stats, upMid int64) (err error)

PubStatDatabus pub stat databus

func (*Dao) PubUserMsg

func (d *Dao) PubUserMsg(c context.Context, business string, mid int64, state int8) (err error)

PubUserMsg .

func (*Dao) RawItemLikeList

func (d *Dao) RawItemLikeList(c context.Context, messageID, businessID, originID int64, state int8, start, end int) (res []*model.UserLikeRecord, err error)

RawItemLikeList item like list

func (*Dao) RawStats

func (d *Dao) RawStats(c context.Context, businessID, originID, messageID int64) (res model.RawStats, err error)

RawStats stat changes

func (*Dao) RawUserLikeList

func (d *Dao) RawUserLikeList(c context.Context, mid, businessID int64, state int8, start, end int) (res []*model.ItemLikeRecord, err error)

RawUserLikeList .

func (*Dao) Stat

func (d *Dao) Stat(c context.Context, businessID, originID, messageID int64) (res model.Stats, err error)

Stat .

func (*Dao) StatsCache

func (d *Dao) StatsCache(c context.Context, businessID int64, messageIDs []int64) (cached map[int64]*model.Stats, missed []int64, err error)

StatsCache .

func (*Dao) UpdateCount

func (d *Dao) UpdateCount(c context.Context, businessID, originID, messageID int64, likeChange, dislikeChange int64) (err error)

UpdateCount .

func (*Dao) UpdateCounts

func (d *Dao) UpdateCounts(c context.Context, businessID, originID, messageID int64, likeCount, dislikeCount int64, upMid int64) (err error)

UpdateCounts .

func (*Dao) UpdateUpMids

func (d *Dao) UpdateUpMids(c context.Context, businessID int64, data []*model.UpMidsReq) (rows int64, err error)

UpdateUpMids .

func (*Dao) UserHasLike

func (d *Dao) UserHasLike(c context.Context, businessID, mid int64, messageIDs []int64, typ int8) (res []*model.ItemLikeRecord, err error)

UserHasLike .

func (*Dao) UserLikeCount

func (d *Dao) UserLikeCount(c context.Context, businessID, mid int64, typ int8) (res int, err error)

UserLikeCount count

func (*Dao) UserLikeExists

func (d *Dao) UserLikeExists(c context.Context, mid, businessID int64, messageIDs []int64, state int8) (res map[int64]*pb.UserLikeState, err error)

UserLikeExists .

func (*Dao) UserLikeList

func (d *Dao) UserLikeList(c context.Context, mid int64, businessID int64, state int8, start, end int) (res []*model.ItemLikeRecord, err error)

UserLikeList 用户点赞列表

func (*Dao) UserLikesCountCache

func (d *Dao) UserLikesCountCache(c context.Context, businessID, mid int64) (res int, err error)

UserLikesCountCache .

Jump to

Keyboard shortcuts

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