parser

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UTF16LE UTF16 little endian, most common (windows)
	UTF16LE = iota
	// UTF16BE UTF16 big endian
	UTF16BE
)

Variables

View Source
var NoopParser *noopParser

NoopParser is the default parser and does nothing

Functions

This section is empty.

Types

type DecodingParser added in v0.9.0

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

DecodingParser a generic decoding Parser

func NewDecodingParser added in v0.9.0

func NewDecodingParser(e Encoding) *DecodingParser

NewDecodingParser build a new DecodingParser

func (*DecodingParser) Parse added in v0.9.0

func (p *DecodingParser) Parse(msg []byte) ([]byte, string, string, bool, error)

Parse parses the incoming message with the decoder

func (*DecodingParser) SupportsPartialLine added in v0.9.0

func (p *DecodingParser) SupportsPartialLine() bool

SupportsPartialLine returns false as it does not support partial lines

type Encoding added in v0.9.0

type Encoding int

Encoding is our internal type for supported encoding for the DecodingParser

type Parser

type Parser interface {
	// It returns 1. raw message, 2. severity, 3. timestamp, 4. partial, 5. error
	Parse([]byte) ([]byte, string, string, bool, error)
	SupportsPartialLine() bool
}

Parser parse messages

Jump to

Keyboard shortcuts

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