pipeline

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	Body []byte

	Reader io.Reader
	// contains filtered or unexported fields
}

func (*Buffer) Len

func (c *Buffer) Len() int64

func (*Buffer) MergeReader

func (c *Buffer) MergeReader() io.Reader

func (*Buffer) ReadAll

func (c *Buffer) ReadAll() *bytes.Buffer

type GetterFunc

type GetterFunc = func(actx PipelineCtx) (PipelineCtx, error)

type Pipeline

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

func NewPipeline

func NewPipeline(c PipelineConfig) Pipeline

func (*Pipeline) Execute

func (p *Pipeline) Execute() (PipelineCtx, error)

type PipelineConfig

type PipelineConfig struct {
	Source *Source
	Sinker *Sinker
	Steps  []Step
}

type PipelineCtx

type PipelineCtx struct {
	Path             media.Path
	Buffer           *Buffer
	ContentType      media.ContentType
	EmbeddedMetadata media.Metadata
	Tags             []media.Tag
}

type SinkFunc

type SinkFunc = func(PipelineCtx) error

type Sinker

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

func NewSinker

func NewSinker(c SinkerConfig) Sinker

func (*Sinker) Run

func (s *Sinker) Run(ctx PipelineCtx) (PipelineCtx, error)

type SinkerConfig

type SinkerConfig struct {
	Sinker SinkFunc
}

type Source

type Source struct {
	SourceConfig
}

func NewSource

func NewSource(config SourceConfig) Source

func (*Source) Run

func (s *Source) Run(ctx PipelineCtx) (PipelineCtx, error)

type SourceConfig

type SourceConfig struct {
	Getter GetterFunc
}

type Step

type Step interface {
	Run(ctx PipelineCtx) (PipelineCtx, error)
}

Jump to

Keyboard shortcuts

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