biz

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFilterChain

func NewFilterChain(settings *config.AppSettings) (filter.Filter, error)

Types

type Emitter

type Emitter struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

Emitter represents an abject to manage plugins communication

func NewEmitter

func NewEmitter(f filter.Filter, lim Limiter) *Emitter

NewEmitter creates and initializes new Emitter object.

func (*Emitter) Close

func (e *Emitter) Close()

Close closes all the goroutine and waits for it to finish.

func (*Emitter) CopyMulty

func (e *Emitter) CopyMulty(src PluginReader, writers ...PluginWriter) error

CopyMulty copies from 1 reader to multiple writers

func (*Emitter) Start

func (e *Emitter) Start(plugins *InOutPlugins)

Start initialize loop for sending data from inputs to outputs

type InOutPlugins

type InOutPlugins struct {
	Inputs  []PluginReader
	Outputs []PluginWriter
	All     []interface{}
}

InOutPlugins struct for holding references to plugins

func NewPlugins

func NewPlugins(settings *config.AppSettings) *InOutPlugins

NewPlugins specify and initialize all available plugins

func (*InOutPlugins) String

func (plugins *InOutPlugins) String() string

type Limiter added in v0.1.4

type Limiter interface {
	Allow() bool
}

func NewRateLimit added in v0.1.4

func NewRateLimit(settings *config.AppSettings) Limiter

type PluginReader

type PluginReader interface {
	io.Closer
	Read() (msg *protocol.Message, err error)
}

PluginReader is an interface for input plugins

type PluginWriter

type PluginWriter interface {
	io.Closer
	Write(msg *protocol.Message) (err error)
}

PluginWriter is an interface for output plugins

Jump to

Keyboard shortcuts

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