management

package module
v0.0.0-...-4b1c7b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2019 License: MIT Imports: 17 Imported by: 0

README

management

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCachePath = "cache"

DefaultCachePath ...

Functions

func CacheFile

func CacheFile(hash, path string) error

CacheFile ...

func CheckDatabase

func CheckDatabase() bool

CheckDatabase ...

func Checksum

func Checksum(filepath string) string

Checksum ...

func FindAll

func FindAll(model IModel, f FindResult, limit int, start ...int) (e error)

FindAll ...

func GetCache

func GetCache(hash string) ([]byte, error)

GetCache ...

func InsertOrUpdate

func InsertOrUpdate(m IModel) (i int64, e error)

InsertOrUpdate ...

func IsExist

func IsExist(m IModel) bool

IsExist ...

func MakeDBInstance

func MakeDBInstance(config DBConfig) (engine *xorm.Engine, e error)

MakeDBInstance ...

func MustDatabase

func MustDatabase(engine *xorm.Engine, err error) *xorm.Engine

MustDatabase ...

func MustSession

func MustSession(session *xorm.Session) *xorm.Session

MustSession ...

func MustString

func MustString(val, src string) string

MustString must string

func RegisterCache

func RegisterCache()

RegisterCache ...

func RegisterDatabase

func RegisterDatabase(engine *xorm.Engine)

RegisterDatabase ...

func SyncTable

func SyncTable() (e error)

SyncTable ...

func UUID

func UUID() uuid.UUID

UUID ...

Types

type BeforeInsert

type BeforeInsert interface {
	BeforeInsert()
}

BeforeInsert ...

type ConfigOptions

type ConfigOptions func(config *DBConfig)

ConfigOptions ...

func LoginOption

func LoginOption(addr, user, pass string) ConfigOptions

LoginOption ...

func SchemaOption

func SchemaOption(s string) ConfigOptions

SchemaOption ...

func ShowSQLOptions

func ShowSQLOptions(b bool) ConfigOptions

ShowSQLOptions ...

func UseCacheOptions

func UseCacheOptions(b bool) ConfigOptions

UseCacheOptions ...

type DBConfig

type DBConfig struct {
	ShowSQL      bool   `json:"show_sql"`
	ShowExecTime bool   `json:"show_exec_time"`
	UseCache     bool   `json:"use_cache"`
	Create       bool   `json:"create"`
	DBType       string `json:"db_type"`
	Addr         string `json:"addr"`
	Username     string `json:"username"`
	Password     string `json:"password"`
	Schema       string `json:"schema"`
	Charset      string `json:"charset"`
	Prefix       string `json:"prefix"`
	Location     string `json:"location"`
}

DBConfig ...

func DefaultConfig

func DefaultConfig() DBConfig

DefaultConfig ...

type FindResult

type FindResult func(rows *xorm.Rows) error

FindResult ...

type IModel

type IModel interface {
	Table() interface{}
	ID() string
	SetID(string)
	Version() int
	SetVersion(int)
}

IModel ...

type ISync

type ISync interface {
	Sync() error
}

ISync ...

type IVideo

type IVideo interface {
	Video() *Video
}

IVideo ...

type LVideo

type LVideo struct {
	Model        `xorm:"extends" json:"-"`
	No           string   `xorm:"no" json:"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"`       //有码,无码
}

LVideo lvideo is a local base video info

func (LVideo) TableName

func (l LVideo) TableName() string

TableName ...

type Model

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

Model ...

func (*Model) BeforeInsert

func (m *Model) BeforeInsert()

BeforeInsert ...

func (Model) ID

func (m Model) ID() string

ID ...

func (*Model) SetID

func (m *Model) SetID(id string)

SetID ...

func (*Model) SetVersion

func (m *Model) SetVersion(v int)

SetVersion ...

func (Model) Version

func (m Model) Version() int

Version ...

type SVideo

type SVideo struct {
	FindNo       string   `json:"-"`                              //查找号
	Bangumi      string   `xorm:"bangumi" json:"bangumi"`         //番組
	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   `json:"-"`                              //秘钥
	M3U8         string   `xorm:"m3u8" json:"-"`                  //M3U8名
	Role         []string `xorm:"json" json:"role"`               //主演
	Director     string   `json:"-"`                              //导演
	Systematics  string   `json:"-"`                              //分级
	Season       string   `json:"-"`                              //季
	TotalEpisode string   `json:"-"`                              //总集数
	Episode      string   `json:"-"`                              //集数
	Producer     string   `json:"-"`                              //生产商
	Publisher    string   `json:"-"`                              //发行商
	Type         string   `json:"-"`                              //类型:film,FanDrama
	Format       string   `json:"format"`                         //输出格式:3D,2D,VR(VR格式:Half-SBS:左右半宽,Half-OU:上下半高,SBS:左右全宽)
	Language     string   `json:"-"`                              //语言
	Caption      string   `json:"-"`                              //字幕
	Group        string   `json:"-"`                              //分组
	Index        string   `json:"-"`                              //索引
	Date         string   `json:"-"`                              //发行日期
	Sharpness    string   `json:"sharpness"`                      //清晰度
	Visit        uint64   `json:"-" xorm:"notnull default(0)"`    //访问数
	Series       string   `json:"series"`                         //系列
	Tags         []string `xorm:"json" json:"tags"`               //标签
	Length       string   `json:"length"`                         //时长
	MagnetLinks  []string `json:"-"`                              //磁链
	Uncensored   bool     `json:"uncensored"`                     //有码,无码
	// contains filtered or unexported fields
}

SVideo svideo is old seed video info

func (SVideo) TableName

func (s SVideo) TableName() string

TableName ...

type Video

type Video struct {
	Model        `xorm:"extends" json:"-"`
	No           string   `xorm:"no" json:"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 video is ipfs video info

func SeedVideoToConversionVideo

func SeedVideoToConversionVideo(v SVideo) Video

SeedVideoToConversionVideo ...

func (*Video) Sync

func (v *Video) Sync() error

Sync ...

func (*Video) Table

func (v *Video) Table() interface{}

Table ...

Jump to

Keyboard shortcuts

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