query

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: AGPL-3.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindingType

type BindingType struct {
	Kind    string       `json:"kind"`
	Element *BindingType `json:"element,omitempty"`
	Value   *BindingType `json:"value,omitempty"`
}

type BuilderDocument

type BuilderDocument struct {
	Version string          `json:"version"`
	Root    json.RawMessage `json:"root"`
}

type Delivery

type Delivery struct {
	Mode         string  `json:"mode"`
	PageSize     uint32  `json:"pageSize"`
	After        *string `json:"after,omitempty"`
	AllowPartial *bool   `json:"allowPartial,omitempty"`
}

type DocumentFieldPath

type DocumentFieldPath []PathSegment

type OrderTerm

type OrderTerm struct {
	Path      DocumentFieldPath `json:"path"`
	Direction string            `json:"direction"`
	Missing   string            `json:"missing"`
	Null      string            `json:"null"`
}

type ParsedPredicate

type ParsedPredicate struct {
	CEL     *cel.Ast
	Builder *BuilderDocument
}

ParsedPredicate contains either CEL's parsed AST or a validated Builder document. Checking and execution are deliberately separate operations.

func Parse

Parse parses a previously admitted predicate without evaluating or type-checking it.

type PathSegment

type PathSegment struct {
	Kind  string  `json:"kind"`
	Name  *string `json:"name,omitempty"`
	Index *uint32 `json:"index,omitempty"`
}

type Predicate

type Predicate struct {
	Language string          `json:"language"`
	Profile  string          `json:"profile,omitempty"`
	Source   string          `json:"source,omitempty"`
	Version  string          `json:"version,omitempty"`
	Document json.RawMessage `json:"document,omitempty"`
}

type Projection

type Projection struct {
	ID   string            `json:"id"`
	Path DocumentFieldPath `json:"path"`
}

type QuerySpec

type QuerySpec struct {
	Version      string                      `json:"version"`
	Targets      []Target                    `json:"targets"`
	Predicate    Predicate                   `json:"predicate"`
	Declarations map[string]BindingType      `json:"declarations"`
	Bindings     map[string]resourcev2.Value `json:"bindings"`
	Text         *TextConstraint             `json:"text,omitempty"`
	Projection   []Projection                `json:"projection"`
	Order        []OrderTerm                 `json:"order"`
	Delivery     Delivery                    `json:"delivery"`
}

QuerySpec is the versioned, provider-neutral public query request.

func Decode

func Decode(data []byte) (QuerySpec, error)

Decode admits one strictly encoded query. Catalog and access admission are separate.

type RepresentationSelector

type RepresentationSelector struct {
	ID       string `json:"id"`
	Revision string `json:"revision"`
}

type Target

type Target struct {
	TargetID       string                 `json:"targetId"`
	Provider       string                 `json:"provider"`
	Authority      string                 `json:"authority"`
	Type           string                 `json:"type"`
	AccessRoute    resourcev2.AccessRoute `json:"accessRoute"`
	Representation RepresentationSelector `json:"representation"`
	Scope          resourcev2.QueryScope  `json:"scope"`
}

type TextConstraint

type TextConstraint struct {
	Term    string              `json:"term"`
	Fields  []DocumentFieldPath `json:"fields"`
	Match   string              `json:"match"`
	Case    string              `json:"case"`
	Combine string              `json:"combine"`
}

Jump to

Keyboard shortcuts

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