codec

package
v0.0.0-...-bf621fb Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmpty = errors.New("codec line empty")
View Source
var ErrIncomplete = errors.New("codec line incomplete")

Functions

func Set

func Set(name string, f codecFn)

Types

type Codec

type Codec interface {
	Name() string
	// Parse return event, praseErrror
	//
	// can return nil without parseErr (may be part of multiline event)
	Parse(time timeutil.Time, data []byte) (*event.Event, error)
}

Codec can be non thread-safe, so alloc for every watcher in input

func New

func New(cfg *config.ConfigRaw, common *config.Common, path string) (Codec, error)

type Config

type Config struct {
	Type string `hcl:"type" yaml:"type"` // input type (from codecs map)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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