video

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTranscodingUnderway = errors.New("transcoding in progress")
	ErrChannelNotEnabled   = errors.New("transcoding was not enabled for this channel")
	ErrNoSigningChannel    = errors.New("no signing channel for stream")
)
View Source
var InitialMigration = `` /* 389-byte string literal not displayed */

Functions

func LoadEnabledChannels

func LoadEnabledChannels(channels []string)

func SetLogger

func SetLogger(l *zap.SugaredLogger)

func SpawnProcessing

func SpawnProcessing(videoPath string, q *queue.Queue, lib *Library, p *queue.Poller)

func ValidateByClaim

func ValidateByClaim(c *claim.Claim) error

func ValidateIncomingVideo

func ValidateIncomingVideo(uri string) (*claim.Claim, error)

ValidateIncomingVideo checks if supplied video can be accepted for processing.

Types

type AddParams

type AddParams struct {
	URL     string
	SDHash  string
	Type    string
	Path    string
	Channel string
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
	BeginTx(context.Context, *sql.TxOptions) (*sql.Tx, error)
}

type Library

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

Library contains methods for accessing videos database.

func NewLibrary

func NewLibrary(db *db.DB) *Library

func (Library) Add

func (q Library) Add(params AddParams) (*Video, error)

Add records data about video into database.

func (Library) Get

func (q Library) Get(sdHash string) (*Video, error)

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) Add

func (q *Queries) Add(ctx context.Context, arg AddParams) (*Video, error)

func (*Queries) Get

func (q *Queries) Get(ctx context.Context, sdHash string) (*Video, error)

type Video

type Video struct {
	SDHash       string
	CreatedAt    string
	URL          string
	Path         string
	Type         string
	Channel      string
	LastAccessed sql.NullTime
}

func (Video) GetPath

func (v Video) GetPath() string

Jump to

Keyboard shortcuts

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