Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterExportFlags(f []cli.Flag) []cli.Flag
- func RegisterMagnet2TorrentFlags(f []cli.Flag) []cli.Flag
- func RegisterNodesStatFlags(f []cli.Flag) []cli.Flag
- func RegisterPromClientFlags(f []cli.Flag) []cli.Flag
- func RegisterTorrentStoreFlags(f []cli.Flag) []cli.Flag
- func RegisterWebFlags(f []cli.Flag) []cli.Flag
- type AudioTagBuider
- type BaseExporter
- type BaseTagBuilder
- type BaseURLBuilder
- type CacheMap
- type DownloadExporter
- type DownloadURLBuilder
- type ErrorResponse
- type Export
- type ExportGetArgs
- type ExportItem
- type ExportKindType
- type ExportMeta
- type ExportMetaItem
- type ExportPreloadType
- type ExportResponse
- type ExportSource
- type ExportStreamItem
- type ExportTag
- type ExportTagName
- type ExportTrack
- type ExportType
- type Exporter
- type File
- type Hash
- type ImageTagBuider
- type K8SClient
- type List
- type ListGetArgs
- type ListItem
- type ListOutputType
- type ListResponse
- type ListType
- type Magnet2Torrent
- type Magnet2TorrentClientMock
- type Magnet2TorrentGetter
- type Magnet2TorrentMock
- type MediaFormat
- type MediaProbeExporter
- type MediaProbeURLBuilder
- type MyURL
- type NodeBandwidth
- type NodeStat
- type NodeStatWithScore
- type NodesStat
- type ParamGetter
- type PromClient
- type Resource
- type ResourceMap
- type ResourceResponse
- type ResourceType
- type ServiceType
- type StreamExporter
- type StreamURLBuilder
- func (s *StreamURLBuilder) Build(ctx context.Context) (u *MyURL, err error)
- func (s *StreamURLBuilder) BuildAudioStreamURL(i *MyURL, suffix string) (u *MyURL, err error)
- func (s *StreamURLBuilder) BuildSRT2VTTURL(i *MyURL) (u *MyURL)
- func (s *StreamURLBuilder) BuildStreamURL(i *MyURL, suffix string) (u *MyURL, err error)
- func (s *StreamURLBuilder) BuildSubtitleStreamURL(i *MyURL) (u *MyURL, err error)
- func (s *StreamURLBuilder) BuildTranscodeURL(i *MyURL, suffix string) (u *MyURL)
- func (s *StreamURLBuilder) BuildVODURL(i *MyURL, suffix string) (u *MyURL)
- func (s *StreamURLBuilder) BuildVideoStreamURL(i *MyURL, suffix string) (u *MyURL, err error)
- type Subdomains
- type Subtitles
- type SubtitlesExporter
- type SubtitlesURLBuilder
- type TagBuilder
- type TorrentStatExporter
- type TorrentStatURLBuilder
- type TorrentStore
- type TorrentStoreClientMock
- func (s *TorrentStoreClientMock) Pull(ctx context.Context, in *tsp.PullRequest, opts ...grpc.CallOption) (*tsp.PullReply, error)
- func (s *TorrentStoreClientMock) Push(ctx context.Context, in *tsp.PushRequest, opts ...grpc.CallOption) (*tsp.PushReply, error)
- func (s *TorrentStoreClientMock) Touch(ctx context.Context, in *tsp.TouchRequest, opts ...grpc.CallOption) (*tsp.TouchReply, error)
- type TorrentStoreGetter
- type TorrentStoreMock
- type URLBuilder
- type VideoTagBuider
- type Web
Constants ¶
View Source
const (
HashSize int = 20
)
View Source
const ServiceSeparator = "~"
Variables ¶
View Source
var ExportTypes = []ExportType{ ExportTypeDownload, ExportTypeStream, ExportTypeTorrentStat, ExportTypeSubtitles, ExportTypeMediaProbe, }
Functions ¶
Types ¶
type AudioTagBuider ¶
type AudioTagBuider struct {
BaseTagBuilder
}
type BaseExporter ¶
type BaseExporter struct {
// contains filtered or unexported fields
}
func (*BaseExporter) BuildURL ¶
func (s *BaseExporter) BuildURL(ctx context.Context, r *Resource, i *ListItem, g ParamGetter) (*MyURL, error)
func (*BaseExporter) Type ¶
func (s *BaseExporter) Type() ExportType
type BaseTagBuilder ¶
type BaseTagBuilder struct {
// contains filtered or unexported fields
}
func (*BaseTagBuilder) BuildAVTag ¶
func (s *BaseTagBuilder) BuildAVTag(ctx context.Context, n ExportTagName) (*ExportTag, error)
func (*BaseTagBuilder) BuildSource ¶
func (s *BaseTagBuilder) BuildSource(u *MyURL) *ExportSource
type BaseURLBuilder ¶
type BaseURLBuilder struct {
// contains filtered or unexported fields
}
func (*BaseURLBuilder) BuildBaseURL ¶
func (*BaseURLBuilder) BuildDomain ¶
func (*BaseURLBuilder) BuildScheme ¶
func (s *BaseURLBuilder) BuildScheme(i *MyURL) (u *MyURL)
func (*BaseURLBuilder) GetLastName ¶
func (s *BaseURLBuilder) GetLastName() string
type CacheMap ¶
func NewCacheMap ¶
type DownloadExporter ¶
type DownloadExporter struct {
BaseExporter
}
func NewDownloadExporter ¶
func NewDownloadExporter(ub *URLBuilder) *DownloadExporter
func (*DownloadExporter) Export ¶
func (s *DownloadExporter) Export(ctx context.Context, r *Resource, i *ListItem, g ParamGetter) (*ExportItem, error)
type DownloadURLBuilder ¶
type DownloadURLBuilder struct {
BaseURLBuilder
}
func (*DownloadURLBuilder) Build ¶
func (s *DownloadURLBuilder) Build(ctx context.Context) (u *MyURL, err error)
func (*DownloadURLBuilder) BuildDownloadURL ¶
func (s *DownloadURLBuilder) BuildDownloadURL(i *MyURL) (u *MyURL, err error)
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
type Export ¶
type Export struct {
// contains filtered or unexported fields
}
func (*Export) Get ¶
func (s *Export) Get(ctx context.Context, r *Resource, i *ListItem, args *ExportGetArgs, g ParamGetter) (*ExportResponse, error)
type ExportGetArgs ¶
type ExportGetArgs struct {
Types []ExportType
}
func ExportGetArgsFromParams ¶
func ExportGetArgsFromParams(g ParamGetter) (*ExportGetArgs, error)
type ExportItem ¶
type ExportItem struct { ExportStreamItem ExportMetaItem Type string `json:"-"` URL string `json:"url,omitempty"` }
type ExportKindType ¶
type ExportKindType string
const (
ExportKindTypeSubtitles ExportKindType = "subtitles"
)
type ExportMeta ¶
type ExportMetaItem ¶
type ExportMetaItem struct {
Meta *ExportMeta `json:"meta,omitempty"`
}
type ExportPreloadType ¶
type ExportPreloadType string
const ( ExportPreloadTypeAuto ExportPreloadType = "auto" ExportPreloadTypeNone ExportPreloadType = "none" )
type ExportResponse ¶
type ExportResponse struct { Source ListItem `json:"source"` ExportItems map[string]ExportItem `json:"exports"` }
type ExportSource ¶
type ExportStreamItem ¶
type ExportStreamItem struct {
Tag *ExportTag `json:"html_tag,omitempty"`
}
type ExportTag ¶
type ExportTag struct { Name ExportTagName `json:"tag,omitempty"` Preload ExportPreloadType `json:"preload,omitempty"` Sources []ExportSource `json:"sources,omitempty"` Tracks []ExportTrack `json:"tracks,omitempty"` Src string `json:"src,omitempty"` Alt string `json:"alt,omitempty"` Poster string `json:"poster,omitempty"` }
type ExportTagName ¶
type ExportTagName string
const ( ExportTagNameVideo ExportTagName = "video" ExportTagNameAudio ExportTagName = "audio" ExportTagNameImage ExportTagName = "img" )
type ExportTrack ¶
type ExportTrack struct { Src string `json:"src"` Kind ExportKindType `json:"kind"` SrcLang string `json:"srclang,omitempty"` Label string `json:"label,omitempty"` }
type ExportType ¶
type ExportType string
const ( ExportTypeDownload ExportType = "download" ExportTypeStream ExportType = "stream" ExportTypeTorrentStat ExportType = "torrent_client_stat" ExportTypeSubtitles ExportType = "subtitles" ExportTypeMediaProbe ExportType = "media_probe" )
type Exporter ¶
type Exporter interface { Type() ExportType Export(ctx context.Context, r *Resource, i *ListItem, g ParamGetter) (*ExportItem, error) }
type ImageTagBuider ¶
type ImageTagBuider struct {
BaseTagBuilder
}
type K8SClient ¶
type K8SClient struct {
// contains filtered or unexported fields
}
func NewK8SClient ¶
func NewK8SClient() *K8SClient
type List ¶
type List struct{}
func (*List) Get ¶
func (s *List) Get(r *Resource, args *ListGetArgs) (ListResponse, error)
type ListGetArgs ¶
type ListGetArgs struct { Limit int Offset int Output ListOutputType Path []string }
func ListGetArgsFromParams ¶
func ListGetArgsFromParams(g ParamGetter) (*ListGetArgs, error)
func NewListGetArgs ¶
func NewListGetArgs() *ListGetArgs
type ListItem ¶
type ListItem struct { ID string `json:"id"` Name string `json:"name,omitempty"` PathStr string `json:"path"` Path []string `json:"-"` Type ListType `json:"type"` Size int64 `json:"size"` MediaFormat MediaFormat `json:"media_format,omitempty"` MimeType string `json:"mime_type,omitempty"` Ext string `json:"ext,omitempty"` }
func (*ListItem) SameDirectory ¶
type ListOutputType ¶
type ListOutputType string
const ( ListOutputTypeList ListOutputType = "list" ListOutputTypeTree ListOutputType = "tree" )
type ListResponse ¶
type Magnet2Torrent ¶
type Magnet2Torrent struct {
// contains filtered or unexported fields
}
func NewMagnet2Torrent ¶
func NewMagnet2Torrent(c *cli.Context) *Magnet2Torrent
func (*Magnet2Torrent) Close ¶
func (s *Magnet2Torrent) Close()
func (*Magnet2Torrent) Get ¶
func (s *Magnet2Torrent) Get() (m2t.Magnet2TorrentClient, error)
type Magnet2TorrentClientMock ¶
func (*Magnet2TorrentClientMock) Magnet2Torrent ¶
func (s *Magnet2TorrentClientMock) Magnet2Torrent(ctx context.Context, in *m2tp.Magnet2TorrentRequest, opts ...grpc.CallOption) (*m2tp.Magnet2TorrentReply, error)
type Magnet2TorrentGetter ¶
type Magnet2TorrentGetter interface {
Get() (m2tp.Magnet2TorrentClient, error)
}
type Magnet2TorrentMock ¶
type Magnet2TorrentMock struct {
// contains filtered or unexported fields
}
func NewMagnet2TorrentMock ¶
func NewMagnet2TorrentMock() *Magnet2TorrentMock
func (*Magnet2TorrentMock) Get ¶
func (s *Magnet2TorrentMock) Get() (m2tp.Magnet2TorrentClient, error)
type MediaFormat ¶
type MediaFormat string
const ( Audio MediaFormat = "audio" Video MediaFormat = "video" Image MediaFormat = "image" Subtitle MediaFormat = "subtitle" Unknown MediaFormat = "unknown" )
type MediaProbeExporter ¶
type MediaProbeExporter struct {
BaseExporter
}
func NewMediaProbeExporter ¶
func NewMediaProbeExporter(ub *URLBuilder) *MediaProbeExporter
func (*MediaProbeExporter) Export ¶
func (s *MediaProbeExporter) Export(ctx context.Context, r *Resource, i *ListItem, g ParamGetter) (*ExportItem, error)
type MediaProbeURLBuilder ¶
type MediaProbeURLBuilder struct {
StreamURLBuilder
}
type MyURL ¶
func (*MyURL) BuildExportMeta ¶
func (s *MyURL) BuildExportMeta() *ExportMeta
type NodeBandwidth ¶
type NodeStat ¶
type NodeStat struct { Name string NodeBandwidth // NodeCPU Pools []string Subdomain string }
type NodeStatWithScore ¶
type NodesStat ¶
func NewNodesStat ¶
func NewNodesStat(c *cli.Context, pcl *PromClient, kcl *K8SClient) *NodesStat
type ParamGetter ¶
type PromClient ¶
type PromClient struct {
// contains filtered or unexported fields
}
func NewPromClient ¶
func NewPromClient(c *cli.Context) *PromClient
type ResourceMap ¶
func NewResourceMap ¶
func NewResourceMap(ts TorrentStoreGetter, m2t Magnet2TorrentGetter) *ResourceMap
type ResourceResponse ¶
type ResourceType ¶
type ResourceType int
const ( ResourceTypeHash ResourceType = iota ResourceTypeMagnet ResourceTypeTorrent ResourceTypeSha1 )
type ServiceType ¶
type ServiceType string
const ( ServiceTypeArchive ServiceType = "arch" ServiceTypeTranscode ServiceType = "hls" ServiceTypeVOD ServiceType = "vod" ServiceTypeSRT2VTT ServiceType = "vtt" ServiceTypeVideoInfo ServiceType = "vi" )
type StreamExporter ¶
type StreamExporter struct { BaseExporter // contains filtered or unexported fields }
func NewStreamExporter ¶
func NewStreamExporter(ub *URLBuilder, tb *TagBuilder) *StreamExporter
func (*StreamExporter) Export ¶
func (s *StreamExporter) Export(ctx context.Context, r *Resource, i *ListItem, g ParamGetter) (*ExportItem, error)
func (*StreamExporter) MakeExportStreamItem ¶
func (s *StreamExporter) MakeExportStreamItem(ctx context.Context, r *Resource, i *ListItem, g ParamGetter) (*ExportStreamItem, error)
func (*StreamExporter) Type ¶
func (s *StreamExporter) Type() ExportType
type StreamURLBuilder ¶
type StreamURLBuilder struct {
BaseURLBuilder
}
func (*StreamURLBuilder) Build ¶
func (s *StreamURLBuilder) Build(ctx context.Context) (u *MyURL, err error)
func (*StreamURLBuilder) BuildAudioStreamURL ¶
func (s *StreamURLBuilder) BuildAudioStreamURL(i *MyURL, suffix string) (u *MyURL, err error)
func (*StreamURLBuilder) BuildSRT2VTTURL ¶
func (s *StreamURLBuilder) BuildSRT2VTTURL(i *MyURL) (u *MyURL)
func (*StreamURLBuilder) BuildStreamURL ¶
func (s *StreamURLBuilder) BuildStreamURL(i *MyURL, suffix string) (u *MyURL, err error)
func (*StreamURLBuilder) BuildSubtitleStreamURL ¶
func (s *StreamURLBuilder) BuildSubtitleStreamURL(i *MyURL) (u *MyURL, err error)
func (*StreamURLBuilder) BuildTranscodeURL ¶
func (s *StreamURLBuilder) BuildTranscodeURL(i *MyURL, suffix string) (u *MyURL)
func (*StreamURLBuilder) BuildVODURL ¶
func (s *StreamURLBuilder) BuildVODURL(i *MyURL, suffix string) (u *MyURL)
func (*StreamURLBuilder) BuildVideoStreamURL ¶
func (s *StreamURLBuilder) BuildVideoStreamURL(i *MyURL, suffix string) (u *MyURL, err error)
type Subdomains ¶
type Subdomains struct {
// contains filtered or unexported fields
}
func NewSubdomains ¶
func NewSubdomains(c *cli.Context, nsp *NodesStat) *Subdomains
type SubtitlesExporter ¶
type SubtitlesExporter struct {
BaseExporter
}
func NewSubtitlesExporter ¶
func NewSubtitlesExporter(ub *URLBuilder) *SubtitlesExporter
func (*SubtitlesExporter) Export ¶
func (s *SubtitlesExporter) Export(ctx context.Context, r *Resource, i *ListItem, g ParamGetter) (*ExportItem, error)
type SubtitlesURLBuilder ¶
type SubtitlesURLBuilder struct {
BaseURLBuilder
}
func (*SubtitlesURLBuilder) Build ¶
func (s *SubtitlesURLBuilder) Build(ctx context.Context) (u *MyURL, err error)
func (*SubtitlesURLBuilder) BuildSubtitlesURL ¶
func (s *SubtitlesURLBuilder) BuildSubtitlesURL(i *MyURL) (u *MyURL)
type TagBuilder ¶
type TagBuilder struct {
// contains filtered or unexported fields
}
func NewTagBuilder ¶
func NewTagBuilder(ub *URLBuilder, l *List) *TagBuilder
func (*TagBuilder) Build ¶
func (s *TagBuilder) Build(ctx context.Context, r *Resource, i *ListItem, g ParamGetter) (*ExportTag, error)
type TorrentStatExporter ¶
type TorrentStatExporter struct {
BaseExporter
}
func NewTorrentStatExporter ¶
func NewTorrentStatExporter(ub *URLBuilder) *TorrentStatExporter
func (*TorrentStatExporter) Export ¶
func (s *TorrentStatExporter) Export(ctx context.Context, r *Resource, i *ListItem, g ParamGetter) (*ExportItem, error)
type TorrentStatURLBuilder ¶
type TorrentStatURLBuilder struct {
BaseURLBuilder
}
func (*TorrentStatURLBuilder) Build ¶
func (s *TorrentStatURLBuilder) Build(ctx context.Context) (u *MyURL, err error)
func (*TorrentStatURLBuilder) BuildStatURL ¶
func (s *TorrentStatURLBuilder) BuildStatURL(i *MyURL) *MyURL
type TorrentStore ¶
type TorrentStore struct {
// contains filtered or unexported fields
}
func NewTorrentStore ¶
func NewTorrentStore(c *cli.Context) *TorrentStore
func (*TorrentStore) Close ¶
func (s *TorrentStore) Close()
func (*TorrentStore) Get ¶
func (s *TorrentStore) Get() (ts.TorrentStoreClient, error)
type TorrentStoreClientMock ¶
func (*TorrentStoreClientMock) Pull ¶
func (s *TorrentStoreClientMock) Pull(ctx context.Context, in *tsp.PullRequest, opts ...grpc.CallOption) (*tsp.PullReply, error)
func (*TorrentStoreClientMock) Push ¶
func (s *TorrentStoreClientMock) Push(ctx context.Context, in *tsp.PushRequest, opts ...grpc.CallOption) (*tsp.PushReply, error)
func (*TorrentStoreClientMock) Touch ¶
func (s *TorrentStoreClientMock) Touch(ctx context.Context, in *tsp.TouchRequest, opts ...grpc.CallOption) (*tsp.TouchReply, error)
type TorrentStoreGetter ¶
type TorrentStoreGetter interface {
Get() (tsp.TorrentStoreClient, error)
}
type TorrentStoreMock ¶
type TorrentStoreMock struct {
// contains filtered or unexported fields
}
func NewTorrentStoreMock ¶
func NewTorrentStoreMock() *TorrentStoreMock
func (*TorrentStoreMock) Get ¶
func (s *TorrentStoreMock) Get() (tsp.TorrentStoreClient, error)
type URLBuilder ¶
type URLBuilder struct {
// contains filtered or unexported fields
}
func NewURLBuilder ¶
func NewURLBuilder(c *cli.Context, sd *Subdomains, cm *CacheMap) *URLBuilder
func (*URLBuilder) Build ¶
func (s *URLBuilder) Build(ctx context.Context, r *Resource, i *ListItem, g ParamGetter, et ExportType) (*MyURL, error)
type VideoTagBuider ¶
type VideoTagBuider struct { BaseTagBuilder // contains filtered or unexported fields }
func (*VideoTagBuider) Build ¶
func (s *VideoTagBuider) Build(ctx context.Context) (*ExportTag, error)
func (*VideoTagBuider) BuildAttachedResources ¶
func (*VideoTagBuider) BuildTrack ¶
func (s *VideoTagBuider) BuildTrack(ctx context.Context, i *ListItem) (*ExportTrack, error)
Click to show internal directories.
Click to hide internal directories.