types

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2018 License: GPL-3.0 Imports: 9 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	Provider
	http.Handler
	Config() Config
	FindMedia(...string) (LocalMediaList, error)
	DownloadSubtitles(LocalMediaList, set.Interface) (int, error)
}

App is the interface for the top level capabilities of the application. It is an HTTP handler, a provider (for subtitles) and a CLI application. It means App can both be used as a HTTP server and a CLI application.

type Config added in v0.2.0

type Config interface {
	Languages() set.Interface
	Impaired() bool
	Limit() int
	Modified() time.Duration
	Dry() bool
	Score() int
	Delay() time.Duration
	Force() bool
	Config() string
	Logfile() string
	Verbose() bool
	Strict() bool
	Plugins() []Plugin
}

Config is the interface for application configuration

type Downloadable

type Downloadable interface {
	Download() (io.ReadCloser, error)
}

Downloadable is an interface for media that can be downloaded from the internet

type Episode

type Episode interface {
	Metadata
	TVShow() string
	Episode() int
	Season() int
}

Episode interface is for TV show type material

type Evaluator

type Evaluator interface {
	Evaluate(Media, Media) float32
}

Evaluator determines how well two media types are alike

type Linker

type Linker interface {
	Link() string
}

Linker is an object which can be fetched from the internet

type List

type List interface {
	Len() int
}

List interface describes all common properties of lists

type Local added in v0.2.0

type Local interface {
	os.FileInfo
	Path() string
}

Local is an interface for media content which is stored on disk

type LocalMedia

type LocalMedia interface {
	Local
	Media
	ExistingSubtitles() (SubtitleList, error)
	SaveSubtitle(Downloadable, language.Tag) (LocalSubtitle, error)
}

LocalMedia is an interface for media found locally on disk

type LocalMediaList

type LocalMediaList interface {
	List
	Add(LocalMedia)
	List() []LocalMedia
	FilterModified(time.Duration) LocalMediaList
	FilterMissingSubs(set.Interface) (LocalMediaList, error)
}

LocalMediaList is a list of media which can be manipulated

type LocalSubtitle added in v0.2.0

type LocalSubtitle interface {
	Local
	Subtitle
}

LocalSubtitle is an subtitle which is stored on disk

type Media

type Media interface {
	Meta() Metadata
	TypeMovie() (Movie, bool)
	TypeEpisode() (Episode, bool)
}

Media is an interface for movies and TV shows

type Metadata

type Metadata interface {
	String() string
	Group() string
	Codec() codec.Tag
	Quality() quality.Tag
	Source() source.Tag
	AllTags() []string
}

Metadata is an interface metadata information

type Movie

type Movie interface {
	Metadata
	MovieName() string
	Year() int
}

Movie interface is for movie type media material

type OnlineSubtitle

type OnlineSubtitle interface {
	Linker
	Downloadable
	Subtitle
}

OnlineSubtitle is a subtitle obtained from the internet and can be downloaded and stored on disk

type Plugin added in v0.2.0

type Plugin interface {
	Name() string
	Run(LocalSubtitle) error
}

Plugin is an interface for external functionality

type Provider

type Provider interface {
	SearchSubtitles(LocalMedia) ([]OnlineSubtitle, error)
	ResolveSubtitle(Linker) (Downloadable, error)
}

Provider interfaces with subtitles websites to provide subtitles

type Subtitle

type Subtitle interface {
	Media
	Language() language.Tag
	IsLang(language.Tag) bool
	IsHI() bool
}

Subtitle can be downloaded

type SubtitleList

type SubtitleList interface {
	List
	Add(...Subtitle)
	Best() (Subtitle, float32)
	List() []Subtitle
	LanguageSet() set.Interface
	FilterLanguage(language.Tag) SubtitleList
	FilterScore(float32) SubtitleList
	HearingImpaired(bool) SubtitleList
}

SubtitleList is a collection of subtitles

Jump to

Keyboard shortcuts

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