marshaler

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 2 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferContext added in v0.9.0

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 added in v0.9.0

func DefaultBufferContext() *BufferContext

DefaultBufferContext initialize the default compression buffers

type Marshaler

type Marshaler interface {
	MarshalJSON() ([]byte, error)
	Marshal() ([]byte, error)
	SplitPayload(int) ([]Marshaler, error)
	MarshalSplitCompress(*BufferContext) ([]*[]byte, error)
}

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

type StreamJSONMarshaler

type StreamJSONMarshaler interface {
	Marshaler
	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