dao

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromError

func PromError(name string, format string, args ...interface{})

PromError stat and log.

Types

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

Dao dao struct.

func New

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

New new dao.

func (*Dao) Add

func (d *Dao) Add(c context.Context, mid, fid int64) (lastID int64, err error)

Add playlist stat.

func (*Dao) AddArc

func (d *Dao) AddArc(c context.Context, pid, aid, sort int64, desc string) (lastID int64, err error)

AddArc add archive to playlist.

func (*Dao) AddArcCache

func (d *Dao) AddArcCache(c context.Context, pid int64, arc *model.ArcSort) (err error)

AddArcCache add playlist archive cache.

func (*Dao) ArcsCache

func (d *Dao) ArcsCache(c context.Context, pid int64, start, end int) (arcs []*model.ArcSort, err error)

ArcsCache get playlist archives cache.

func (*Dao) BatchAddArc

func (d *Dao) BatchAddArc(c context.Context, pid int64, arcSorts []*model.ArcSort) (lastID int64, err error)

BatchAddArc add archives to playlist.

func (*Dao) BatchDelArc

func (d *Dao) BatchDelArc(c context.Context, pid int64, aids []int64) (affected int64, err error)

BatchDelArc delete archives from playlist.

func (*Dao) BatchUpdateArcSort

func (d *Dao) BatchUpdateArcSort(c context.Context, pid int64, arcSorts []*model.ArcSort) (affected int64, err error)

BatchUpdateArcSort batch update playlist arc sort.

func (*Dao) Del

func (d *Dao) Del(c context.Context, pid int64) (affected int64, err error)

Del playlist stat.

func (*Dao) DelArc

func (d *Dao) DelArc(c context.Context, pid, aid int64) (affected int64, err error)

DelArc delete playlist archive.

func (*Dao) DelArcsCache

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

DelArcsCache delete playlist archives cache.

func (*Dao) DelCache

func (d *Dao) DelCache(c context.Context, pid int64) (err error)

DelCache del all cache .

func (*Dao) DelPlCache

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

DelPlCache delete playlist from redis.

func (*Dao) Ping

func (d *Dao) Ping(c context.Context) (err error)

Ping ping dao

func (*Dao) PlByPid

func (d *Dao) PlByPid(c context.Context, pid int64) (res *model.PlStat, err error)

PlByPid get playlist by pid.

func (*Dao) PlStatCache

func (d *Dao) PlStatCache(c context.Context, mid, pid int64) (stat *model.PlStat, err error)

PlStatCache get stat from cache.

func (*Dao) PlsByMid

func (d *Dao) PlsByMid(c context.Context, mid int64) (res []*model.PlStat, err error)

PlsByMid get playlist by mid.

func (*Dao) PlsByPid

func (d *Dao) PlsByPid(c context.Context, pids []int64) (res []*model.PlStat, err error)

PlsByPid get playlist stat by pids.

func (*Dao) PlsCache

func (d *Dao) PlsCache(c context.Context, pids []int64) (res []*model.PlStat, err error)

PlsCache get playlist by pids from cache.

func (*Dao) PubShare

func (d *Dao) PubShare(c context.Context, pid, aid, share int64) (err error)

PubShare adds a share count.

func (*Dao) PubView

func (d *Dao) PubView(c context.Context, pid, aid, view int64) (err error)

PubView adds a view count.

func (*Dao) RegReply

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

RegReply opens playlist's reply.

func (*Dao) SearchVideo

func (d *Dao) SearchVideo(c context.Context, pn, ps int, query string) (res []*model.SearchArc, count int, err error)

SearchVideo get search video.

func (*Dao) SetArcDescCache

func (d *Dao) SetArcDescCache(c context.Context, pid, aid int64, desc string) (err error)

SetArcDescCache set playlist archive desc cache.

func (*Dao) SetArcsCache

func (d *Dao) SetArcsCache(c context.Context, pid int64, arcs []*model.ArcSort) (err error)

SetArcsCache set playlist archives cache.

func (*Dao) SetPlCache

func (d *Dao) SetPlCache(c context.Context, plStats []*model.PlStat) (err error)

SetPlCache set playlist to cache.

func (*Dao) SetPlStatCache

func (d *Dao) SetPlStatCache(c context.Context, mid, pid int64, stat *model.PlStat) (err error)

SetPlStatCache set playlist stat to cache.

func (*Dao) SetStatsCache

func (d *Dao) SetStatsCache(c context.Context, mid int64, plStats []*model.PlStat) (err error)

SetStatsCache set playlist stat list to cache.

func (*Dao) StatsCache

func (d *Dao) StatsCache(c context.Context, mid int64) (res []*model.PlStat, err error)

StatsCache get playlist stats from cache.

func (*Dao) Update

func (d *Dao) Update(c context.Context, pid int64) (affected int64, err error)

Update playlist stat.

func (*Dao) UpdateArcDesc

func (d *Dao) UpdateArcDesc(c context.Context, pid, aid int64, desc string) (affected int64, err error)

UpdateArcDesc update playlist arc desc.

func (*Dao) UpdateArcSort

func (d *Dao) UpdateArcSort(c context.Context, pid, aid, sort int64) (affected int64, err error)

UpdateArcSort update playlist arc sort.

func (*Dao) Video

func (d *Dao) Video(c context.Context, pid, aid int64) (res *model.ArcSort, err error)

Video get video by pid and aid

func (*Dao) Videos

func (d *Dao) Videos(c context.Context, pid int64) (res []*model.ArcSort, err error)

Videos get playlist videos.

Jump to

Keyboard shortcuts

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