task

package
v0.4.16 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: MIT Imports: 38 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 Prepare added in v0.4.0

func Prepare(tctx *TaskContext, assetSpec *api.AssetSpec, file io.ReadSeekCloser, progressStart float64) (string, error)

func ReportProgress added in v0.2.0

func ReportProgress(ctx context.Context, lapi *api.Client, taskID string, size uint64, getCount func() uint64, startFraction, endFraction float64)

func TaskExport added in v0.2.0

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

func TaskImport

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

func TaskTranscode added in v0.3.0

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

Types

type Accumulator added in v0.4.11

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

func NewAccumulator added in v0.4.11

func NewAccumulator() *Accumulator

func (*Accumulator) Accumulate added in v0.4.11

func (a *Accumulator) Accumulate(size uint64)

func (*Accumulator) Size added in v0.4.11

func (a *Accumulator) Size() uint64

type ExportTaskConfig added in v0.4.5

type ExportTaskConfig struct {
	PinataAccessToken  string
	PlayerImmutableURL *url.URL
	PlayerExternalURL  *url.URL
}

type FileMetadata

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

func Probe

func Probe(ctx context.Context, assetId, 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 api.ClientOptions
	ExportTaskConfig

	TaskHandlers map[string]TaskHandler
}

type TaskContext

type TaskContext struct {
	context.Context

	data.TaskInfo
	*api.Task
	InputAsset, OutputAsset *api.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

func (*TaskContext) WithContext added in v0.4.5

func (t *TaskContext) WithContext(ctx context.Context) *TaskContext

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

type WriteSeekCloser added in v0.3.0

type WriteSeekCloser interface {
	io.WriteSeeker
	io.Closer
	Reader() io.ReadSeekCloser
}

Jump to

Keyboard shortcuts

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