processor

package
v0.0.0-...-5655933 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 12 Imported by: 0

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 JSONServerlessEncoder Encoder = &jsonServerlessEncoder{}

JSONServerlessEncoder is a shared json encoder sending a struct message field instead of a bytes message field. This encoder is used in the AWS Lambda serverless environment.

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 []*logsconfig.ProcessingRule, encoder Encoder, diagnosticMessageReceiver diagnostic.MessageReceiver) *Processor

New returns an initialized Processor.

func (*Processor) Flush

func (p *Processor) Flush(ctx context.Context)

Flush processes synchronously the messages that this processor has to process.

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