Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// DataFormat can be one of the serializer types listed in NewSerializer.
DataFormat string `toml:"data_format"`
// DataFormatTemplate is a Golang template used by template dataformat
// It is only used with template dataformat
DataFormatTemplate string `toml:"data_format_template"`
}
Config is a struct that covers the data types needed for all serializer types, and can be used to instantiate _any_ of the serializers.
type Serializer ¶
type Serializer interface {
// Serialize takes a single event and turns it into a byte buffer.
// separate metrics should be separated by a newline, and there should be
// a newline at the end of the buffer.
Serialize(event events.Event) ([]byte, error)
// ContentType returns content-type used by the serializer
ContentType() string
}
Serializer is an interface defining functions that a serializer plugin must satisfy.
func NewSerializer ¶
func NewSerializer(config *Config) (Serializer, error)
NewSerializer a Serializer interface based on the given config.
type SerializerOutput ¶
type SerializerOutput interface {
// SetSerializer sets the serializer function for the interface.
SetSerializer(serializer Serializer)
}
SerializerOutput is an interface for output plugins that are able to serialize events into arbitrary data formats.
Click to show internal directories.
Click to hide internal directories.