serializers

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Serializer

type Serializer interface {
	// Serialize takes a single Prometheus sample and turns it into a byte buffer.
	Serialize(metric model.Sample) ([]byte, error)

	// ADXFormat Azure Data Explorer injestion data format.
	ADXFormat() kusto.DataFormat
}

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

func NewAvroJSONSerializer

func NewAvroJSONSerializer() (Serializer, error)

NewAvroJSONSerializer provides a 'avro-json' Serializer

func NewJSONSerializer

func NewJSONSerializer() (Serializer, error)

NewJSONSerializer provides a 'json' Serializer

func NewSerializer

func NewSerializer(cfg *SerializerConfig) (Serializer, error)

NewSerializer provides a Serializer based on the given config.

Parses SerializerConfig.DataFormat string

type SerializerConfig

type SerializerConfig struct {
	// Dataformat can be one of the serializer types listed in serializers.NewSerializer.
	DataFormat string
}

SerializerConfig is a struct that covers the data types needed for all serializer types, and can be used to instantiate _any_ of the serializers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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