Documentation ¶
Index ¶
- type Dao
- func (d *Dao) AddDMCache(c context.Context, dm *model.DM) (err error)
- func (d *Dao) AddDMIDCache(c context.Context, tp int32, oid, cnt, n int64, dmids ...int64) (err error)
- func (d *Dao) AddDMIDSubtitleCache(c context.Context, tp int32, oid int64, dms ...*model.DM) (err error)
- func (d *Dao) AddIdxContentCaches(c context.Context, tp int32, oid int64, dms ...*model.DM) (err error)
- func (d *Dao) AddRecentDM(c context.Context, mid int64, dm *model.DM) (count int64, err error)
- func (d *Dao) AddSpecialDmCache(c context.Context, ds *model.DmSpecial) (err error)
- func (d *Dao) AddSubject(c context.Context, tp int32, oid, pid, mid, maxlimit int64, attr int32) (lastID int64, err error)
- func (d *Dao) AddSubjectCache(c context.Context, sub *model.Subject) (err error)
- func (d *Dao) AddTransferLock(c context.Context) (succeed bool)
- func (d *Dao) AddXMLCache(c context.Context, oid int64, value []byte) (err error)
- func (d *Dao) BeginBiliDMTran(c context.Context) (*sql.Tx, error)
- func (d *Dao) BeginTran(c context.Context) (*sql.Tx, error)
- func (d *Dao) BfsData(c context.Context, bfsURL string) (bs []byte, err error)
- func (d *Dao) BfsDmUpload(c context.Context, fileName string, bs []byte) (location string, err error)
- func (d *Dao) BnjConfig(c context.Context) (bnjConfig *model.BnjLiveConfig, err error)
- func (d *Dao) Content(c context.Context, oid, dmid int64) (ct *model.Content, err error)
- func (d *Dao) ContentSpecial(c context.Context, dmid int64) (contentSpe *model.ContentSpecial, err error)
- func (d *Dao) Contents(c context.Context, oid int64, dmids []int64) (ctsMap map[int64]*model.Content, err error)
- func (d *Dao) ContentsSpecial(c context.Context, dmids []int64) (res map[int64]*model.ContentSpecial, err error)
- func (d *Dao) DMCache(c context.Context, tp int32, oid int64) (res [][]byte, err error)
- func (d *Dao) DMIDCache(c context.Context, tp int32, oid int64, cnt, n, limit int64) (dmids []int64, err error)
- func (d *Dao) DMIDSubtitleCache(c context.Context, tp int32, oid int64, ps, pe, limit int64) (dmids []int64, err error)
- func (d *Dao) DMIndexs(c context.Context, tp int32, oid, minID, limit int64) (idxMap map[int64]*model.DM, dmids, special []int64, err error)
- func (d *Dao) DMSegCache(c context.Context, tp int32, oid, total, num int64) (dmSeg *model.DMSeg, err error)
- func (d *Dao) DMSpecialLocations(c context.Context, tp int32, oid int64) (locations []string, err error)
- func (d *Dao) DelAjaxDMCache(c context.Context, oid int64) (err error)
- func (d *Dao) DelDMCache(c context.Context, tp int32, oid int64) (err error)
- func (d *Dao) DelDMHideState(c context.Context, tp int32, oid int64, dmid int64) (affect int64, err error)
- func (d *Dao) DelDMIDCache(c context.Context, tp int32, oid, cnt, n int64) (err error)
- func (d *Dao) DelDMIDSubtitleCache(c context.Context, tp int32, oid int64) (err error)
- func (d *Dao) DelDMs(c context.Context, oid int64, dmids []int64, state int32) (affected int64, err error)
- func (d *Dao) DelIdxContentCaches(c context.Context, tp int32, oid int64, dmids ...int64) (err error)
- func (d *Dao) DelMaskJob(c context.Context) (err error)
- func (d *Dao) DelSpecialDmCache(c context.Context, oid int64, tp int32) (err error)
- func (d *Dao) DelSubjectCache(c context.Context, tp int32, oid int64) (err error)
- func (d *Dao) DelSubtitleCache(c context.Context, oid int64, subtitleID int64) (err error)
- func (d *Dao) DelSubtitleDraftCache(c context.Context, oid int64, tp int32, mid int64, lan uint8) (err error)
- func (d *Dao) DelTaskJob(c context.Context) (err error)
- func (d *Dao) DelTransferLock(c context.Context) (err error)
- func (d *Dao) DelVideoSubtitleCache(c context.Context, oid int64, tp int32) (err error)
- func (d *Dao) DelXMLCache(c context.Context, oid int64) (err error)
- func (d *Dao) DelXMLSegCache(c context.Context, tp int32, oid, cnt, num int64) (err error)
- func (d *Dao) DurationCache(c context.Context, oid int64) (duration int64, err error)
- func (d *Dao) ExpireDMCache(c context.Context, tp int32, oid int64) (ok bool, err error)
- func (d *Dao) ExpireDMID(c context.Context, tp int32, oid, cnt, n int64) (ok bool, err error)
- func (d *Dao) ExpireDMIDSubtitle(c context.Context, tp int32, oid int64) (ok bool, err error)
- func (d *Dao) GenerateMask(c context.Context, cid, mid int64, plat int8, priority int32, aid int64, ...) (err error)
- func (d *Dao) GetMaskJob(c context.Context) (value string, err error)
- func (d *Dao) GetSetMaskJob(c context.Context, value string) (old string, err error)
- func (d *Dao) GetSetTaskJob(c context.Context, value string) (old string, err error)
- func (d *Dao) GetSubtitle(c context.Context, oid int64, subtitleID int64) (subtitle *model.Subtitle, err error)
- func (d *Dao) GetSubtitles(c context.Context, tp int32, oid int64) (subtitles []*model.Subtitle, err error)
- func (d *Dao) GetTaskJob(c context.Context) (value string, err error)
- func (d *Dao) IdxContentCache(c context.Context, tp int32, oid int64, dmids []int64) (res []byte, missed []int64, err error)
- func (d *Dao) IdxContentCacheV2(c context.Context, tp int32, oid int64, dmids []int64) (elems []*model.Elem, missed []int64, err error)
- func (d *Dao) Indexs(c context.Context, tp int32, oid int64) (idxMap map[int64]*model.DM, dmids, special []int64, err error)
- func (d *Dao) IndexsByPool(c context.Context, tp int32, oid int64, pool int32) (dms []*model.DM, dmids []int64, err error)
- func (d *Dao) IndexsByid(c context.Context, tp int32, oid int64, dmids []int64) (idxMap map[int64]*model.DM, special []int64, err error)
- func (d *Dao) IndexsID(c context.Context, tp int32, oid int64, pool int32) (dmids []int64, err error)
- func (d *Dao) IndexsSeg(c context.Context, tp int32, oid, ps, pe, limit int64, pool int32) (res []*model.DM, dmids []int64, err error)
- func (d *Dao) IndexsSegID(c context.Context, tp int32, oid, ps, pe, limit int64, pool int32) (dmids []int64, err error)
- func (d *Dao) MaskMids(c context.Context) (mids []int64, err error)
- func (d *Dao) OneTask(c context.Context) (task *model.TaskInfo, err error)
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) RankList(c context.Context, tid int64, day int32) (resp *model.RankRecentResp, err error)
- func (d *Dao) SendWechatWorkMsg(c context.Context, content, title string, users []string) (err error)
- func (d *Dao) SetDMCache(c context.Context, tp int32, oid int64, dms []*model.DM) (err error)
- func (d *Dao) SetDMSegCache(c context.Context, tp int32, oid, total, num int64, dmSeg *model.DMSeg) (err error)
- func (d *Dao) SetDurationCache(c context.Context, oid, duration int64) (err error)
- func (d *Dao) SetXMLSegCache(c context.Context, tp int32, oid, cnt, num int64, value []byte) (err error)
- func (d *Dao) SetnxMaskJob(c context.Context, value string) (ok bool, err error)
- func (d *Dao) SetnxTaskJob(c context.Context, value string) (ok bool, err error)
- func (d *Dao) SubTask(c context.Context, id int64) (subTask *model.SubTask, err error)
- func (d *Dao) Subject(c context.Context, tp int32, oid int64) (s *model.Subject, err error)
- func (d *Dao) SubjectCache(c context.Context, tp int32, oid int64) (sub *model.Subject, err error)
- func (d *Dao) SubjectsCache(c context.Context, tp int32, oids []int64) (cached map[int64]*model.Subject, missed []int64, err error)
- func (d *Dao) TaskInfoByID(c context.Context, id int64) (task *model.TaskInfo, err error)
- func (d *Dao) TaskInfos(c context.Context, state int32) (tasks []*model.TaskInfo, err error)
- func (d *Dao) TaskSearchRes(c context.Context, task *model.TaskInfo) (count int64, result string, state int32, err error)
- func (d *Dao) Transfers(c context.Context, state int8) (trans []*model.Transfer, err error)
- func (d *Dao) TrimDMCache(c context.Context, tp int32, oid, count int64) (err error)
- func (d *Dao) TrimRecentDM(c context.Context, mid, count int64) (err error)
- func (d *Dao) TxAddContent(tx *sql.Tx, oid int64, m *model.Content) (id int64, err error)
- func (d *Dao) TxAddContentSpecial(tx *sql.Tx, m *model.ContentSpecial) (id int64, err error)
- func (d *Dao) TxAddIndex(tx *sql.Tx, m *model.DM) (id int64, err error)
- func (d *Dao) TxAddSubtitlePub(tx *sql.Tx, subtitlePub *model.SubtitlePub) (err error)
- func (d *Dao) TxIncrSubMCount(tx *sql.Tx, tp int32, oid int64) (affect int64, err error)
- func (d *Dao) TxIncrSubjectCount(tx *sql.Tx, tp int32, oid, acount, count int64, childpool int32) (affect int64, err error)
- func (d *Dao) TxUpdateSubtitle(tx *sql.Tx, subtitle *model.Subtitle) (err error)
- func (d *Dao) UpdateChildpool(c context.Context, tp int32, oid int64, childpool int32) (affect int64, err error)
- func (d *Dao) UpdateSubAttr(c context.Context, tp int32, oid int64, attr int32) (affect int64, err error)
- func (d *Dao) UpdateSubMid(c context.Context, tp int32, oid, mid int64) (affect int64, err error)
- func (d *Dao) UpdateSubtitle(c context.Context, subtitle *model.Subtitle) (err error)
- func (d *Dao) UpdateTask(c context.Context, task *model.TaskInfo) (affected int64, err error)
- func (d *Dao) UpdateTransfer(c context.Context, t *model.Transfer) (affect int64, err error)
- func (d *Dao) UpsertDmSpecialLocation(c context.Context, tp int32, oid int64, locations string) (err error)
- func (d *Dao) UptSubTask(c context.Context, taskID, delCount int64, end time.Time) (affected int64, err error)
- func (d *Dao) UptSubjectCount(c context.Context, tp int32, oid, count int64) (affected int64, err error)
- func (d *Dao) Videos(c context.Context, aid int64) (videos []*model.Video, err error)
- func (d *Dao) XMLCache(c context.Context, oid int64) (data []byte, err error)
- func (d *Dao) ZRemRecentDM(c context.Context, mid, dmid int64) (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 struct
func (*Dao) AddDMCache ¶
AddDMCache add dm to redis.
func (*Dao) AddDMIDCache ¶
func (d *Dao) AddDMIDCache(c context.Context, tp int32, oid, cnt, n int64, dmids ...int64) (err error)
AddDMIDCache add dmid(normal and special) to segment redis.
func (*Dao) AddDMIDSubtitleCache ¶
func (d *Dao) AddDMIDSubtitleCache(c context.Context, tp int32, oid int64, dms ...*model.DM) (err error)
AddDMIDSubtitleCache add subtitle dmid to redis.
func (*Dao) AddIdxContentCaches ¶
func (d *Dao) AddIdxContentCaches(c context.Context, tp int32, oid int64, dms ...*model.DM) (err error)
AddIdxContentCaches add index content cache to redis.
func (*Dao) AddRecentDM ¶
AddRecentDM add recent dm of up to redis.
func (*Dao) AddSpecialDmCache ¶
AddSpecialDmCache add special content to memcache.
func (*Dao) AddSubject ¶
func (d *Dao) AddSubject(c context.Context, tp int32, oid, pid, mid, maxlimit int64, attr int32) (lastID int64, err error)
AddSubject insert subject.
func (*Dao) AddSubjectCache ¶
AddSubjectCache add subject cache.
func (*Dao) AddTransferLock ¶
AddTransferLock 添加弹幕转移并发锁
func (*Dao) AddXMLCache ¶
AddXMLCache add xml content to memcache.
func (*Dao) BeginBiliDMTran ¶
BeginBiliDMTran .
func (*Dao) BfsDmUpload ¶
func (d *Dao) BfsDmUpload(c context.Context, fileName string, bs []byte) (location string, err error)
BfsDmUpload .
func (*Dao) ContentSpecial ¶
func (d *Dao) ContentSpecial(c context.Context, dmid int64) (contentSpe *model.ContentSpecial, err error)
ContentSpecial get special dm content by dmids.
func (*Dao) Contents ¶
func (d *Dao) Contents(c context.Context, oid int64, dmids []int64) (ctsMap map[int64]*model.Content, err error)
Contents multi get dm content by dmids.
func (*Dao) ContentsSpecial ¶
func (d *Dao) ContentsSpecial(c context.Context, dmids []int64) (res map[int64]*model.ContentSpecial, err error)
ContentsSpecial multi get special dm content by dmids.
func (*Dao) DMIDCache ¶
func (d *Dao) DMIDCache(c context.Context, tp int32, oid int64, cnt, n, limit int64) (dmids []int64, err error)
DMIDCache return dm ids.
func (*Dao) DMIDSubtitleCache ¶
func (d *Dao) DMIDSubtitleCache(c context.Context, tp int32, oid int64, ps, pe, limit int64) (dmids []int64, err error)
DMIDSubtitleCache get subtitle dmid.
func (*Dao) DMIndexs ¶
func (d *Dao) DMIndexs(c context.Context, tp int32, oid, minID, limit int64) (idxMap map[int64]*model.DM, dmids, special []int64, err error)
DMIndexs get dm indexs info
func (*Dao) DMSegCache ¶
func (d *Dao) DMSegCache(c context.Context, tp int32, oid, total, num int64) (dmSeg *model.DMSeg, err error)
DMSegCache dm segment pb cache.
func (*Dao) DMSpecialLocations ¶
func (d *Dao) DMSpecialLocations(c context.Context, tp int32, oid int64) (locations []string, err error)
DMSpecialLocations .
func (*Dao) DelAjaxDMCache ¶
DelAjaxDMCache delete ajax dm from memcache.
func (*Dao) DelDMCache ¶
DelDMCache delete redis cache of oid.
func (*Dao) DelDMHideState ¶
func (d *Dao) DelDMHideState(c context.Context, tp int32, oid int64, dmid int64) (affect int64, err error)
DelDMHideState del dm hide state
func (*Dao) DelDMIDCache ¶
DelDMIDCache delete dm segment cache.
func (*Dao) DelDMIDSubtitleCache ¶
DelDMIDSubtitleCache delete subtitle dmid cache.
func (*Dao) DelDMs ¶
func (d *Dao) DelDMs(c context.Context, oid int64, dmids []int64, state int32) (affected int64, err error)
DelDMs dm task del dms.
func (*Dao) DelIdxContentCaches ¶
func (d *Dao) DelIdxContentCaches(c context.Context, tp int32, oid int64, dmids ...int64) (err error)
DelIdxContentCaches del index content cache.
func (*Dao) DelSpecialDmCache ¶
DelSpecialDmCache .
func (*Dao) DelSubjectCache ¶
DelSubjectCache delete subject memcache cache.
func (*Dao) DelSubtitleCache ¶
DelSubtitleCache .
func (*Dao) DelSubtitleDraftCache ¶
func (d *Dao) DelSubtitleDraftCache(c context.Context, oid int64, tp int32, mid int64, lan uint8) (err error)
DelSubtitleDraftCache .
func (*Dao) DelTransferLock ¶
DelTransferLock 删除弹幕转移并发锁
func (*Dao) DelVideoSubtitleCache ¶
DelVideoSubtitleCache .
func (*Dao) DelXMLCache ¶
DelXMLCache delete xml content.
func (*Dao) DelXMLSegCache ¶
DelXMLSegCache delete segment xml content.
func (*Dao) DurationCache ¶
DurationCache return duration of video.
func (*Dao) ExpireDMCache ¶
ExpireDMCache expire dm.
func (*Dao) ExpireDMID ¶
ExpireDMID set expire time of index.
func (*Dao) ExpireDMIDSubtitle ¶
ExpireDMIDSubtitle set expire time of subtitle dmid.
func (*Dao) GenerateMask ¶
func (d *Dao) GenerateMask(c context.Context, cid, mid int64, plat int8, priority int32, aid int64, duration int64, typeID int32) (err error)
GenerateMask ask AI to generate dm mask
func (*Dao) GetMaskJob ¶
GetMaskJob .
func (*Dao) GetSetMaskJob ¶
GetSetMaskJob .
func (*Dao) GetSetTaskJob ¶
GetSetTaskJob .
func (*Dao) GetSubtitle ¶
func (d *Dao) GetSubtitle(c context.Context, oid int64, subtitleID int64) (subtitle *model.Subtitle, err error)
GetSubtitle .
func (*Dao) GetSubtitles ¶
func (d *Dao) GetSubtitles(c context.Context, tp int32, oid int64) (subtitles []*model.Subtitle, err error)
GetSubtitles .
func (*Dao) GetTaskJob ¶
GetTaskJob .
func (*Dao) IdxContentCache ¶
func (d *Dao) IdxContentCache(c context.Context, tp int32, oid int64, dmids []int64) (res []byte, missed []int64, err error)
IdxContentCache get xml info by dmid.
func (*Dao) IdxContentCacheV2 ¶
func (d *Dao) IdxContentCacheV2(c context.Context, tp int32, oid int64, dmids []int64) (elems []*model.Elem, missed []int64, err error)
IdxContentCacheV2 get elems info by dmid.
func (*Dao) Indexs ¶
func (d *Dao) Indexs(c context.Context, tp int32, oid int64) (idxMap map[int64]*model.DM, dmids, special []int64, err error)
Indexs get dm index by type and oid.
func (*Dao) IndexsByPool ¶
func (d *Dao) IndexsByPool(c context.Context, tp int32, oid int64, pool int32) (dms []*model.DM, dmids []int64, err error)
IndexsByPool get dm index by type,oid and pool.
func (*Dao) IndexsByid ¶
func (d *Dao) IndexsByid(c context.Context, tp int32, oid int64, dmids []int64) (idxMap map[int64]*model.DM, special []int64, err error)
IndexsByid get dm index by dmids.
func (*Dao) IndexsID ¶
func (d *Dao) IndexsID(c context.Context, tp int32, oid int64, pool int32) (dmids []int64, err error)
IndexsID get dmids.
func (*Dao) IndexsSeg ¶
func (d *Dao) IndexsSeg(c context.Context, tp int32, oid, ps, pe, limit int64, pool int32) (res []*model.DM, dmids []int64, err error)
IndexsSeg get segment index info from db by ps and pe.
func (*Dao) IndexsSegID ¶
func (d *Dao) IndexsSegID(c context.Context, tp int32, oid, ps, pe, limit int64, pool int32) (dmids []int64, err error)
IndexsSegID get segment dmids.
func (*Dao) RankList ¶
func (d *Dao) RankList(c context.Context, tid int64, day int32) (resp *model.RankRecentResp, err error)
RankList get data rank by tid
func (*Dao) SendWechatWorkMsg ¶
func (d *Dao) SendWechatWorkMsg(c context.Context, content, title string, users []string) (err error)
SendWechatWorkMsg send wechat work msg.
func (*Dao) SetDMCache ¶
SetDMCache flush dm list to redis.
func (*Dao) SetDMSegCache ¶
func (d *Dao) SetDMSegCache(c context.Context, tp int32, oid, total, num int64, dmSeg *model.DMSeg) (err error)
SetDMSegCache set segment dm to cache.
func (*Dao) SetDurationCache ¶
SetDurationCache set video duration to redis.
func (*Dao) SetXMLSegCache ¶
func (d *Dao) SetXMLSegCache(c context.Context, tp int32, oid, cnt, num int64, value []byte) (err error)
SetXMLSegCache set dm xml content into memcache.
func (*Dao) SetnxMaskJob ¶
SetnxMaskJob setnx mask_job value
func (*Dao) SetnxTaskJob ¶
SetnxTaskJob setnx task_job value
func (*Dao) SubjectCache ¶
SubjectCache get subject from memcache.
func (*Dao) SubjectsCache ¶
func (d *Dao) SubjectsCache(c context.Context, tp int32, oids []int64) (cached map[int64]*model.Subject, missed []int64, err error)
SubjectsCache multi get subject from memcache.
func (*Dao) TaskInfoByID ¶
TaskInfoByID .
func (*Dao) TaskSearchRes ¶
func (d *Dao) TaskSearchRes(c context.Context, task *model.TaskInfo) (count int64, result string, state int32, err error)
TaskSearchRes get res from BI url
func (*Dao) TrimDMCache ¶
TrimDMCache 从redis列表中pop掉count条弹幕.
func (*Dao) TrimRecentDM ¶
TrimRecentDM zrange remove recent dm of up.
func (*Dao) TxAddContent ¶
TxAddContent add content of dm by transcation.
func (*Dao) TxAddContentSpecial ¶
TxAddContentSpecial add special dm by transcation.
func (*Dao) TxAddIndex ¶
TxAddIndex add index of dm by transcation.
func (*Dao) TxAddSubtitlePub ¶
TxAddSubtitlePub .
func (*Dao) TxIncrSubMCount ¶
TxIncrSubMCount update monitor dm count.
func (*Dao) TxIncrSubjectCount ¶
func (d *Dao) TxIncrSubjectCount(tx *sql.Tx, tp int32, oid, acount, count int64, childpool int32) (affect int64, err error)
TxIncrSubjectCount update acount,count,childpool of dm by transcation.
func (*Dao) TxUpdateSubtitle ¶
TxUpdateSubtitle .
func (*Dao) UpdateChildpool ¶
func (d *Dao) UpdateChildpool(c context.Context, tp int32, oid int64, childpool int32) (affect int64, err error)
UpdateChildpool update childpool.
func (*Dao) UpdateSubAttr ¶
func (d *Dao) UpdateSubAttr(c context.Context, tp int32, oid int64, attr int32) (affect int64, err error)
UpdateSubAttr .
func (*Dao) UpdateSubMid ¶
UpdateSubMid update mid in dm_subject.
func (*Dao) UpdateSubtitle ¶
UpdateSubtitle update subtitle mid
func (*Dao) UpdateTask ¶
UpdateTask update dm task.
func (*Dao) UpdateTransfer ¶
UpdateTransfer change transfer job state.
func (*Dao) UpsertDmSpecialLocation ¶
func (d *Dao) UpsertDmSpecialLocation(c context.Context, tp int32, oid int64, locations string) (err error)
UpsertDmSpecialLocation .
func (*Dao) UptSubTask ¶
func (d *Dao) UptSubTask(c context.Context, taskID, delCount int64, end time.Time) (affected int64, err error)
UptSubTask uopdate dm sub task.
func (*Dao) UptSubjectCount ¶
func (d *Dao) UptSubjectCount(c context.Context, tp int32, oid, count int64) (affected int64, err error)
UptSubjectCount update count.