services

package
v0.0.0-...-e0fbffd Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebHostFlag  = "host"
	WebPortFlag  = "port"
	WebSourceURL = "source-url"
)
View Source
const (
	ChunkSize = 65536 // 64k
)

https://trac.opensubtitles.org/projects/opensubtitles/wiki/HashSourceCodes#GO

View Source
const (
	SubTTL = 600
)

Variables

This section is empty.

Functions

func RegisterWebFlags

func RegisterWebFlags(c *cli.App)

Types

type Hash

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

func NewHash

func NewHash(url string, c *redis.Cache) *Hash

func (*Hash) Get

func (s *Hash) Get(purge bool) (uint64, int64, error)

type HashPool

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

func NewHashPool

func NewHashPool() *HashPool

func (*HashPool) Get

func (s *HashPool) Get(url string, c *redis.Cache, purge bool) (uint64, int64, error)

type IMDBSearch

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

func NewIMDBSearch

func NewIMDBSearch(imdbID string, cl *osdb.Client, c *redis.Cache) *IMDBSearch

func (*IMDBSearch) Get

func (s *IMDBSearch) Get(purge bool) ([]osdb.Subtitle, error)

type IMDBSearchPool

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

func NewIMDBSearchPool

func NewIMDBSearchPool(cl *osdb.Client) *IMDBSearchPool

func (*IMDBSearchPool) Get

func (s *IMDBSearchPool) Get(imdbID string, c *redis.Cache, purge bool) ([]osdb.Subtitle, error)
type Search struct {
	// contains filtered or unexported fields
}

func NewSearch

func NewSearch(url string, hp *HashPool, cl *osdb.Client, c *redis.Cache) *Search

func (*Search) Get

func (s *Search) Get(purge bool) ([]osdb.Subtitle, error)

type SearchPool

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

func NewSearchPool

func NewSearchPool(cl *osdb.Client) *SearchPool

func (*SearchPool) Get

func (s *SearchPool) Get(url string, c *redis.Cache, purge bool) ([]osdb.Subtitle, error)

type Sub

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

func NewSub

func NewSub(sub *osdb.Subtitle, format string, cl *osdb.Client, c *redis.Cache, s3 *s.S3Storage, logger *logrus.Entry) *Sub

func (*Sub) Get

func (s *Sub) Get(purge bool) ([]byte, error)

type SubsPool

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

func NewSubsPool

func NewSubsPool(cl *osdb.Client, s3 *s3.S3Storage) *SubsPool

func (*SubsPool) Get

func (s *SubsPool) Get(sub *osdb.Subtitle, format string, c *redis.Cache, purge bool, logger *logrus.Entry) ([]byte, error)

type Subtitle

type Subtitle struct {
	SrcLang string `json:"srclang"`
	Label   string `json:"label"`
	Src     string `json:"src"`
	Format  string `json:"format"`
	ID      string `json:"id"`
}

type Subtitles

type Subtitles []Subtitle

type Web

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

func NewWeb

func NewWeb(c *cli.Context, sp *SearchPool, isp *IMDBSearchPool, sbp *SubsPool, cp *redis.CachePool) *Web

func (*Web) Close

func (s *Web) Close()

func (*Web) Serve

func (s *Web) Serve() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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