service

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 Service

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

Service define fav service

func New

func New(c *conf.Config) (s *Service)

New return fav service

func (*Service) AddArc

func (s *Service) AddArc(c context.Context, mid, fid, aid int64, ck, ak string) (err error)

AddArc add a archive into folder.

func (*Service) AddArcToFolders

func (s *Service) AddArcToFolders(c context.Context, mid, aid int64, fids []int64, ck, ak string) (err error)

AddArcToFolders add a archive into multi folders.

func (*Service) AddFavFolder

func (s *Service) AddFavFolder(c context.Context, mid int64, name, cookie, accessKey string, state int32) (fid int64, err error)

AddFavFolder add a new favorite folder

func (*Service) AddFavRPC

func (s *Service) AddFavRPC(c context.Context, typ int8, mid, aid, fid int64) (err error)

AddFavRPC add favorite .

func (*Service) AddFavTopic

func (s *Service) AddFavTopic(c context.Context, mid, tpID int64, ck, ak string) (err error)

AddFavTopic add fav topic

func (*Service) AllFoldersRPC

func (s *Service) AllFoldersRPC(c context.Context, typ int8, mid, vmid, oid int64, ip string) (fs []*favmdl.Folder, err error)

AllFoldersRPC user's folders list.

func (*Service) ArcRPC

func (s *Service) ArcRPC(c context.Context, aid int64) (a *api.Arc, err error)

ArcRPC find archive by rpc

func (*Service) ArcsRPC

func (s *Service) ArcsRPC(c context.Context, aids []int64) (as map[int64]*api.Arc, err error)

ArcsRPC find archives by rpc

func (*Service) CleanInvalidArcs

func (s *Service) CleanInvalidArcs(c context.Context, mid, fid int64) (err error)

CleanInvalidArcs clean invalid archives.

func (*Service) CleanState

func (s *Service) CleanState(c context.Context, mid, fid int64) (cleanState int, err error)

CleanState return this folder clean state.

func (*Service) Close

func (s *Service) Close()

Close close service

func (*Service) CopyArcs

func (s *Service) CopyArcs(c context.Context, mid, oldmid, oldfid, newfid int64, aids []int64) (err error)

CopyArcs copy archives to other favorite.

func (*Service) DelArc

func (s *Service) DelArc(c context.Context, mid, fid, aid int64) (err error)

DelArc delete a archive from favorite.

func (*Service) DelArcs

func (s *Service) DelArcs(c context.Context, mid, fid int64, aids []int64) (err error)

DelArcs delete some archives from favorite.

func (*Service) DelFavRPC

func (s *Service) DelFavRPC(c context.Context, typ int8, mid, aid, fid int64) (err error)

DelFavRPC del favorite .

func (*Service) DelFavTopic

func (s *Service) DelFavTopic(c context.Context, mid, tpID int64) (err error)

DelFavTopic del fav topic

func (*Service) DelVideoFolder

func (s *Service) DelVideoFolder(c context.Context, mid, fid int64) (err error)

DelVideoFolder delete favFolder and push databus msg to del videos in folder.

func (*Service) FavFolders

func (s *Service) FavFolders(c context.Context, mid, vmid, uid, aid int64, isSelf bool, mediaList bool, fromWeb bool) (res []*model.VideoFolder, err error)

FavFolders get mid user's favorites.

func (*Service) FavTopics

func (s *Service) FavTopics(c context.Context, mid int64, pn, ps int, appInfo *model.AppInfo) (res *model.TopicList, err error)

FavTopics get fav topics

func (*Service) FavVideo

func (s *Service) FavVideo(c context.Context, mid, vmid, uid, fid int64, keyword, order string, tid, pn, ps int) (sv *model.SearchArchive, err error)

FavVideo get fav videos from search or db

func (*Service) FavoritesRPC

func (s *Service) FavoritesRPC(c context.Context, typ int8, mid, vmid, fid int64, tid int, keyword, order string, pn, ps int) (favs *favmdl.Favorites, err error)

FavoritesRPC favorites list.

func (*Service) FolderRPC

func (s *Service) FolderRPC(c context.Context, typ int8, fid, mid, vmid int64) (f *favmdl.Folder, err error)

FolderRPC user's folder .

func (*Service) InDef

func (s *Service) InDef(c context.Context, mid, aid int64) (isin bool, err error)

InDef detemine aid whether or not archive in default folder.

func (*Service) InDefaultRPC

func (s *Service) InDefaultRPC(c context.Context, typ int8, mid, aid int64) (res bool, err error)

InDefaultRPC return aid whether in default fodler.

func (*Service) IsFavByFidRPC

func (s *Service) IsFavByFidRPC(c context.Context, typ int8, mid, aid int64, fid int64) (res bool, err error)

IsFavByFidRPC return user whether favored

func (*Service) IsFavRPC

func (s *Service) IsFavRPC(c context.Context, typ int8, mid, aid int64) (res bool, err error)

IsFavRPC return user whether favored

func (*Service) IsFaved

func (s *Service) IsFaved(c context.Context, mid, aid int64) (faved bool, count int, err error)

IsFaved check if aid faved by user

func (*Service) IsFaveds

func (s *Service) IsFaveds(c context.Context, mid int64, aids []int64) (m map[int64]bool, err error)

IsFaveds check if aids faved by user

func (*Service) IsFavsRPC

func (s *Service) IsFavsRPC(c context.Context, typ int8, mid int64, aids []int64) (res map[int64]bool, err error)

IsFavsRPC return user's oids whether favored

func (*Service) IsTopicFavoured

func (s *Service) IsTopicFavoured(c context.Context, mid, tpID int64) (faved bool, err error)

IsTopicFavoured topic is favoured.

func (*Service) MoveArcs

func (s *Service) MoveArcs(c context.Context, mid, oldfid, newfid int64, aids []int64) (err error)

MoveArcs move archives from old favorite to new favorite

func (*Service) Ping

func (s *Service) Ping(c context.Context) (err error)

Ping check service health

func (*Service) PromError

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

PromError stat and log.

func (*Service) RecentArcs

func (s *Service) RecentArcs(c context.Context, mid int64, pageNum, pageSize int) (sv *model.SearchArchive, err error)

RecentArcs return the newest archives in all folder.

func (*Service) RecentsRPC

func (s *Service) RecentsRPC(c context.Context, typ int8, mid int64, size int) (aids []int64, err error)

RecentsRPC recent favs .

func (*Service) SetVideoFolderSort

func (s *Service) SetVideoFolderSort(c context.Context, mid int64, fids []int64) (err error)

SetVideoFolderSort set folder sort.

func (*Service) TidList

func (s *Service) TidList(c context.Context, mid, vmid, uid, fid int64) (res []*model.Partition, err error)

TidList get video folder type names from search.

func (*Service) TlistsRPC

func (s *Service) TlistsRPC(c context.Context, typ int8, mid, vmid, fid int64) (ps []*favmdl.Partition, err error)

TlistsRPC archive type list.

func (*Service) TypesRPC

func (s *Service) TypesRPC(c context.Context) (ats map[int16]*arcmdl.ArcType, err error)

TypesRPC find all archives's type by rpc

func (*Service) UpFavName

func (s *Service) UpFavName(c context.Context, mid, fid int64, name, cookie, accessKey string) (err error)

UpFavName update favorite name.

func (*Service) UpFavState

func (s *Service) UpFavState(c context.Context, mid, fid int64, public int32, cookie string, accessKey string) (err error)

UpFavState update folder state.

Jump to

Keyboard shortcuts

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