pipeline

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PipeConfig

type PipeConfig struct {
	Name    string
	TmpArgs interface{} // 临时变量插入
	Check   plugin.Config
	Input   plugin.Config
	Filter  plugin.Config
	Output  plugin.Config
}

Pipeline Config

func DefaultPipeConfig

func DefaultPipeConfig(name string) *PipeConfig

Pipeline Config 工厂模式

func (*PipeConfig) SetArgs

func (p *PipeConfig) SetArgs(data interface{}) *PipeConfig

设置临时变量

func (*PipeConfig) WithCheckName

func (p *PipeConfig) WithCheckName(name string) *PipeConfig

func (*PipeConfig) WithFilterName

func (p *PipeConfig) WithFilterName(name string) *PipeConfig

func (*PipeConfig) WithInputName

func (p *PipeConfig) WithInputName(name string) *PipeConfig

func (*PipeConfig) WithOutputName

func (p *PipeConfig) WithOutputName(name string) *PipeConfig

type Pipeline

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

对于插件化的系统,一切皆是插件,因此将pipeline也设计成一个插件,实现plugin接口 pipeline管道的定义

func Of

func Of(conf PipeConfig) *Pipeline

pipeline工厂方法,根据配置创建一个Pipeline实例

func (*Pipeline) Exec

func (p *Pipeline) Exec()

一个消息的处理流程 check -> input -> filter -> output

func (*Pipeline) Init

func (p *Pipeline) Init()

func (*Pipeline) Start

func (p *Pipeline) Start()

启动的顺序 output -> filter -> input -> check

func (*Pipeline) Status

func (p *Pipeline) Status() plugin.StatusPlugin

func (*Pipeline) Stop

func (p *Pipeline) Stop()

停止的顺序 check -> input -> filter -> output

Jump to

Keyboard shortcuts

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