task

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = clients.BaseClient{}

Functions

func IsUnretriable

func IsUnretriable(err error) bool

func ReportProgress added in v0.2.0

func ReportProgress(ctx context.Context, lapi *livepeerAPI.Client, taskID string, size uint64, getCount func() uint64)

func TaskExport added in v0.2.0

func TaskExport(tctx *TaskContext) (*data.TaskOutput, 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 *ReadCounter) (*FileMetadata, error)

type ReadCounter added in v0.2.0

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

func NewReadCounter added in v0.2.0

func NewReadCounter(r io.Reader) *ReadCounter

func (*ReadCounter) Count added in v0.2.0

func (h *ReadCounter) Count() uint64

func (*ReadCounter) Read added in v0.2.0

func (h *ReadCounter) Read(p []byte) (int, 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

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
	LivepeerAPIOptions livepeerAPI.ClientOptions
	PinataAccessToken  string

	TaskHandlers map[string]TaskHandler
}

type TaskContext

type TaskContext struct {
	context.Context

	data.TaskInfo
	*livepeerAPI.Task
	InputAsset, OutputAsset *livepeerAPI.Asset
	// contains filtered or unexported fields
}

func (TaskContext) Shutdown added in v0.2.0

func (r TaskContext) Shutdown(ctx context.Context) error

func (TaskContext) Start added in v0.2.0

func (r TaskContext) Start() error

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