ugc

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	DB *sql.DB
	// contains filtered or unexported fields
}

Dao dao.

func New

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

New create a instance of Dao and return.

func (*Dao) ActVideos

func (d *Dao) ActVideos(c context.Context, aid int64) (has bool, err error)

ActVideos checks whether there is still some active videos

func (*Dao) ArcVideoCnt

func (d *Dao) ArcVideoCnt(c context.Context, aid int64) (count int, err error)

ArcVideoCnt counts one archive's video

func (*Dao) BeginTran

func (d *Dao) BeginTran(c context.Context) (*sql.Tx, error)

BeginTran begin mysql transaction

func (*Dao) Close

func (d *Dao) Close()

Close close the redis and kafka resource.

func (*Dao) CountUpArcs

func (d *Dao) CountUpArcs(c context.Context, mid int64) (count int64, err error)

CountUpArcs counts the upper's archives

func (*Dao) DelVideoArc

func (d *Dao) DelVideoArc(ctx context.Context, req *ugc.DelVideos) (arcValid bool, err error)

DelVideoArc deletes some videos of an archive, if the archive is empty, also delete it

func (*Dao) DelVideos

func (d *Dao) DelVideos(ctx context.Context, aid int64) (err error)

DelVideos delete one archive all videos

func (*Dao) DeletedArc

func (d *Dao) DeletedArc(c context.Context) (aid int64, err error)

DeletedArc picks the deleted archive to sync

func (*Dao) DeletedUp

func (d *Dao) DeletedUp(c context.Context) (mid int64, err error)

DeletedUp picks the deleted uppers, toinit = 2 and deleted = 1

func (*Dao) DeletedVideos

func (d *Dao) DeletedVideos(c context.Context) (delIds []int, err error)

DeletedVideos picks the deleted videos to sync

func (*Dao) FilterExist

func (d *Dao) FilterExist(c context.Context, res *map[int64]*api.Arc, aids []int64) (err error)

FilterExist filters the existing archives and remove them from the res, to have only non-existing data to insert

func (*Dao) FinishArc

func (d *Dao) FinishArc(c context.Context, aid int64) (err error)

FinishArc updates the submit status from 1 to 0

func (*Dao) FinishDelArc

func (d *Dao) FinishDelArc(c context.Context, aid int64) (err error)

FinishDelArc updates the submit status from 1 to 0

func (*Dao) FinishDelUp

func (d *Dao) FinishDelUp(c context.Context, mid int64) (err error)

FinishDelUp updates the submit toinit from 2 to 0

func (*Dao) FinishDelVideos

func (d *Dao) FinishDelVideos(c context.Context, delIds []int) (err error)

FinishDelVideos updates the submit status from 1 to 0

func (*Dao) FinishReport

func (d *Dao) FinishReport(c context.Context, cids []int64) (err error)

FinishReport change's the ugc_video's state from 0 to 1, means it has already been reported

func (*Dao) FinishUpper

func (d *Dao) FinishUpper(c context.Context, mid int64) (err error)

FinishUpper updates the upper's to_init status to 0 means we finish the import operation

func (*Dao) FinishVideos

func (d *Dao) FinishVideos(c context.Context, videos []*ugcmdl.SimpleVideo, aid int64) (err error)

FinishVideos updates the submit status from 1 to 0

func (*Dao) Import

func (d *Dao) Import(c context.Context) (res []*ugcmdl.Upper, err error)

Import picks the uppers to init with the RPC data

func (*Dao) Manual

func (d *Dao) Manual(c context.Context) (res []*ugcmdl.Archive, err error)

Manual picks the archives that added manually

func (*Dao) ParseArc

func (d *Dao) ParseArc(c context.Context, aid int64) (res *ugcmdl.Archive, err error)

ParseArc parses one archive data

func (*Dao) ParseVideos

func (d *Dao) ParseVideos(c context.Context, aid int64, ps int) (res [][]*ugcmdl.SimpleVideo, err error)

ParseVideos picks 20 videos of one qualified archive

func (*Dao) PassedArcs

func (d *Dao) PassedArcs(c context.Context, tids []int64) (res []*common.IdxRank, err error)

PassedArcs picks the passed Arc data for Idx Page

func (*Dao) PickArcVideo

func (d *Dao) PickArcVideo(ctx context.Context, aid int64, LastID int, nbData int) (res []*ugcmdl.VideoCMS, myLast int, err error)

PickArcVideo picks data by Piece to sync in MC

func (*Dao) PickUpArcs

func (d *Dao) PickUpArcs(ctx context.Context, mid, nbPiece, nbData int) (res []*ugcmdl.ArcFull, err error)

PickUpArcs picks data by Piece to sync in MC, attention: nbPiece begins from zero

func (*Dao) PickVideos

func (d *Dao) PickVideos(c context.Context, aid int64) (res map[int64]*ugcmdl.SimpleVideo, err error)

PickVideos picks the videos of an archive in one shot

func (*Dao) PpDelArc

func (d *Dao) PpDelArc(c context.Context, aid int64) (err error)

PpDelArc postpones the archive's submit in 30 mins

func (*Dao) PpDelUp

func (d *Dao) PpDelUp(c context.Context, mid int64) (err error)

