Documentation ¶
Index ¶
- Constants
- Variables
- func AddTaskMessage(s string) error
- func AllHash(session *xorm.Session, limit int, start ...int) (unfins *[]*Hash, e error)
- func ByteIndex(idx byte) int
- func CheckDatabase() bool
- func CheckNode() bool
- func Checksum(filepath string) string
- func CidHash(path path.Resolved) string
- func DeleteTaskMessage(s string) error
- func ExistVerifyFunc(tp string, f func(interface{}) string, v ...interface{}) bool
- func ExistVerifyString(tp string, v ...string) bool
- func FileAbsName(filename string) string
- func FileName(filename string) string
- func FindAll(model IModel, f FindResult, limit int, start ...int) (e error)
- func GetFileIndex(filename string) int
- func GetFiles(name string, regex string) (files []string)
- func GetNameIndex(name string) int
- func IndexByte(index int) byte
- func InitMySQL(ops ...ConfigOptions) (*xorm.Engine, error)
- func InitSQLite3(name string) (eng *xorm.Engine, e error)
- func InsertOrUpdate(m IModel) (i int64, e error)
- func IsExist(m IModel) bool
- func IsMedia(format *split.StreamFormat) bool
- func IsPicture(name string) bool
- func IsVideo(filename string) bool
- func LastSplit(s, sep string) string
- func MustDatabase(engine *xorm.Engine, err error) *xorm.Engine
- func MustSession(session *xorm.Session) *xorm.Session
- func MustString(val, src string) string
- func RegisterCache()
- func RegisterDatabase(engine *xorm.Engine)
- func RegisterNode(node Node)
- func ResolvedHash(path path.Resolved) (string, error)
- func SetCachePath(path string)
- func SyncTable() (e error)
- func UUID() uuid.UUID
- func Wrap(err error) error
- type Actor
- type BeforeInsert
- type ConfigOptions
- type Extend
- type FindResult
- type Fragment
- type FragmentOption
- type Genre
- type Hash
- type HashType
- type IModel
- type ISync
- type IVideo
- type IWork
- type Model
- type Node
- type PeerID
- type PoolMessage
- type Sample
- type Scale
- type Task
- func (t *Task) AddWorker(work IWork) error
- func (t *Task) AllRun() (works []IWork, e error)
- func (t *Task) AutoStop() bool
- func (t *Task) Finish(id string)
- func (t *Task) GetWork(id string) (IWork, error)
- func (t *Task) GetWorkStatus(id string) (WorkStatus, error)
- func (t *Task) Running(work IWork) (b bool)
- func (t *Task) SetAutoStop(autoStop bool)
- func (t *Task) Start() error
- func (t *Task) StartWork(id string) error
- func (t *Task) Stop()
- func (t *Task) StopWork(id string)
- type Video
- type VideoPornInfo
- type VideoPornSource
- type VideoProcessFunc
- type Work
- func (w Work) CheckStop(f func() error) error
- func (w Work) ID() string
- func (w *Work) Info() string
- func (w Work) Output() string
- func (w *Work) Reset() error
- func (w *Work) Run(ctx context.Context) (e error)
- func (w *Work) Status() WorkStatus
- func (w *Work) Stop() error
- func (w *Work) Store() error
- func (w *Work) Update() error
- func (w *Work) Video() *Video
- func (w *Work) Work() *Work
- type WorkImpl
- type WorkOptions
- func IDOption(id string) WorkOptions
- func OutputPathOption(path string) WorkOptions
- func PosterPathOption(path string) WorkOptions
- func SamplePathOption(path []string) WorkOptions
- func ScaleOption(scale Scale) WorkOptions
- func SkipOption(skip ...string) WorkOptions
- func ThumbPathOption(path string) WorkOptions
- func VideoPathOption(path []string) WorkOptions
- type WorkStatus
Constants ¶
View Source
const ( NodeTypeCluster = "cluster" NodeTypeSingle = "single" NodeTypeDummy = "dummy" )
NodeTypeCluster ...
Variables ¶
View Source
var CachePath = cache.DefaultPath
CachePath ...
View Source
var DefaultLimit = 3
DefaultLimit ...
View Source
var ErrWorkFinish = errors.New("work was finished")
ErrWorkFinish ...
View Source
var ErrWorkID = errors.New("video id must input")
ErrWorkID ...
View Source
var ErrWrongCastType = errors.New("something wrong when cast to type")
ErrWrongCastType ...
View Source
var WorkRunProcessFunction = map[string]VideoProcessFunc{
"source": decodeSource,
"info": decodeInfo,
}
WorkRunProcessFunction ...
Functions ¶
func ExistVerifyFunc ¶
ExistVerifyFunc ...
Types ¶
type Actor ¶
type Actor struct { Image string `json:"Image"` StarLink string `json:"StarLink"` Name string `json:"Name"` Alias []string `json:"Alias"` }
Actor ...
type Hash ¶
type Hash struct { Model `xorm:"extends"` Checksum string `xorm:"default() checksum" json:"checksum"` //sum值 HashType HashType `xorm:"default() hash_type" json:"hash_type"` //类型 Episode string `xorm:"default() episode" json:"episode"` //总集数 Name string `xorm:"default() name" json:"name"` //banno Hash string `xorm:"default() hash" json:"hash"` //哈希地址 Sharpness string `xorm:"default() sharpness" json:"sharpness"` //清晰度 Caption string `xorm:"default() caption" json:"caption"` //字幕 Encrypt bool `xorm:"default() encrypt" json:"encrypt"` //加密 Key string `xorm:"default() key" json:"key"` //秘钥 M3U8 string `xorm:"default() m3u8" json:"m3u8"` //M3U8名 SegmentFile string `xorm:"default() segment_file" json:"segment_file"` //ts切片名 Resource string `xorm:" default() resource" json:"resource"` //资源地址 }
Hash ...
type IModel ¶
type IModel interface { Table() interface{} ID() string SetID(string) Version() int SetVersion(int) }
IModel ...
type IVideo ¶
type IVideo interface {
Video() *Video
}
IVideo ...
func VideoFromInfo ¶
VideoFromInfo ...
type IWork ¶
type IWork interface { ID() string Work() *Work Video() *Video Info() string Update() error Store() error Reset() error Status() WorkStatus Run(ctx context.Context) (e error) Stop() error }
IWork ...
func NewInfoWork ¶
func NewInfoWork(info *VideoPornInfo, options ...WorkOptions) (IWork, error)
NewInfoWork ...
func NewSourceWork ¶
func NewSourceWork(source *VideoPornSource, options ...WorkOptions) (IWork, error)
NewSourceWork ...
type Node ¶ added in v0.1.0
type Node interface { Type() string ID() *PeerID AddFile(ctx context.Context, filename string) (string, error) AddDir(ctx context.Context, dir string) (string, error) PinHash(ctx context.Context, hash string) error UnpinHash(ctx context.Context, hash string) error PinCheck(ctx context.Context, hash ...string) (int, error) }
Node ...
type PeerID ¶
type PeerID struct { Addresses []string `json:"Addresses"` AgentVersion string `json:"AgentVersion"` ID string `json:"ID"` ProtocolVersion string `json:"ProtocolVersion"` PublicKey string `json:"PublicKey"` }
PeerID ...
type PoolMessage ¶
PoolMessage ...
type Sample ¶
type Sample struct { Index int64 `json:"Index"` Thumb string `json:"Thumb"` Image string `json:"Image"` Title string `json:"Title"` }
Sample ...
type Scale ¶
type Scale int64
Scale ...
const HighScale Scale = 1080
HighScale ...
const LowScale Scale = 480
LowScale ...
const MiddleScale Scale = 720
MiddleScale ...
type Task ¶
type Task struct { Limit int // contains filtered or unexported fields }
Task ...
func (*Task) GetWorkStatus ¶ added in v0.0.7
func (t *Task) GetWorkStatus(id string) (WorkStatus, error)
GetWorkStatus ...
type Video ¶
type Video struct { Model `xorm:"extends" json:"-"` BanNo string `xorm:"ban_no" json:"ban_no"` //番号 Intro string `xorm:"varchar(2048)" json:"intro"` //简介 Alias []string `xorm:"json" json:"alias"` //别名,片名 ThumbHash string `xorm:"thumb_hash" json:"thumb_hash"` //缩略图 PosterHash string `xorm:"poster_hash" json:"poster_hash"` //海报地址 SourceHash string `xorm:"source_hash" json:"source_hash"` //原片地址 M3U8Hash string `xorm:"m3u8_hash" json:"m3u8_hash"` //切片地址 Key string `xorm:"key" json:"-"` //秘钥 M3U8 string `xorm:"m3u8" json:"-"` //M3U8名 Role []string `xorm:"json" json:"role"` //主演 Director string `xorm:"director" json:"director"` //导演 Systematics string `xorm:"systematics" json:"systematics"` //分级 Season string `xorm:"season" json:"season"` //季 TotalEpisode string `xorm:"total_episode" json:"total_episode"` //总集数 Episode string `xorm:"episode" json:"episode"` //集数 Producer string `xorm:"producer" json:"producer"` //生产商 Publisher string `xorm:"publisher" json:"publisher"` //发行商 Type string `xorm:"type" json:"type"` //类型:film,FanDrama Format string `xorm:"format" json:"format"` //输出格式:3D,2D,VR(VR格式:Half-SBS:左右半宽,Half-OU:上下半高,SBS:左右全宽) Language string `xorm:"language" json:"language"` //语言 Caption string `xorm:"caption" json:"caption"` //字幕 Group string `xorm:"group" json:"-"` //分组 Index string `xorm:"index" json:"-"` //索引 Date string `xorm:"'date'" json:"date"` //发行日期 Sharpness string `xorm:"sharpness" json:"sharpness"` //清晰度 Series string `xorm:"series" json:"series"` //系列 Tags []string `xorm:"json tags" json:"tags"` //标签 Length string `xorm:"length" json:"length"` //时长 Sample []string `xorm:"json sample" json:"sample"` //样板图 Uncensored bool `xorm:"uncensored" json:"uncensored"` //有码,无码 }
Video ...
type VideoPornInfo ¶
type VideoPornInfo struct { From string `json:"From"` //来源 Uncensored bool `json:"Uncensored"` //无码 ID string `json:"ID"` //番号 Title string `json:"Title"` //标题 OriginalTitle string `json:"OriginalTitle"` //原始标题 Year string `json:"Year"` //日期 ReleaseDate string `json:"ReleaseDate"` //发行日 Studio string `json:"Studio"` //工作室 MovieSet string `json:"MovieSet"` //系列 Plot string `json:"Plot"` //情节 Genres []*Genre `json:"Genres"` //类型,标签 Actors []*Actor `json:"Actors"` //演员 Image string `json:"Image"` //海报 Thumb string `json:"Thumb"` //缩略图 Sample []*Sample `json:"Sample"` //样板图 }
VideoPornInfo ...
type VideoPornSource ¶
type VideoPornSource struct { Bangumi string `json:"bangumi"` //番号 no VideoPath []string `json:"video_path"` //视频地址 SourceHash string `json:"source_hash"` //原片hash ThumbPath string `json:"thumb_path"` //缩略图路径 PosterPath string `json:"poster_path"` //海报路径 Format string `json:"format"` //输出:3D,2D Thumb string `json:"thumb"` //缩略图HASH Poster string `json:"poster"` //海报HASH Intro string `json:"intro"` //简介 title Alias []string `json:"alias"` //别名,片名 Role []string `json:"role"` //角色列表 stars Director string `json:"director"` //导演 Date string `json:"date"` //发行日 Length string `json:"length"` //片长 Producer string `json:"producer"` //制片商 Series string `json:"series"` //系列 Tags []string `json:"tags"` //标签 Publisher string `json:"publisher"` //发行商 Language string `json:"language"` //语言 Caption string `json:"caption"` //字幕 Uncensored bool `json:"uncensored"` //有码,无码 ExtendList []*Extend `json:"extend_list"` //扩展信息 }
VideoPornSource ...
type Work ¶
type Work struct { *WorkImpl WorkType string Value []byte // contains filtered or unexported fields }
Work ...
type WorkImpl ¶
type WorkImpl struct { ID string Status WorkStatus VideoPaths []string PosterPath string ThumbPath string SamplePath []string Scale Scale Output string Skip []string }
WorkImpl ...
type WorkStatus ¶
type WorkStatus int
WorkStatus ...
const ( WorkAbnormal WorkStatus = iota WorkWaiting WorkRunning WorkStopped WorkFinish )
WorkWaiting ...
Click to show internal directories.
Click to hide internal directories.