output

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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