task

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUnretriable

func IsUnretriable(err error) bool

func NilIfUnretriable

func NilIfUnretriable(err error) error

func TaskImport

func TaskImport(tctx *TaskContext) (*data.TaskOutput, error)

Types

type FileMetadata

type FileMetadata struct {
	MD5       string                 `json:"md5"`
	SHA256    string                 `json:"sha256"`
	Ffprobe   *ffprobe.ProbeData     `json:"ffprobe"`
	AssetSpec *livepeerAPI.AssetSpec `json:"assetSpec"`
}

func Probe

func Probe(ctx context.Context, filename string, data io.Reader) (*FileMetadata, error)

type ReadHasher

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

func NewReadHasher

func NewReadHasher(r io.Reader) *ReadHasher

func (*ReadHasher) FinishReader

func (h *ReadHasher) FinishReader() (int64, error)

func (*ReadHasher) MD5

func (h *ReadHasher) MD5() string

func (*ReadHasher) Read

func (h *ReadHasher) Read(p []byte) (int, error)

func (*ReadHasher) SHA256

func (h *ReadHasher) SHA256() string

func (*ReadHasher) Size

func (h *ReadHasher) Size() uint64

type Runner

type Runner interface {
	Start() error
	Shutdown(ctx context.Context) error
}

func NewRunner

func NewRunner(opts RunnerOptions) Runner

type RunnerOptions

type RunnerOptions struct {
	AMQPUri      string
	ExchangeName string
	QueueName    string
	TaskHandlers map[string]TaskHandler

	LivepeerAPIOptions livepeerAPI.ClientOptions
}

type TaskContext

type TaskContext struct {
	context.Context
	data.TaskInfo
	*livepeerAPI.Task
	*livepeerAPI.Asset
	*livepeerAPI.ObjectStore
	// contains filtered or unexported fields
}

type TaskHandler

type TaskHandler func(tctx *TaskContext) (*data.TaskOutput, error)

type UnretriableError

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

func (UnretriableError) Error

func (e UnretriableError) Error() string

func (UnretriableError) Unwrap

func (e UnretriableError) Unwrap() error

Jump to

Keyboard shortcuts

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