model

package
v0.0.0-...-b1f2762 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveItem

type ArchiveItem struct {
	ArchiveKey  string                  `json:"key"`
	Description *ArchiveItemDescription `json:"desc,omitempty"`
	Meta        *ArchiveItemMeta        `json:"meta,omitempty"`
	Chan        *ArchiveItemChan        `json:"chan,omitempty"`
}

func (*ArchiveItem) IsExists

func (l *ArchiveItem) IsExists() bool

func (*ArchiveItem) SaveFile

func (l *ArchiveItem) SaveFile() error

type ArchiveItemChan

type ArchiveItemChan struct {
	MessageId int `json:"msg_id,omitempty"`
}

type ArchiveItemDescription

type ArchiveItemDescription struct {
	Date         string   `json:"date"`
	Source       string   `json:"source"`
	ShowID       string   `json:"show_id"`
	ShowTitle    string   `json:"show_title"`
	EpisodeID    string   `json:"ep_id"`
	EpisodeTitle string   `json:"ep_title"`
	Artists      []string `json:"artists"`
}

type ArchiveItemMeta

type ArchiveItemMeta struct {
	Filename string `json:"filename"`
	Duration *int   `json:"duration,omitempty"`
	Size     *int   `json:"size,omitempty"`
}

type AudioHLS

type AudioHLS interface {
	Playlist(body string) (tsaudio []File, err error)
	TSAudio(tsaudio File) (keys []File, audio []File, err error)
	CheckAlreadyLoaded(filename string) bool
}

type Date

type Date struct {
	Year  int
	Month int
	Day   int
}

func (*Date) Filename

func (d *Date) Filename() string

func (*Date) IsGood

func (d *Date) IsGood() bool

func (*Date) String

func (d *Date) String() string

func (*Date) Time

func (d *Date) Time() time.Time

type Episode

type Episode interface {
	Artists() []string
	CanDownload() bool
	Date() Date
	// Download(loader Loader, tasks Tasks, pl PrintLine) error
	EpId() string
	EpIdx() string // base62
	EpTitle() string
	PlaylistURL() *string
	// ShowId() string
	// ShowTitle() string
	IsVideo() bool

	Show() Show

	PPrint() PPrintRow
}

type File

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

func NewFile

func NewFile(link, name string) File

func (*File) BodyRaw

func (f *File) BodyRaw() []byte

func (*File) BodyString

func (f *File) BodyString() string

func (*File) Name

func (f *File) Name() string

func (*File) SetBody

func (f *File) SetBody(data []byte)

func (*File) SetBodyString

func (f *File) SetBodyString(data *string)

func (*File) Url

func (f *File) Url(baseUrl string) (string, error)

type Loader

type Loader interface {
	Text(url string, opts *LoaderOpts) (*string, error)
	JSON(url string, dest interface{}, opts *LoaderOpts) error
	Raw(url string, opts *LoaderOpts) ([]byte, error)
}

type LoaderOpts

type LoaderOpts struct {
	Headers  map[string]string
	Timeouts []int
}
var LoaderOptsDefault *LoaderOpts = &LoaderOpts{
	Headers:  map[string]string{},
	Timeouts: []int{5, 10, 20},
}

type PPrintRow

type PPrintRow struct {
	IsDir   bool
	CanLoad bool
	IsVid   bool
	Date    Date
	Ref     string
	Note    string
	Cast    []string
}

func (PPrintRow) Attrs

func (a PPrintRow) Attrs() string

func (PPrintRow) Pprint

func (a PPrintRow) Pprint() []interface{}

func (PPrintRow) String

func (a PPrintRow) String() string

type PrintLine

type PrintLine interface {
	SetChunk(count int)
	AddChunk()
	SetChunkCount(count int)
	SetPrefix(prefix string)
	Status(str string)
	Error(err error) error
}

type Show

type Show interface {
	GetEpisodes(loader Loader) ([]Episode, error)
	Artists() []string
	ShowId() string
	ShowTitle() string

	LoadImage(loader Loader, workdir WorkdirBase) error

	PPrint() PPrintRow
	Provider() string
}

type ShowAccess

type ShowAccess interface {
	GetShow(loader Loader) (Show, error)
	ShowId() string
}

type TSAudio

type TSAudio interface {
	Link(base string) string
	Name() string
}

type Tags

type Tags struct {
	Album  *string
	Artist *string
	Title  *string
	Track  *string
}

func NewTags

func NewTags(ep Episode) *Tags

type Tasks

type Tasks interface {
	AudioHLS() AudioHLS
}

type WorkdirBase

type WorkdirBase interface {
	Save(fileName, fileBody string) error
	SaveRaw(fileName string, fileBody []byte) error
}

type WorkdirFile

type WorkdirFile interface {
	SaveNamed(name string, fileBody string) error
	SaveNamedRaw(name string, fileBody []byte) error
	ResolveName(name string) string
	WasWritten(name string) bool
	AlreadyLoadedChunks() map[string]bool
	WorkdirBase
}

Jump to

Keyboard shortcuts

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