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

queryapi

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEndBeforeStart = httpgrpc.Errorf(http.StatusBadRequest, "%s", "end timestamp must not be before start time")
	ErrNegativeStep   = httpgrpc.Errorf(http.StatusBadRequest, "%s", "zero or negative query resolution step widths are not accepted. Try a positive integer")
	ErrStepTooSmall   = httpgrpc.Errorf(http.StatusBadRequest, "%s", "exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)")
)

Functions

func DecorateWithParamName

func DecorateWithParamName(err error, field string) error

Types

type CompressionHandler

type CompressionHandler struct {
	Handler http.Handler
}

CompressionHandler is a wrapper around http.Handler which adds suitable response compression based on the client's Accept-Encoding headers.

func (CompressionHandler) ServeHTTP

func (c CompressionHandler) ServeHTTP(writer http.ResponseWriter, req *http.Request)

ServeHTTP adds compression to the original http.Handler's ServeHTTP() method.

type QueryAPI

type QueryAPI struct {
	CORSOrigin *regexp.Regexp
	// contains filtered or unexported fields
}

func NewQueryAPI

func NewQueryAPI(
	qe engine.QueryEngine,
	q storage.SampleAndChunkQueryable,
	statsRenderer v1.StatsRenderer,
	logger log.Logger,
	codecs []v1.Codec,
	CORSOrigin *regexp.Regexp,
) *QueryAPI

func (*QueryAPI) InstantQueryHandler

func (q *QueryAPI) InstantQueryHandler(r *http.Request) (result apiFuncResult)

func (*QueryAPI) RangeQueryHandler

func (q *QueryAPI) RangeQueryHandler(r *http.Request) (result apiFuncResult)

func (*QueryAPI) Wrap

func (q *QueryAPI) Wrap(f apiFunc) http.HandlerFunc

Jump to

Keyboard shortcuts

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