pipeline

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrPipelineIsAlreadyActive is thrown when the Run() method is called during an active pipeline.
	ErrPipelineIsAlreadyActive = Error("pipeline is currently active, unable to run")

	// ErrCannotSetupWhilstPipelineIsActive is thrown when the Setup() method is called whilst the pipeline is active.
	ErrCannotSetupWhilstPipelineIsActive = Error("cannot setup whilst pipeline is active")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error string

Error is a custom error interface for our pipeline. It was implemented to have constant errors.

func (Error) Error

func (e Error) Error() string

type Options

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

func NewOptions

func NewOptions(
	size int,
	address,
	videoSource,
	videoDestination,
	imageDestination string,
	transcodeOptions ffmpeg.TranscodeOptions,
) *Options

func (*Options) Clone

func (o *Options) Clone() *Options

func (*Options) GetAddress

func (o *Options) GetAddress() string

func (*Options) GetImageDestination

func (o *Options) GetImageDestination() string

func (*Options) GetSize

func (o *Options) GetSize() int

func (*Options) GetTranscodeOptions

func (o *Options) GetTranscodeOptions() ffmpeg.TranscodeOptions

func (*Options) GetVideoDestination

func (o *Options) GetVideoDestination() string

func (*Options) GetVideoSource

func (o *Options) GetVideoSource() string

func (*Options) IsEmpty

func (o *Options) IsEmpty() bool

func (*Options) Replace

func (o *Options) Replace(options *Options)

type Pipeline

type Pipeline interface {
	// Setup will set the options if the pipeline isn't running.
	Setup(options *Options) (err error)

	// Run combines the other flow methods
	// in the following order: Download -> Transcode -> Metadata -> Upload
	Run(ctx context.Context) (err error)
	Close() (err error)
	Active() bool

	// Methods
	Download(ctx context.Context) (err error)
	Transcode(ctx context.Context) (err error)
	Metadata(ctx context.Context) (err error)
	Upload(ctx context.Context) (err error)
	Retry(ctx context.Context, response *grpc_runner_v1.StreamResponse) (err error)

	// Events
	Stream() <-chan *grpc_runner_v1.StreamRequest
	Operation() <-chan *grpc_runner_v1.OperationRequest
	Done() <-chan struct{}
}

func New

func New() Pipeline

func NewWithOptions

func NewWithOptions(options *Options) Pipeline

Jump to

Keyboard shortcuts

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