Documentation ¶
Index ¶
- Constants
- func PromError(name string)
- func PromInfo(name string)
- type CacheRetry
- type Dao
- func (d *Dao) AddAuthorMostCategories(c context.Context, mid int64, categories []int64) (err error)
- func (d *Dao) AddCacheGameList(c context.Context, mids []int64) (err error)
- func (d *Dao) AddSortCaches(c context.Context, categoryID int64, field int, arts [][2]int64, ...) (err error)
- func (d *Dao) AddcategoriesAuthors(c context.Context, data map[int64][]int64) (err error)
- func (d *Dao) ArticleContent(c context.Context, id int64) (res string, err error)
- func (d *Dao) CacheGameList(c context.Context) (mids []int64, err error)
- func (d *Dao) CheatArts(c context.Context) (res map[int64]int, err error)
- func (d *Dao) CloseReply(c context.Context, aid, mid int64) (err error)
- func (d *Dao) DelReadPingSet(c context.Context, read *model.Read) (err error)
- func (d *Dao) DelScore(c context.Context, aid, mediaID, mid int64) (err error)
- func (d *Dao) DelSearch(c context.Context, aid int64) (err error)
- func (d *Dao) DupViewIntercept(c context.Context, aid, mid int64) (ban bool)
- func (d *Dao) ExpireSortCache(c context.Context, categoryID int64, field int) (ok bool, err error)
- func (d *Dao) FlowSync(c context.Context, mid, aid int64) (err error)
- func (d *Dao) GameList(c context.Context) (res []int64, err error)
- func (d *Dao) GameSync(c context.Context, action string, cvid int64) (err error)
- func (d *Dao) GetRecheckCache(c context.Context, aid int64) (isRecheck bool, err error)
- func (d *Dao) GetRecheckInfo(c context.Context, id int64) (publishTime int64, checkState int, err error)
- func (d *Dao) Intercept(c context.Context, aid, mid int64, ip string) (ban bool)
- func (d *Dao) IsAct(c context.Context, id int64) (res bool)
- func (d *Dao) Keywords(c context.Context, id int64) (keywords string, err error)
- func (d *Dao) LastModIDs(c context.Context, size int) (aids []int64, err error)
- func (d *Dao) LikeSync(c context.Context, aid, likes int64) (err error)
- func (d *Dao) MidsByPublishTime(c context.Context, pubTime int64) (mids []int64, err error)
- func (d *Dao) NewestArtIDByCategory(c context.Context, cids []int64, limit int64) (res [][2]int64, err error)
- func (d *Dao) NewestArtIDs(c context.Context, limit int64) (res [][2]int64, err error)
- func (d *Dao) OpenReply(c context.Context, aid, mid int64) (err error)
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) PopArtCache(c context.Context) (bs []byte, err error)
- func (d *Dao) PopCDN(c context.Context) (file string, err error)
- func (d *Dao) PopDynamicCache(c context.Context) (res *model.DynamicCacheRetry, err error)
- func (d *Dao) PopFlowCache(c context.Context) (res *model.FlowCacheRetry, err error)
- func (d *Dao) PopGameCache(c context.Context) (res *model.GameCacheRetry, err error)
- func (d *Dao) PopReply(c context.Context) (aid, mid int64, err error)
- func (d *Dao) PopStat(c context.Context) (bs []byte, err error)
- func (d *Dao) PubDynamic(c context.Context, mid int64, aid int64, show bool, comment string, ts int64, ...) (err error)
- func (d *Dao) PurgeCDN(c context.Context, file string) (err error)
- func (d *Dao) PushArtCache(c context.Context, info *CacheRetry) (err error)
- func (d *Dao) PushCDN(c context.Context, file string) (err error)
- func (d *Dao) PushDynamicCache(c context.Context, info *model.DynamicCacheRetry) (err error)
- func (d *Dao) PushFlowCache(c context.Context, info *model.FlowCacheRetry) (err error)
- func (d *Dao) PushGameCache(c context.Context, info *model.GameCacheRetry) (err error)
- func (d *Dao) PushReply(c context.Context, aid, mid int64) (err error)
- func (d *Dao) PushStat(c context.Context, retry *StatRetry) (err error)
- func (d *Dao) RawGameList(c context.Context) (mids []int64, err error)
- func (d *Dao) ReadPing(c context.Context, buvid string, aid int64) (last int64, err error)
- func (d *Dao) ReadPingSet(c context.Context) (res []*model.Read, err error)
- func (d *Dao) SearchArts(c context.Context, ptime int64) (res []*model.SearchArticle, err error)
- func (d *Dao) SetRecheckCache(c context.Context, aid int64) (isRecheck bool, err error)
- func (d *Dao) Settings(c context.Context) (res map[string]string, err error)
- func (d *Dao) Stat(c context.Context, aid int64) (stat *artmdl.StatMsg, err error)
- func (d *Dao) StatByMid(c context.Context, mid int64) (res map[int64][2]int64, err error)
- func (d *Dao) Update(c context.Context, stat *artmdl.StatMsg) (rows int64, err error)
- func (d *Dao) UpdateRecheck(c context.Context, aid int64) (err error)
- func (d *Dao) UpdateSearch(c context.Context, a *model.SearchArticle) (err error)
- func (d *Dao) UpdateSearchStats(c context.Context, stat *artmdl.StatMsg) (err error)
- type StatRetry
Constants ¶
const ( // RetryUpdateStatCache . RetryUpdateStatCache = 1 // RetryUpdateStatDB . RetryUpdateStatDB = 2 // RetryStatCount is retry upper limit. RetryStatCount = 10 // RetryAddArtCache . RetryAddArtCache = 1 // RetryUpdateArtCache . RetryUpdateArtCache = 2 // RetryDeleteArtCache . RetryDeleteArtCache = 3 // RetryDeleteArtRecCache . RetryDeleteArtRecCache = 4 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheRetry ¶
type CacheRetry struct { Action int `json:"action"` Aid int64 `json:"aid"` Mid int64 `json:"mid"` Cid int64 `json:"cid"` }
CacheRetry struct of retry cache info.
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao .
func (*Dao) AddAuthorMostCategories ¶
AddAuthorMostCategories .
func (*Dao) AddCacheGameList ¶
AddCacheGameList .
func (*Dao) AddSortCaches ¶
func (d *Dao) AddSortCaches(c context.Context, categoryID int64, field int, arts [][2]int64, maxLength int64) (err error)
AddSortCaches add sort articles cache
func (*Dao) AddcategoriesAuthors ¶
AddcategoriesAuthors .
func (*Dao) ArticleContent ¶
ArticleContent get article content
func (*Dao) CacheGameList ¶
CacheGameList .
func (*Dao) CloseReply ¶
CloseReply close article's reply.
func (*Dao) DelReadPingSet ¶
DelReadPingSet 删除阅读记录缓存
func (*Dao) DupViewIntercept ¶
DupViewIntercept intercepts illegal views.
func (*Dao) ExpireSortCache ¶
ExpireSortCache expire sort cache
func (*Dao) GameList ¶
GameList get data from cache if miss will call source method, then add to cache.
func (*Dao) GetRecheckCache ¶
GetRecheckCache get recheck info from redis
func (*Dao) GetRecheckInfo ¶
func (d *Dao) GetRecheckInfo(c context.Context, id int64) (publishTime int64, checkState int, err error)
GetRecheckInfo get article recheck
func (*Dao) LastModIDs ¶
LastModIDs .
func (*Dao) MidsByPublishTime ¶
MidsByPublishTime get mids by publish time
func (*Dao) NewestArtIDByCategory ¶
func (d *Dao) NewestArtIDByCategory(c context.Context, cids []int64, limit int64) (res [][2]int64, err error)
NewestArtIDByCategory find newest article's id
func (*Dao) NewestArtIDs ¶
NewestArtIDs find newest article's id
func (*Dao) PopArtCache ¶
PopArtCache .
func (*Dao) PopDynamicCache ¶
PopDynamicCache .
func (*Dao) PopFlowCache ¶
PopFlowCache .
func (*Dao) PopGameCache ¶
PopGameCache .
func (*Dao) PubDynamic ¶
func (d *Dao) PubDynamic(c context.Context, mid int64, aid int64, show bool, comment string, ts int64, dynamicIntro string) (err error)
PubDynamic pub dynamic
func (*Dao) PushArtCache ¶
func (d *Dao) PushArtCache(c context.Context, info *CacheRetry) (err error)
PushArtCache .
func (*Dao) PushDynamicCache ¶
PushDynamicCache put dynamic to redis
func (*Dao) PushFlowCache ¶
PushFlowCache .
func (*Dao) PushGameCache ¶
PushGameCache .
func (*Dao) RawGameList ¶
RawGameList game list
func (*Dao) ReadPingSet ¶
ReadPingSet 获取所有阅读记录(不删除)
func (*Dao) SearchArts ¶
SearchArts get articles publish time after ptime
func (*Dao) SetRecheckCache ¶
SetRecheckCache set recheck info to redis
func (*Dao) UpdateRecheck ¶
UpdateRecheck update recheck table
func (*Dao) UpdateSearch ¶
UpdateSearch update search article table