output

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOutputResponseFromDef added in v3.4.0

func NewOutputResponseFromDef(def *model.OutputDef) *app.OutputResponse

NewOutputResponseFromDef creates new Output response from a definition

Types

type Builder added in v3.4.0

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

Builder is used to create an Output definition

func NewBuilder added in v3.4.0

func NewBuilder() *Builder

NewBuilder creates new Output definition builder instance

func (*Builder) Alias added in v3.4.0

func (ob *Builder) Alias(alias *string) *Builder

Alias set alias

func (*Builder) Build added in v3.4.0

func (ob *Builder) Build() *model.OutputDef

Build creates the output definition

func (*Builder) Condition added in v3.4.0

func (ob *Builder) Condition(condition *string) *Builder

Condition set condition

func (*Builder) Enable added in v3.4.0

func (ob *Builder) Enable(status bool) *Builder

Enable set enabled status

func (*Builder) From added in v3.4.0

func (ob *Builder) From(source model.OutputDef) *Builder

From creates output form an other

func (*Builder) FromURI added in v3.4.0

func (ob *Builder) FromURI(URI string) *Builder

FromURI creates a output definition form an URI

func (*Builder) ID added in v3.4.0

func (ob *Builder) ID(ID string) *Builder

ID set ID

func (*Builder) NewID added in v3.4.0

func (ob *Builder) NewID() *Builder

NewID set new ID

func (*Builder) Props added in v3.4.0

func (ob *Builder) Props(props model.OutputProps) *Builder

Props set props

func (*Builder) Spec added in v3.4.0

func (ob *Builder) Spec(name string) *Builder

Spec set spec name

type Manager

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

Manager is the object that manage outputs.

func NewOutputManager

func NewOutputManager(cache *cache.Manager) (*Manager, error)

NewOutputManager creates a new output manager

func (*Manager) AddOutputProcessor

func (m *Manager) AddOutputProcessor(def *model.OutputDef) (*Processor, error)

AddOutputProcessor add an output processor to the manager

func (*Manager) GetAvailableOutputs

func (m *Manager) GetAvailableOutputs() []model.Spec

GetAvailableOutputs get all available outputs

func (*Manager) GetOutputDefs

func (m *Manager) GetOutputDefs() []model.OutputDef

GetOutputDefs return all output definitions of the pipeline

func (*Manager) GetOutputProcessor

func (m *Manager) GetOutputProcessor(id string) (*Processor, error)

GetOutputProcessor removes an output from the pipeline

func (*Manager) Push

func (m *Manager) Push(articles []*model.Article)

Push articles to output processors

func (*Manager) RemoveOutputProcessor

func (m *Manager) RemoveOutputProcessor(def *model.OutputDef) error

RemoveOutputProcessor removes an output from the pipeline

func (*Manager) Shutdown

func (m *Manager) Shutdown()

Shutdown stop the manager (aka. stop all processors)

func (*Manager) UpdateOutputProcessor

func (m *Manager) UpdateOutputProcessor(def *model.OutputDef) (*Processor, error)

UpdateOutputProcessor update an output of the pipeline

type Processor

type Processor struct {
	Filters *filter.Chain
	// contains filtered or unexported fields
}

Processor is the object that operate an output.

func NewOutputProcessor

func NewOutputProcessor(out model.Output, filters *filter.Chain, cm *cache.Manager) (*Processor, error)

NewOutputProcessor creates a new output processor

func (*Processor) GetDef

func (p *Processor) GetDef() model.OutputDef

GetDef returns processor output definition

func (*Processor) Process

func (p *Processor) Process(articles []*model.Article)

Process articles

func (*Processor) Shutdown

func (p *Processor) Shutdown() error

Shutdown a processor

func (*Processor) Update

func (p *Processor) Update(out model.Output, filters *filter.Chain)

Update update output and filter chain

type Status

type Status uint8

Status is the process status

const (
	// RunningStatus is the status of a running process
	RunningStatus Status = iota
	// StoppedStatus is the status of a stoppedprocess
	StoppedStatus
)

func (Status) String

func (s Status) String() string

String converts a status to a readable string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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