parser

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UTF16LE UTF16 little endian, most common (windows)
	UTF16LE = iota
	// UTF16BE UTF16 big endian
	UTF16BE
	//
	GBK18030
	//
	GB2312
	//
	HZGB2312
	//
	GBK
	//
	BIG5
)

Variables

View Source
var NoopParser *noopParser

NoopParser is the default parser and does nothing

Functions

This section is empty.

Types

type DecodingParser

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

DecodingParser a generic decoding Parser

func NewDecodingParser

func NewDecodingParser(e Encoding) *DecodingParser

NewDecodingParser build a new DecodingParser

func (*DecodingParser) Parse

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

Parse parses the incoming message with the decoder

func (*DecodingParser) SupportsPartialLine

func (p *DecodingParser) SupportsPartialLine() bool

SupportsPartialLine returns false as it does not support partial lines

type Encoding

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