encoders

package
v0.0.0-...-2081a44 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AvroMimetype = "application/x-avro-binary"
View Source
var JsonMimetype = "application/json"
View Source
var NDJsonMimetype = "application/x-ndjson"
View Source
var OctetStreamMimetype = "application/octet-stream"
View Source
var PlainMimetype = mime.FormatMediaType("text/plain", map[string]string{"charset": "utf-8"})
View Source
var ProtobufMimetype = "application/vnd.google.protobuf"
View Source
var RMimeTypes = map[string]Encoder{
	JsonMimetype:        encodeJSON,
	NDJsonMimetype:      encodeJSON,
	AvroMimetype:        encodeFullAVRO,
	ProtobufMimetype:    encodePB,
	OctetStreamMimetype: encodePB,
	PlainMimetype:       encode5424,
	"text/plain":        encode5424,
}

Functions

func ChainEncode

func ChainEncode(e Encoder, objs ...interface{}) (ret string, err error)

func EncodingError

func EncodingError(err error) error

func FullToGelfMessage

func FullToGelfMessage(m *model.FullMessage) *gelf.Message

func RELPEncode

func RELPEncode(e Encoder, txnr int32, command string, obj interface{}) (ret string, err error)

func SyslogToGelfMessage

func SyslogToGelfMessage(m *model.SyslogMessage) *gelf.Message

func TcpOctetEncode

func TcpOctetEncode(e Encoder, obj interface{}) (ret string, err error)

Types

type Encoder

type Encoder func(v interface{}, w io.Writer) error

Encoder is the function type that represents encoders

func GetEncoder

func GetEncoder(frmt baseenc.Format) (Encoder, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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