codec

package
v1.19.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInstrumentedCodec

func NewInstrumentedCodec(uc v1.Codec, m *InstrumentedCodecMetrics) v1.Codec

Types

type InstrumentedCodec

type InstrumentedCodec struct {
	// contains filtered or unexported fields
}

func (*InstrumentedCodec) CanEncode

func (c *InstrumentedCodec) CanEncode(resp *v1.Response) bool

func (*InstrumentedCodec) ContentType

func (c *InstrumentedCodec) ContentType() v1.MIMEType

func (*InstrumentedCodec) Encode

func (c *InstrumentedCodec) Encode(resp *v1.Response) ([]byte, error)

type InstrumentedCodecMetrics

type InstrumentedCodecMetrics struct {
	// contains filtered or unexported fields
}

func NewInstrumentedCodecMetrics

func NewInstrumentedCodecMetrics(reg prometheus.Registerer) *InstrumentedCodecMetrics

type ProtobufCodec

type ProtobufCodec struct {
	// cortexInternal enables encoding the whole native histogram data fields in response instead of keeping
	// only few sparse information like the default JSON/Protobuf codec does.
	// This will be used by Cortex Ruler to get native histograms data from Cortex Query Frontend because
	// rule evaluation requires the full native histogram data.
	CortexInternal bool
}

func (ProtobufCodec) CanEncode

func (p ProtobufCodec) CanEncode(resp *v1.Response) bool

func (ProtobufCodec) ContentType

func (p ProtobufCodec) ContentType() v1.MIMEType

func (ProtobufCodec) Encode

func (p ProtobufCodec) Encode(resp *v1.Response) ([]byte, error)

ProtobufCodec implementation is derived from https://github.com/prometheus/prometheus/blob/main/web/api/v1/json_codec.go

Jump to

Keyboard shortcuts

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