Help us shape the future of Go! Take the 2026 Go Developer Survey

definitions

package
v3.6.19 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthDefinitions = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDefinitions   = fmt.Errorf("proto: integer overflow")
)

Functions

This section is empty.

Types

type CachingOptions

type CachingOptions = resultscache.CachingOptions

type Codec

type Codec interface {
	Merger
	// DecodeRequest decodes a Request from an http request.
	DecodeRequest(_ context.Context, request *http.Request, forwardHeaders []string) (Request, error)
	// DecodeResponse decodes a Response from an http response.
	// The original request is also passed as a parameter this is useful for implementation that needs the request
	// to merge result or build the result correctly.
	DecodeResponse(context.Context, *http.Response, Request) (Response, error)
	// EncodeRequest encodes a Request into an http request.
	EncodeRequest(context.Context, Request) (*http.Request, error)
	// EncodeResponse encodes a Response into an http response.
	EncodeResponse(context.Context, *http.Request, Response) (*http.Response, error)
}

Codec is used to encode/decode query range requests and responses so they can be passed down to middlewares.

type Merger

type Merger interface {
	// MergeResponse merges responses from multiple requests into a single Response
	MergeResponse(...Response) (Response, error)
}

Merger is used by middlewares making multiple requests to merge back all responses into a single one.

type PrometheusRequestHeader

type PrometheusRequestHeader struct {
	Name   string   `protobuf:"bytes,1,opt,name=Name,proto3" json:"-"`
	Values []string `protobuf:"bytes,2,rep,name=Values,proto3" json:"-"`
}

func (*PrometheusRequestHeader) Descriptor

func (*PrometheusRequestHeader) Descriptor() ([]byte, []int)

func (*PrometheusRequestHeader) Equal

func (this *PrometheusRequestHeader) Equal(that interface{}) bool

func (*PrometheusRequestHeader) GetName

func (m *PrometheusRequestHeader) GetName() string

func (*PrometheusRequestHeader) GetValues

func (m *PrometheusRequestHeader) GetValues() []string

func (*PrometheusRequestHeader) GoString

func (this *PrometheusRequestHeader) GoString() string

func (*PrometheusRequestHeader) Marshal

func (m *PrometheusRequestHeader) Marshal() (dAtA []byte, err error)

func (*PrometheusRequestHeader) MarshalTo

func (m *PrometheusRequestHeader) MarshalTo(dAtA []byte) (int, error)

func (*PrometheusRequestHeader) MarshalToSizedBuffer

func (m *PrometheusRequestHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusRequestHeader) ProtoMessage

func (*PrometheusRequestHeader) ProtoMessage()

func (*PrometheusRequestHeader) Reset

func (m *PrometheusRequestHeader) Reset()

func (*PrometheusRequestHeader) Size

func (m *PrometheusRequestHeader) Size() (n int)

func (*PrometheusRequestHeader) String

func (this *PrometheusRequestHeader) String() string

func (*PrometheusRequestHeader) Unmarshal

func (m *PrometheusRequestHeader) Unmarshal(dAtA []byte) error

func (*PrometheusRequestHeader) XXX_DiscardUnknown

func (m *PrometheusRequestHeader) XXX_DiscardUnknown()

func (*PrometheusRequestHeader) XXX_Marshal

func (m *PrometheusRequestHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrometheusRequestHeader) XXX_Merge

func (m *PrometheusRequestHeader) XXX_Merge(src proto.Message)

func (*PrometheusRequestHeader) XXX_Size

func (m *PrometheusRequestHeader) XXX_Size() int

func (*PrometheusRequestHeader) XXX_Unmarshal

func (m *PrometheusRequestHeader) XXX_Unmarshal(b []byte) error

type PrometheusResponseHeader

type PrometheusResponseHeader struct {
	Name   string   `protobuf:"bytes,1,opt,name=Name,proto3" json:"-"`
	Values []string `protobuf:"bytes,2,rep,name=Values,proto3" json:"-"`
}

func (*PrometheusResponseHeader) Descriptor

func (*PrometheusResponseHeader) Descriptor() ([]byte, []int)

func (*PrometheusResponseHeader) Equal

func (this *PrometheusResponseHeader) Equal(that interface{}) bool

func (*PrometheusResponseHeader) GetName

func (m *PrometheusResponseHeader) GetName() string

func (*PrometheusResponseHeader) GetValues

func (m *PrometheusResponseHeader) GetValues() []string

func (*PrometheusResponseHeader) GoString

func (this *PrometheusResponseHeader) GoString() string

func (*PrometheusResponseHeader) Marshal

func (m *PrometheusResponseHeader) Marshal() (dAtA []byte, err error)

func (*PrometheusResponseHeader) MarshalTo

func (m *PrometheusResponseHeader) MarshalTo(dAtA []byte) (int, error)

func (*PrometheusResponseHeader) MarshalToSizedBuffer

func (m *PrometheusResponseHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusResponseHeader) ProtoMessage

func (*PrometheusResponseHeader) ProtoMessage()

func (*PrometheusResponseHeader) Reset

func (m *PrometheusResponseHeader) Reset()

func (*PrometheusResponseHeader) Size

func (m *PrometheusResponseHeader) Size() (n int)

func (*PrometheusResponseHeader) String

func (this *PrometheusResponseHeader) String() string

func (*PrometheusResponseHeader) Unmarshal

func (m *PrometheusResponseHeader) Unmarshal(dAtA []byte) error

func (*PrometheusResponseHeader) XXX_DiscardUnknown

func (m *PrometheusResponseHeader) XXX_DiscardUnknown()

func (*PrometheusResponseHeader) XXX_Marshal

func (m *PrometheusResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrometheusResponseHeader) XXX_Merge

func (m *PrometheusResponseHeader) XXX_Merge(src proto.Message)

func (*PrometheusResponseHeader) XXX_Size

func (m *PrometheusResponseHeader) XXX_Size() int

func (*PrometheusResponseHeader) XXX_Unmarshal

func (m *PrometheusResponseHeader) XXX_Unmarshal(b []byte) error

type Request

type Request interface {
	proto.Message
	// GetStart returns the start timestamp of the request in milliseconds.
	GetStart() time.Time
	// GetEnd returns the end timestamp of the request in milliseconds.
	GetEnd() time.Time
	// GetStep returns the step of the request in milliseconds.
	GetStep() int64
	// GetQuery returns the query of the request.
	GetQuery() string
	// GetCachingOptions returns the caching options.
	GetCachingOptions() CachingOptions
	// WithStartEnd clone the current request with different start and end timestamp.
	WithStartEnd(start time.Time, end time.Time) Request
	// WithQuery clone the current request with a different query.
	WithQuery(string) Request
	// LogToSpan writes information about this request to an OTel span
	LogToSpan(trace.Span)
}

Request represents a query range request that can be process by middlewares.

type Response

type Response interface {
	proto.Message
	// GetHeaders returns the HTTP headers in the response.
	GetHeaders() []*PrometheusResponseHeader

	// WithHeaders return the response with all headers overridden.
	WithHeaders([]PrometheusResponseHeader) Response

	// SetHeader sets one header key-value pair. If the key already exists its value is overridden.
	SetHeader(string, string)
}

Response represents a query range response.

Jump to

Keyboard shortcuts

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