PpDelUp postpones the upper's videos submit in 30 mins

func (*Dao) PpDelVideos

func (d *Dao) PpDelVideos(c context.Context, delIds []int) (err error)

PpDelVideos postpones the archive's videos submit in 30 mins

func (*Dao) PpUpper

func (d *Dao) PpUpper(c context.Context, mid int64) (err error)

PpUpper means postpone upper init operation due to some error happened

func (*Dao) PpVideos

func (d *Dao) PpVideos(c context.Context, cids []int64) (err error)

PpVideos postpones the archive's videos submit in 30 mins

func (*Dao) Ppmnl

func (d *Dao) Ppmnl(c context.Context, aid int64) (err error)

Ppmnl means postpone manual operation due to some error happened

func (*Dao) RepCidBatch

func (d *Dao) RepCidBatch(c context.Context, cidReq []*ugcmdl.CidReq) (err error)

RepCidBatch reports cid info to VideoCloud api

func (*Dao) SetArcCMS

func (d *Dao) SetArcCMS(ctx context.Context, res *ugcmdl.ArcCMS) (err error)

SetArcCMS in MC

func (*Dao) SetVideoCMS

func (d *Dao) SetVideoCMS(ctx context.Context, res *ugcmdl.VideoCMS) (err error)

SetVideoCMS in MC

func (*Dao) ShouldAudit

func (d *Dao) ShouldAudit(c context.Context, aid int64) (res bool, err error)

ShouldAudit distinguishes whether the archive should ask for audit or not

func (*Dao) TotalVideos

func (d *Dao) TotalVideos(c context.Context) (count int, err error)

TotalVideos counts the total number of arcs, including the deleted ones

func (*Dao) TransFailVideos

func (d *Dao) TransFailVideos(ctx context.Context, aid int64) (cids []int64, err error)

TransFailVideos picks transcoding failure videos

func (*Dao) TxAddVideos

func (d *Dao) TxAddVideos(tx *sql.Tx, pages []*arccli.Page, aid int64) (err error)

TxAddVideos add into the db the new videos

func (*Dao) TxAutoArc

func (d *Dao) TxAutoArc(tx *sql.Tx, arc *ugcmdl.Archive) (err error)

TxAutoArc imports the db an arc

func (*Dao) TxDelArc

func (d *Dao) TxDelArc(tx *sql.Tx, aid int64) (err error)

TxDelArc deletes an arc

func (*Dao) TxDelVideo

func (d *Dao) TxDelVideo(tx *sql.Tx, cid int64) (err error)

TxDelVideo deletes a video

func (*Dao) TxDelVideos

func (d *Dao) TxDelVideos(tx *sql.Tx, aid int64) (err error)

TxDelVideos deletes the videos of an arc

func (*Dao) TxImportArc

func (d *Dao) TxImportArc(tx *sql.Tx, arc *api.Arc) (err error)

TxImportArc imports an arc

func (*Dao) TxMnlArc

func (d *Dao) TxMnlArc(tx *sql.Tx, arc *ugcmdl.Archive) (err error)

TxMnlArc updates the db with data from API

func (*Dao) TxMnlStatus

func (d *Dao) TxMnlStatus(tx *sql.Tx, aid int64) (err error)

TxMnlStatus updates the aid's manual status to 0

func (*Dao) TxMnlVideos

func (d *Dao) TxMnlVideos(tx *sql.Tx, view *arccli.ViewReply) (err error)

TxMnlVideos updates the db with data from API, if the

func (*Dao) TxUpAdd

func (d *Dao) TxUpAdd(tx *sql.Tx, mid int64) (err error)

TxUpAdd adds the upper

func (*Dao) TxUpdateVideo

func (d *Dao) TxUpdateVideo(tx *sql.Tx, video *arccli.Page) (err error)

TxUpdateVideo updates the ugc video's status, for databus update

func (*Dao) UgcCnt

func (d *Dao) UgcCnt(ctx context.Context) (upCnt int, err error)

UgcCnt is used for getting valid data count

func (*Dao) UgcCont

func (d *Dao) UgcCont(ctx context.Context, aid int, limit int) (res []*model.SearUgcCon, maxID int, err error)

UgcCont is used for getting valid ugc archive data

func (*Dao) UpArcs

func (d *Dao) UpArcs(c context.Context, mid int64) (aids []int64, err error)

UpArcs picks 50 arcs of the upper

func (*Dao) UpArcsCnt

func (d *Dao) UpArcsCnt(c context.Context, mid int64) (count int, err error)

UpArcsCnt counts the total number of arcs, including the deleted ones

func (*Dao) UpInList

func (d *Dao) UpInList(c context.Context, mid int64) (realID int64, err error)

UpInList checks whether the upper is in our list

func (*Dao) UpdateArc

func (d *Dao) UpdateArc(c context.Context, arc *ugcmdl.ArchDatabus) (err error)

UpdateArc updates the key fields of an archive, used for databus monitoring

func (*Dao) VideoSubmit

func (d *Dao) VideoSubmit(c context.Context, aid int64) (cid int64, err error)

VideoSubmit tells whether the archive already has some video submitted

Jump to

Keyboard shortcuts

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