batchquery

package
v1.43.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const MsgInputsKeyMissing = "'inputs' key missing from the request"
View Source
const (
	PrometheusHandle = "v1/batch/data"
)

Variables

This section is empty.

Functions

func Pack2

func Pack2[K any, V any](seq iter.Seq2[K, V], sliceSizes []int) iter.Seq2[[]K, []V]

Pack2 takes an iter.Seq2[K, V] and converts it into an equivalent iter.Seq2[[]K, []V], where the size of each k/v slice pair is determined by sliceSizes. This is meant to be paired with the chunks function, to generate a good list of integer slice sizes for the input.

Types

type BatchDataRequestV1

type BatchDataRequestV1 struct {
	Inputs      map[string]*any `json:"inputs"`
	CommonInput *any            `json:"common_input,omitempty"`
}

BatchDataRequestV1 models the request message for batched Data API POST operations. CommonInput is intended as an optional field, which is merged with each query's input object before evaluation.

type BatchDataRequestV1Unparsed

type BatchDataRequestV1Unparsed struct {
	Inputs      map[string]*json.RawMessage `json:"inputs"` // Parsing of the inputs is deferred.
	CommonInput *any                        `json:"common_input,omitempty"`
}

type BatchDataRespType

type BatchDataRespType interface {
	GetHTTPStatusCode() string
}

Note(philip): This is a bit of a hack to ensure we only get the 2x intended types embedded in the BatchDataResponse struct.

type BatchDataResponseV1

type BatchDataResponseV1 struct {
	Metrics         types.MetricsV1              `json:"metrics,omitempty"`
	Responses       map[string]BatchDataRespType `json:"responses,omitempty"`
	Warning         *types.Warning               `json:"warning,omitempty"`
	BatchDecisionID string                       `json:"batch_decision_id,omitempty"`
}

BatchDataResponseV1 models the response message for batched Data API read operations.

func (*BatchDataResponseV1) UnmarshalJSON

func (bdr *BatchDataResponseV1) UnmarshalJSON(b []byte) error

Note(philip): We have to do custom JSON unmarshalling here to work around the fact that our response representation is not perfect.

type BatchQueryHandler

type BatchQueryHandler interface {
	http.Handler
	GetManager() *plugins.Manager
	SetManager(*plugins.Manager) error
	WithLicensedMode(bool) BatchQueryHandler
	WithDecisionIDFactory(func() string) BatchQueryHandler
	WithDecisionLogger(logger func(context.Context, *server.Info) error) BatchQueryHandler
}

func Handler

func Handler(l logging.Logger) BatchQueryHandler

type DataResponseWithHTTPCodeV1

type DataResponseWithHTTPCodeV1 struct {
	types.DataResponseV1
	HTTPStatusCode string `json:"http_status_code,omitempty"`
}

DataResponseWithCodeV1 models the response message for Data API read operations.

func (DataResponseWithHTTPCodeV1) GetHTTPStatusCode

func (r DataResponseWithHTTPCodeV1) GetHTTPStatusCode() string

type ErrorResponseWithHTTPCodeV1

type ErrorResponseWithHTTPCodeV1 struct {
	DecisionID     string `json:"decision_id,omitempty"`
	HTTPStatusCode string `json:"http_status_code,omitempty"`
	types.ErrorV1
}

func (ErrorResponseWithHTTPCodeV1) GetHTTPStatusCode

func (r ErrorResponseWithHTTPCodeV1) GetHTTPStatusCode() string

Jump to

Keyboard shortcuts

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