plugin

package
v0.0.0-...-89684ad Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadSignature = errors.New("bad function signature")

Functions

This section is empty.

Types

type Entity

type Entity string
const (
	EntityMedia    Entity = "media"
	EntityPlaylist Entity = "playlist"
)

type MediaType

type MediaType string
const (
	AudioMediaType MediaType = "audio"
	VideoMediaType MediaType = "video"
)

type Meta

type Meta struct {
	// Human URL to resource.
	URL   string
	Title string
	// Raw URL to download resource from.
	RawURL   string
	Size     int64 // in bytes
	Duration time.Duration
}

type Playlist

type Playlist struct {
	URLs []string
}

func (Playlist) Size

func (p Playlist) Size() int64

type Plugin

type Plugin interface {
	GetMeta(ctx context.Context, uri string, mediaType MediaType) (*Meta, error)
	GetPlaylist(ctx context.Context, uri string) (*Playlist, error)
	ParseEntity(text string) (Entity, string, error)
}

func Open

func Open(path string) (Plugin, error)

Jump to

Keyboard shortcuts

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