processor

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder interface {
	Encode(msg *message.Message, redactedMsg []byte) ([]byte, error)
}

Encoder turns a message into a raw byte array ready to be sent.

var JSONEncoder Encoder = &jsonEncoder{}

JSONEncoder is a shared json encoder.

var ProtoEncoder Encoder = &protoEncoder{}

ProtoEncoder is a shared proto encoder.

var RawEncoder Encoder = &rawEncoder{}

RawEncoder is a shared raw encoder.

type Processor

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

A Processor updates messages from an inputChan and pushes in an outputChan.

func New

func New(inputChan, outputChan chan *message.Message, processingRules []*config.ProcessingRule, encoder Encoder) *Processor

New returns an initialized Processor.

func (*Processor) Start

func (p *Processor) Start()

Start starts the Processor.

func (*Processor) Stop

func (p *Processor) Stop()

Stop stops the Processor, this call blocks until inputChan is flushed

Jump to

Keyboard shortcuts

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