serializers

package
v0.0.0-...-72bdc65 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2016 License: MIT Imports: 4 Imported by: 0

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: influx, graphite
	DataFormat string

	// Prefix to add to all measurements, only supports Graphite
	Prefix string
}

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 telegraf metric and turns it into a string.
	Serialize(metric telegraf.Metric) ([]string, error)
}

Serializer is an interface defining functions that a serializer plugin must satisfy.

func NewGraphiteSerializer

func NewGraphiteSerializer(prefix string) (Serializer, error)

func NewInfluxSerializer

func NewInfluxSerializer() (Serializer, error)

func NewJsonSerializer

func NewJsonSerializer() (Serializer, error)

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 telegraf metrics into arbitrary data formats.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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