api

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(l *zap.SugaredLogger)

Types

type APIServer

type APIServer struct {
	*Configuration
	// contains filtered or unexported fields
}

APIServer ties HTTP API together and allows to start/shutdown the web server.

func NewServer

func NewServer(cfg *Configuration) *APIServer

func (APIServer) Addr

func (s APIServer) Addr() string

func (APIServer) Shutdown

func (s APIServer) Shutdown() error

func (APIServer) Start

func (s APIServer) Start() error

func (APIServer) URL

func (s APIServer) URL() string

type Configuration

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

func Configure

func Configure() *Configuration

func (*Configuration) Addr

func (c *Configuration) Addr(addr string) *Configuration

func (*Configuration) Debug

func (c *Configuration) Debug(debug bool) *Configuration

func (*Configuration) VideoManager

func (c *Configuration) VideoManager(videoManager *VideoManager) *Configuration

func (*Configuration) VideoPath

func (c *Configuration) VideoPath(videoPath string) *Configuration

type Library

type Library interface {
	Add(url, sdHash, _type string) (*Video, error)
	Get(string) (*Video, error)
}

type Queue

type Queue interface {
	Add(url, sdHash, _type string) (*Task, error)
	GetBySDHash(sdHash string) (*Task, error)
}

type Task

type Task interface {
}

type Video

type Video interface {
	GetLocation() (location string, external bool)
}

type VideoManager

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

func NewManager

func NewManager(q *queue.Queue, l *video.Library) *VideoManager

func (*VideoManager) GetVideoOrCreateTask

func (m *VideoManager) GetVideoOrCreateTask(uri, kind string) (Video, error)

GetVideoOrCreateTask checks if video exists in the library or is waiting in the queue. If neither, it validates and adds video for later processing.

Jump to

Keyboard shortcuts

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