Documentation ¶
Index ¶
- Constants
- type Dao
- func (d *Dao) AddBlackLog(ctx context.Context, rl *model.RelationLog)
- func (d *Dao) AddFollowingCache(c context.Context, mid int64, following *model.Following) (err error)
- func (d *Dao) AddFollowingLog(ctx context.Context, rl *model.RelationLog)
- func (d *Dao) AddMonitor(c context.Context, mid int64, now time.Time) (affected int64, err error)
- func (d *Dao) AddRctFollower(c context.Context, mid, fid int64) error
- func (d *Dao) AddStat(c context.Context, mid int64, stat *model.Stat, now time.Time) (affected int64, err error)
- func (d *Dao) AddTag(c context.Context, mid, fid int64, tag string, now time.Time) (lastID int64, err error)
- func (d *Dao) AddTagUser(c context.Context, mid, fid int64, tag []int64, now time.Time) (affected int64, err error)
- func (d *Dao) AddWhisperLog(ctx context.Context, rl *model.RelationLog)
- func (d *Dao) BCount(c context.Context, mid, ts int64, btype int8) (count int64, err error)
- func (d *Dao) BeginTran(c context.Context) (*sql.Tx, error)
- func (d *Dao) Close()
- func (d *Dao) ClosePrompt(c context.Context, mid, fid, ts int64, btype int8) (err error)
- func (d *Dao) DelBlackLog(ctx context.Context, rl *model.RelationLog)
- func (d *Dao) DelFollowerCache(c context.Context, mid int64) (err error)
- func (d *Dao) DelFollowerLog(ctx context.Context, rl *model.RelationLog)
- func (d *Dao) DelFollowerNotifyCache(c context.Context, mid int64) (err error)
- func (d *Dao) DelFollowing(c context.Context, mid int64, following *model.Following) (err error)
- func (d *Dao) DelFollowingCache(c context.Context, mid int64) (err error)
- func (d *Dao) DelFollowingLog(ctx context.Context, rl *model.RelationLog)
- func (d *Dao) DelFollowingsCache(c context.Context, mid int64) (err error)
- func (d *Dao) DelMonitor(c context.Context, mid int64) (affected int64, err error)
- func (d *Dao) DelMonitorCache(c context.Context, mid int64) (err error)
- func (d *Dao) DelRctFollower(c context.Context, mid, fid int64) error
- func (d *Dao) DelStatCache(c context.Context, mid int64) error
- func (d *Dao) DelTag(c context.Context, mid, id int64) (affected int64, err error)
- func (d *Dao) DelTagCountCache(c context.Context, mid int64) (err error)
- func (d *Dao) DelTagsCache(c context.Context, mid int64) (err error)
- func (d *Dao) DelWhisperLog(ctx context.Context, rl *model.RelationLog)
- func (d *Dao) DisableFollowerNotify(c context.Context, mid int64) (affected int64, err error)
- func (d *Dao) EmptyRctFollower(ctx context.Context, fid int64) error
- func (d *Dao) EnableFollowerNotify(c context.Context, mid int64) (affected int64, err error)
- func (d *Dao) FollowerCache(c context.Context, mid int64) (followers []*model.Following, err error)
- func (d *Dao) FollowerNotifySetting(c context.Context, mid int64) (bool, error)
- func (d *Dao) Followers(c context.Context, mid int64) (res []*model.Following, err error)
- func (d *Dao) FollowingCache(c context.Context, mid int64) (followings []*model.Following, err error)
- func (d *Dao) Followings(c context.Context, mid int64) (res []*model.Following, err error)
- func (d *Dao) FollowingsCache(c context.Context, mid int64) (followings []*model.Following, err error)
- func (d *Dao) FollowingsIn(c context.Context, mid int64, fids []int64) (res []*model.Following, err error)
- func (d *Dao) GetFollowerNotifyCache(c context.Context, mid int64) (res *model.FollowerNotifySetting, err error)
- func (d *Dao) GlobalHotRecCache(c context.Context) (fs []int64, err error)
- func (d *Dao) HasReachAchieve(c context.Context, mid int64, achieve model.AchieveFlag) bool
- func (d *Dao) IncrPromptCount(c context.Context, mid, fid, ts int64, btype int8) (ucount, bcount int64, err error)
- func (d *Dao) IncrTodayNotifyCount(c context.Context, mid int64) (err error)
- func (d *Dao) LoadMonitor(c context.Context) (mids []int64, err error)
- func (d *Dao) LoadMonitorCache(c context.Context, mids []int64) (err error)
- func (d *Dao) MonitorCache(c context.Context, mid int64) (exist bool, err error)
- func (d *Dao) PassportDetail(c context.Context, mid int64, ip string) (res *model.PassportDetail, err error)
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) RctFollowerCount(ctx context.Context, fid int64) (int64, error)
- func (d *Dao) RctFollowerNotify(c context.Context, fid int64) (bool, error)
- func (d *Dao) Relation(c context.Context, mid, fid int64) (attr uint32, err error)
- func (d *Dao) RelationsCache(c context.Context, mid int64, fids []int64) (resMap map[int64]*model.Following, err error)
- func (d *Dao) SetFollowerCache(c context.Context, mid int64, followers []*model.Following) (err error)
- func (d *Dao) SetFollowerNotifyCache(c context.Context, mid int64, val *model.FollowerNotifySetting) (err error)
- func (d *Dao) SetFollowingCache(c context.Context, mid int64, followings []*model.Following) (err error)
- func (d *Dao) SetFollowingsCache(c context.Context, mid int64, followings []*model.Following) (err error)
- func (d *Dao) SetGlobalHotRecCache(c context.Context, fids []int64) (err error)
- func (d *Dao) SetMonitorCache(c context.Context, mid int64) (err error)
- func (d *Dao) SetRctFollowerNotify(c context.Context, fid int64, flag bool) error
- func (d *Dao) SetStatCache(c context.Context, mid int64, st *model.Stat) error
- func (d *Dao) SetTagCountCache(c context.Context, mid int64, tagCount []*model.TagCount) (err error)
- func (d *Dao) SetTagName(c context.Context, id, mid int64, name string, now time.Time) (affected int64, err error)
- func (d *Dao) SetTagUser(c context.Context, mid, fid int64, tag i64b.Int64Bytes, now time.Time) (affected int64, err error)
- func (d *Dao) SetTagsCache(c context.Context, mid int64, tags *model.Tags) (err error)
- func (d *Dao) Stat(c context.Context, mid int64) (stat *model.Stat, err error)
- func (d *Dao) StatCache(c context.Context, mid int64) (*model.Stat, error)
- func (d *Dao) StatsCache(c context.Context, mids []int64) (map[int64]*model.Stat, []int64, error)
- func (d *Dao) TagCountCache(c context.Context, mid int64) (tagCount []*model.TagCount, err error)
- func (d *Dao) TagUserByMidFid(c context.Context, mid, fid int64) (tag *model.TagUser, err error)
- func (d *Dao) Tags(c context.Context, mid int64) (res map[int64]*model.Tag, err error)
- func (d *Dao) TagsCache(c context.Context, mid int64) (tags map[int64]*model.Tag, err error)
- func (d *Dao) TodayNotifyCountCache(c context.Context, mid int64) (notifyCount int64, err error)
- func (d *Dao) TxAddFollower(c context.Context, tx *sql.Tx, mid, fid int64, mask uint32, source uint8, ...) (affected int64, err error)
- func (d *Dao) TxAddFollowing(c context.Context, tx *sql.Tx, mid, fid int64, mask uint32, source uint8, ...) (affected int64, err error)
- func (d *Dao) TxAddStat(c context.Context, tx *sql.Tx, mid int64, stat *model.Stat, now time.Time) (affected int64, err error)
- func (d *Dao) TxDelTagUser(c context.Context, tx *sql.Tx, mid, fid int64) (affected int64, err error)
- func (d *Dao) TxSetFollower(c context.Context, tx *sql.Tx, mid, fid int64, attribute uint32, source uint8, ...) (affected int64, err error)
- func (d *Dao) TxSetFollowing(c context.Context, tx *sql.Tx, mid, fid int64, attribute uint32, source uint8, ...) (affected int64, err error)
- func (d *Dao) TxSetStat(c context.Context, tx *sql.Tx, mid int64, stat *model.Stat, now time.Time) (affected int64, err error)
- func (d *Dao) TxStat(c context.Context, tx *sql.Tx, mid int64) (stat *model.Stat, err error)
- func (d *Dao) UpCount(c context.Context, mid, fid, ts int64) (count int64, err error)
- func (d *Dao) UserTag(c context.Context, mid int64) (tags map[int64][]int64, err error)
- func (d *Dao) UsersTags(c context.Context, mid int64, fid []int64) (tags map[int64]*model.TagUser, err error)
Constants ¶
const (
RelationLogID = 13
)
consts
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct { // followers unread duration UnreadDuration int64 // contains filtered or unexported fields }
Dao struct info of Dao.
func (*Dao) AddBlackLog ¶
func (d *Dao) AddBlackLog(ctx context.Context, rl *model.RelationLog)
AddBlackLog is
func (*Dao) AddFollowingCache ¶
func (d *Dao) AddFollowingCache(c context.Context, mid int64, following *model.Following) (err error)
AddFollowingCache add following cache.
func (*Dao) AddFollowingLog ¶
func (d *Dao) AddFollowingLog(ctx context.Context, rl *model.RelationLog)
AddFollowingLog is
func (*Dao) AddMonitor ¶
AddMonitor add mid to monitor table
func (*Dao) AddRctFollower ¶
AddRctFollower is
func (*Dao) AddStat ¶
func (d *Dao) AddStat(c context.Context, mid int64, stat *model.Stat, now time.Time) (affected int64, err error)
AddStat try add stat.
func (*Dao) AddTag ¶
func (d *Dao) AddTag(c context.Context, mid, fid int64, tag string, now time.Time) (lastID int64, err error)
AddTag add tag.
func (*Dao) AddTagUser ¶
func (d *Dao) AddTagUser(c context.Context, mid, fid int64, tag []int64, now time.Time) (affected int64, err error)
AddTagUser update tag name info.
func (*Dao) AddWhisperLog ¶
func (d *Dao) AddWhisperLog(ctx context.Context, rl *model.RelationLog)
AddWhisperLog is
func (*Dao) ClosePrompt ¶
ClosePrompt set prompt count to max config value.
func (*Dao) DelBlackLog ¶
func (d *Dao) DelBlackLog(ctx context.Context, rl *model.RelationLog)
DelBlackLog is
func (*Dao) DelFollowerCache ¶
DelFollowerCache delete follower cache.
func (*Dao) DelFollowerLog ¶
func (d *Dao) DelFollowerLog(ctx context.Context, rl *model.RelationLog)
DelFollowerLog is
func (*Dao) DelFollowerNotifyCache ¶
DelFollowerNotifyCache Del data from mc
func (*Dao) DelFollowing ¶
DelFollowing del following cache.
func (*Dao) DelFollowingCache ¶
DelFollowingCache delete following cache.
func (*Dao) DelFollowingLog ¶
func (d *Dao) DelFollowingLog(ctx context.Context, rl *model.RelationLog)
DelFollowingLog is
func (*Dao) DelFollowingsCache ¶
DelFollowingsCache delete followings cache.
func (*Dao) DelMonitor ¶
DelMonitor del mid from monitor table
func (*Dao) DelMonitorCache ¶
DelMonitorCache del monitor cache
func (*Dao) DelRctFollower ¶
DelRctFollower is
func (*Dao) DelStatCache ¶
DelStatCache delete stat cache.
func (*Dao) DelTagCountCache ¶
DelTagCountCache del tag count cache
func (*Dao) DelTagsCache ¶
DelTagsCache del user tags cache.
func (*Dao) DelWhisperLog ¶
func (d *Dao) DelWhisperLog(ctx context.Context, rl *model.RelationLog)
DelWhisperLog is
func (*Dao) DisableFollowerNotify ¶
DisableFollowerNotify disable follower-notify setting
func (*Dao) EmptyRctFollower ¶
EmptyRctFollower is
func (*Dao) EnableFollowerNotify ¶
EnableFollowerNotify enable follower-notify setting
func (*Dao) FollowerCache ¶
FollowerCache get follower cache.
func (*Dao) FollowerNotifySetting ¶
FollowerNotifySetting get follower-notify setting 这里返回用户通知开关的状态(和数据库存储的状态值相反)
func (*Dao) Followers ¶
Followers get user's latest 1000 followers(attribute = AttrFollowing), order by mtime desc.
func (*Dao) FollowingCache ¶
func (d *Dao) FollowingCache(c context.Context, mid int64) (followings []*model.Following, err error)
FollowingCache get following cache.
func (*Dao) Followings ¶
Followings get user's following list.
func (*Dao) FollowingsCache ¶
func (d *Dao) FollowingsCache(c context.Context, mid int64) (followings []*model.Following, err error)
FollowingsCache get followings cache.
func (*Dao) FollowingsIn ¶
func (d *Dao) FollowingsIn(c context.Context, mid int64, fids []int64) (res []*model.Following, err error)
FollowingsIn get user's following list by in fids
func (*Dao) GetFollowerNotifyCache ¶
func (d *Dao) GetFollowerNotifyCache(c context.Context, mid int64) (res *model.FollowerNotifySetting, err error)
GetFollowerNotifyCache get data from mc
func (*Dao) GlobalHotRecCache ¶
GlobalHotRecCache get global hot recommend.
func (*Dao) HasReachAchieve ¶
HasReachAchieve is
func (*Dao) IncrPromptCount ¶
func (d *Dao) IncrPromptCount(c context.Context, mid, fid, ts int64, btype int8) (ucount, bcount int64, err error)
IncrPromptCount incr up prompt count and business type prompt count.
func (*Dao) IncrTodayNotifyCount ¶
IncrTodayNotifyCount increment the today notify count in the current day
func (*Dao) LoadMonitor ¶
LoadMonitor load all mids into redis set.
func (*Dao) LoadMonitorCache ¶
LoadMonitorCache load monitor cache
func (*Dao) MonitorCache ¶
MonitorCache monitor cache
func (*Dao) PassportDetail ¶
func (d *Dao) PassportDetail(c context.Context, mid int64, ip string) (res *model.PassportDetail, err error)
PassportDetail get passport detail from passport service through http
func (*Dao) RctFollowerCount ¶
RctFollowerCount is
func (*Dao) RctFollowerNotify ¶
RctFollowerNotify is
func (*Dao) RelationsCache ¶
func (d *Dao) RelationsCache(c context.Context, mid int64, fids []int64) (resMap map[int64]*model.Following, err error)
RelationsCache relations cache.
func (*Dao) SetFollowerCache ¶
func (d *Dao) SetFollowerCache(c context.Context, mid int64, followers []*model.Following) (err error)
SetFollowerCache set follower cache.
func (*Dao) SetFollowerNotifyCache ¶
func (d *Dao) SetFollowerNotifyCache(c context.Context, mid int64, val *model.FollowerNotifySetting) (err error)
SetFollowerNotifyCache Set data to mc
func (*Dao) SetFollowingCache ¶
func (d *Dao) SetFollowingCache(c context.Context, mid int64, followings []*model.Following) (err error)
SetFollowingCache set following cache.
func (*Dao) SetFollowingsCache ¶
func (d *Dao) SetFollowingsCache(c context.Context, mid int64, followings []*model.Following) (err error)
SetFollowingsCache set followings cache.
func (*Dao) SetGlobalHotRecCache ¶
SetGlobalHotRecCache set global hot recommend cache.
func (*Dao) SetMonitorCache ¶
SetMonitorCache set monitor cache
func (*Dao) SetRctFollowerNotify ¶
SetRctFollowerNotify is
func (*Dao) SetStatCache ¶
SetStatCache set stat cache.
func (*Dao) SetTagCountCache ¶
func (d *Dao) SetTagCountCache(c context.Context, mid int64, tagCount []*model.TagCount) (err error)
SetTagCountCache set tag count cache
func (*Dao) SetTagName ¶
func (d *Dao) SetTagName(c context.Context, id, mid int64, name string, now time.Time) (affected int64, err error)
SetTagName update tag name info.
func (*Dao) SetTagUser ¶
func (d *Dao) SetTagUser(c context.Context, mid, fid int64, tag i64b.Int64Bytes, now time.Time) (affected int64, err error)
SetTagUser setTagUser info.
func (*Dao) SetTagsCache ¶
SetTagsCache set user tags cache.
func (*Dao) StatsCache ¶
StatsCache get multi stat cache.
func (*Dao) TagCountCache ¶
TagCountCache tag count cache
func (*Dao) TagUserByMidFid ¶
TagUserByMidFid get tagIds by mid and fid.
func (*Dao) TodayNotifyCountCache ¶
TodayNotifyCountCache get notify count in the current day
func (*Dao) TxAddFollower ¶
func (d *Dao) TxAddFollower(c context.Context, tx *sql.Tx, mid, fid int64, mask uint32, source uint8, now time.Time) (affected int64, err error)
TxAddFollower add follower by transaction.
func (*Dao) TxAddFollowing ¶
func (d *Dao) TxAddFollowing(c context.Context, tx *sql.Tx, mid, fid int64, mask uint32, source uint8, now time.Time) (affected int64, err error)
TxAddFollowing add following by transaction.
func (*Dao) TxAddStat ¶
func (d *Dao) TxAddStat(c context.Context, tx *sql.Tx, mid int64, stat *model.Stat, now time.Time) (affected int64, err error)
TxAddStat add params stat to stat by transaction.
func (*Dao) TxDelTagUser ¶
func (d *Dao) TxDelTagUser(c context.Context, tx *sql.Tx, mid, fid int64) (affected int64, err error)
TxDelTagUser delete tag user record.
func (*Dao) TxSetFollower ¶
func (d *Dao) TxSetFollower(c context.Context, tx *sql.Tx, mid, fid int64, attribute uint32, source uint8, status int, now time.Time) (affected int64, err error)
TxSetFollower set follower by transaction.
func (*Dao) TxSetFollowing ¶
func (d *Dao) TxSetFollowing(c context.Context, tx *sql.Tx, mid, fid int64, attribute uint32, source uint8, status int, now time.Time) (affected int64, err error)
TxSetFollowing set following by transaction.
func (*Dao) TxSetStat ¶
func (d *Dao) TxSetStat(c context.Context, tx *sql.Tx, mid int64, stat *model.Stat, now time.Time) (affected int64, err error)
TxSetStat set stat to params stat by transaction.