xml

package
v0.0.0-...-aba53e5 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 6 Imported by: 0

README

xml

mjx "github.com/clbanning/mxj/v2"

Documentation

Index

Constants

View Source
const ErrorTag = "gogstash_codec_xml_error"

ErrorTag tag added to event when process module failed

View Source
const ModuleName = "xml"

ModuleName is the name used in config file

Variables

View Source
var NotImplementedError = errors.New("not implemented")

Functions

func InitHandler

InitHandler initialize the codec plugin

Types

type Codec

type Codec struct {
	config.CodecConfig
	TryCast bool   `json:"try_cast" yaml:"try_cast"` // attempt to cast types from string
	RootTag string `json:"root_tag" yaml:"root_tag"` // root tag on encoder
}

Codec default struct for XML

func (*Codec) Decode

func (c *Codec) Decode(_ context.Context, data interface{}, eventExtra map[string]interface{}, tags []string, msgChan chan<- logevent.LogEvent) (ok bool, err error)

Decode returns an event from 'data' as XML format

func (*Codec) DecodeEvent

func (c *Codec) DecodeEvent(data []byte, event *logevent.LogEvent) (err error)

DecodeEvent decodes 'data' as XML format to event

func (*Codec) Encode

func (c *Codec) Encode(_ context.Context, event logevent.LogEvent, dataChan chan<- []byte) (ok bool, err error)

Encode encodes the event to a XML encoded message

Jump to

Keyboard shortcuts

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