definitions

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: AGPL-3.0 Imports: 11 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 struct {
	Disabled bool `protobuf:"varint,1,opt,name=disabled,proto3" json:"disabled,omitempty"`
}

Defined here to prevent circular imports between logproto & queryrangebase

func (*CachingOptions) Descriptor

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

func (*CachingOptions) Equal

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

func (*CachingOptions) GetDisabled

func (m *CachingOptions) GetDisabled() bool

func (*CachingOptions) GoString

func (this *CachingOptions) GoString() string

func (*CachingOptions) Marshal

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

func (*CachingOptions) MarshalTo

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

func (*CachingOptions) MarshalToSizedBuffer

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

func (*CachingOptions) ProtoMessage

func (*CachingOptions) ProtoMessage()

func (*CachingOptions) Reset

func (m *CachingOptions) Reset()

func (*CachingOptions) Size

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

func (*CachingOptions) String

func (this *CachingOptions) String() string

func (*CachingOptions) Unmarshal

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

func (*CachingOptions) XXX_DiscardUnknown

func (m *CachingOptions) XXX_DiscardUnknown()

func (*CachingOptions) XXX_Marshal

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

func (*CachingOptions) XXX_Merge

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

func (*CachingOptions) XXX_Size

func (m *CachingOptions) XXX_Size() int

func (*CachingOptions) XXX_Unmarshal

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

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, 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 {
	// GetStart returns the start timestamp of the request in milliseconds.
	GetStart() int64
	// GetEnd returns the end timestamp of the request in milliseconds.
	GetEnd() int64
	// 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(startTime int64, endTime int64) Request
	// WithQuery clone the current request with a different query.
	WithQuery(string) Request
	proto.Message
	// LogToSpan writes information about this request to an OpenTracing span
	LogToSpan(opentracing.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
}

Response represents a query range response.

Jump to

Keyboard shortcuts

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