marshaler

package
v0.0.0-...-7983b3b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbstractMarshaler

type AbstractMarshaler interface {
	// SplitPayload breaks the payload into times number of pieces
	SplitPayload(int) ([]AbstractMarshaler, error)

	// MarshalSplitCompress uses the stream compressor to marshal and compress payloads.
	MarshalSplitCompress(*BufferContext) ([]*[]byte, error)
}

AbstractMarshaler is an abstract marshaler.

type BufferContext

type BufferContext struct {
	CompressorInput   *bytes.Buffer
	CompressorOutput  *bytes.Buffer
	PrecompressionBuf *bytes.Buffer
}

BufferContext contains the buffers used for MarshalSplitCompress so they can be shared between invocations

func DefaultBufferContext

func DefaultBufferContext() *BufferContext

DefaultBufferContext initialize the default compression buffers

type JSONMarshaler

type JSONMarshaler interface {
	AbstractMarshaler

	// MarshalJSON serialization a Payload to JSON
	MarshalJSON() ([]byte, error)
}

JSONMarshaler is a AbstractMarshaler that implement JSON marshaling.

type Marshaler

type Marshaler interface {
	JSONMarshaler
	ProtoMarshaler
}

Marshaler is an interface for metrics that are able to serialize themselves to JSON and protobuf

type ProtoMarshaler

type ProtoMarshaler interface {
	AbstractMarshaler

	// Marshal serialize objects using agent-payload definition.
	Marshal() ([]byte, error)
}

ProtoMarshaler is a AbstractMarshaler that implement proto marshaling.

type StreamJSONMarshaler

type StreamJSONMarshaler interface {
	JSONMarshaler
	WriteHeader(*jsoniter.Stream) error
	WriteFooter(*jsoniter.Stream) error
	WriteItem(*jsoniter.Stream, int) error
	Len() int
	DescribeItem(i int) string
}

StreamJSONMarshaler is an interface for metrics that are able to serialize themselves in a stream

Jump to

Keyboard shortcuts

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