Documentation
¶
Index ¶
- type Dao
- func (d *Dao) AddReplySetRds(ctx context.Context, oid int64, tp int, rpID int64) (err error)
- func (d *Dao) AddReplyZSetRds(ctx context.Context, name string, oid int64, tp int, rs *model.ReplyScore) (err error)
- func (d *Dao) AddUV(ctx context.Context, action string, hour, slot int, mid int64, kind string) (err error)
- func (d *Dao) CheckerTsRds(ctx context.Context, oid int64, tp int) (ts int64, err error)
- func (d *Dao) Close()
- func (d *Dao) CountUV(ctx context.Context, keys []string) (counts []int64, err error)
- func (d *Dao) DelReplySetRds(ctx context.Context, oid int64, tp int) (err error)
- func (d *Dao) DelReplyZSetRds(ctx context.Context, names []string, oid int64, tp int) (err error)
- func (d *Dao) ExpireCheckerRds(ctx context.Context, oid int64, tp int) (ok bool, err error)
- func (d *Dao) ExpireReplySetRds(ctx context.Context, oid int64, tp int) (ok bool, err error)
- func (d *Dao) ExpireReplyZSetRds(ctx context.Context, name string, oid int64, tp int) (ok bool, err error)
- func (d *Dao) IsOriginHot(ctx context.Context, oid, rpID int64, tp int) (isHot bool, err error)
- func (d *Dao) KeyUV(action string, hour, slot int, kind string) string
- func (d *Dao) Ping(c context.Context) error
- func (d *Dao) PingMc(ctx context.Context) (err error)
- func (d *Dao) PingRedis(ctx context.Context) (err error)
- func (d *Dao) RangeReplyZSetRds(ctx context.Context, name string, oid int64, tp, start, end int) (rpIDs []int64, err error)
- func (d *Dao) RemReplySetRds(ctx context.Context, oid, rpID int64, tp int) (err error)
- func (d *Dao) RemReplyStatMc(ctx context.Context, rpID int64) (err error)
- func (d *Dao) RemReplyZSetRds(ctx context.Context, name string, oid int64, tp int, rpID int64) (err error)
- func (d *Dao) ReplyLHRCStats(ctx context.Context, oid int64, tp int) (replyMap map[int64]*model.ReplyStat, err error)
- func (d *Dao) ReplyLHRCStatsByID(ctx context.Context, oid int64, rpIDs []int64) (replyMap map[int64]*model.ReplyStat, err error)
- func (d *Dao) ReplySetRds(ctx context.Context, oid int64, tp int) (rpIDs []int64, err error)
- func (d *Dao) ReplyStatsMc(ctx context.Context, rpIDs []int64) (rsMap map[int64]*model.ReplyStat, missIDs []int64, err error)
- func (d *Dao) ReplyZSetRds(ctx context.Context, name string, oid int64, tp, start, end int) (rpIDs []int64, err error)
- func (d *Dao) ReportStatsByID(ctx context.Context, oid int64, rpIDs []int64) (reportMap map[int64]*model.ReplyStat, err error)
- func (d *Dao) RpIDs(ctx context.Context, oid int64, tp int) (rpIDs []int64, err error)
- func (d *Dao) SetCheckerTsRds(ctx context.Context, oid int64, tp int) (err error)
- func (d *Dao) SetReplySetRds(ctx context.Context, oid int64, tp int, rpIDs []int64) (err error)
- func (d *Dao) SetReplyStatMc(ctx context.Context, rs *model.ReplyStat) (err error)
- func (d *Dao) SetReplyZSetRds(ctx context.Context, name string, oid int64, tp int, rs []*model.ReplyScore) (err error)
- func (d *Dao) SlotStats(ctx context.Context) (ss []*model.SlotStat, err error)
- func (d *Dao) SlotsMapping(ctx context.Context) (slotsMap map[string]*model.SlotsMapping, err error)
- func (d *Dao) SubjectStats(ctx context.Context, oid int64, tp int) (ctime xtime.Time, err error)
- func (d *Dao) UpsertStatistics(ctx context.Context, name string, date, hour int, s *model.StatisticsStat) (err error)
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 (*Dao) AddReplySetRds ¶
AddReplySetRds add a reply into redis set, make sure expire the key first.
func (*Dao) AddReplyZSetRds ¶
func (d *Dao) AddReplyZSetRds(ctx context.Context, name string, oid int64, tp int, rs *model.ReplyScore) (err error)
AddReplyZSetRds add a reply into redis sorted set, make sure expire the key first.
func (*Dao) AddUV ¶
func (d *Dao) AddUV(ctx context.Context, action string, hour, slot int, mid int64, kind string) (err error)
AddUV ...
func (*Dao) CheckerTsRds ¶
CheckerTsRds get refresh checker timestamp from redis, if time.Now()-ts > strategy.time, then refresh reply list.
func (*Dao) DelReplySetRds ¶
DelReplySetRds delete a set key.
func (*Dao) DelReplyZSetRds ¶
DelReplyZSetRds del a key from reply ZSet.
func (*Dao) ExpireCheckerRds ¶
ExpireCheckerRds expire checker.
func (*Dao) ExpireReplySetRds ¶
ExpireReplySetRds expire reply set.
func (*Dao) ExpireReplyZSetRds ¶
func (d *Dao) ExpireReplyZSetRds(ctx context.Context, name string, oid int64, tp int) (ok bool, err error)
ExpireReplyZSetRds expire reply list.
func (*Dao) IsOriginHot ¶
IsOriginHot return is origin hot reply.
func (*Dao) RangeReplyZSetRds ¶
func (d *Dao) RangeReplyZSetRds(ctx context.Context, name string, oid int64, tp, start, end int) (rpIDs []int64, err error)
RangeReplyZSetRds ...
func (*Dao) RemReplySetRds ¶
RemReplySetRds remove one rp from set.
func (*Dao) RemReplyStatMc ¶
RemReplyStatMc ...
func (*Dao) RemReplyZSetRds ¶
func (d *Dao) RemReplyZSetRds(ctx context.Context, name string, oid int64, tp int, rpID int64) (err error)
RemReplyZSetRds remove one rpID from reply ZSet.
func (*Dao) ReplyLHRCStats ¶
func (d *Dao) ReplyLHRCStats(ctx context.Context, oid int64, tp int) (replyMap map[int64]*model.ReplyStat, err error)
ReplyLHRCStats get reply like, hate, reply, ctime stat from database, only get root reply which like>3, call it when back to source.
func (*Dao) ReplyLHRCStatsByID ¶
func (d *Dao) ReplyLHRCStatsByID(ctx context.Context, oid int64, rpIDs []int64) (replyMap map[int64]*model.ReplyStat, err error)
ReplyLHRCStatsByID return a reply like hate reply ctime stat by rpid.
func (*Dao) ReplySetRds ¶
ReplySetRds get reply rpIDs from redis set.
func (*Dao) ReplyStatsMc ¶
func (d *Dao) ReplyStatsMc(ctx context.Context, rpIDs []int64) (rsMap map[int64]*model.ReplyStat, missIDs []int64, err error)
ReplyStatsMc get multi repies stat from memcache.
func (*Dao) ReplyZSetRds ¶
func (d *Dao) ReplyZSetRds(ctx context.Context, name string, oid int64, tp, start, end int) (rpIDs []int64, err error)
ReplyZSetRds get reply list from redis sorted set.
func (*Dao) ReportStatsByID ¶
func (d *Dao) ReportStatsByID(ctx context.Context, oid int64, rpIDs []int64) (reportMap map[int64]*model.ReplyStat, err error)
ReportStatsByID get report stats from database by ID
func (*Dao) SetCheckerTsRds ¶
SetCheckerTsRds set refresh checker's timestamp as time.Now(), call it when refresh reply list.
func (*Dao) SetReplySetRds ¶
SetReplySetRds set reply list batch, call it when back to source.
func (*Dao) SetReplyStatMc ¶
SetReplyStatMc set reply stat into mc.
func (*Dao) SetReplyZSetRds ¶
func (d *Dao) SetReplyZSetRds(ctx context.Context, name string, oid int64, tp int, rs []*model.ReplyScore) (err error)
SetReplyZSetRds set reply list batch, call it when back to source.
func (*Dao) SlotsMapping ¶
func (d *Dao) SlotsMapping(ctx context.Context) (slotsMap map[string]*model.SlotsMapping, err error)
SlotsMapping get slots and name mapping.
func (*Dao) SubjectStats ¶
SubjectStats get subject ctime from database
func (*Dao) UpsertStatistics ¶
func (d *Dao) UpsertStatistics(ctx context.Context, name string, date, hour int, s *model.StatisticsStat) (err error)
UpsertStatistics insert or update statistics into database