Documentation
¶
Index ¶
- func PredicateParser() (*cel.Env, error)
- func ValidateDeclarations(declarations map[string]BindingType) error
- type BindingType
- type BuilderDocument
- type Delivery
- type DocumentFieldPath
- type OrderTerm
- type ParsedPredicate
- type PathSegment
- type Predicate
- type Projection
- type QuerySpec
- type RepresentationSelector
- type Target
- type TextConstraint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PredicateParser ¶ added in v0.32.1
PredicateParser returns the parse-only CEL environment of profile omniview.resource-predicate.v1, with its parser recursion and size limits. Authoring parses drafts with the same environment that admits saved queries, so there is one parser configuration. The environment is immutable and shared.
func ValidateDeclarations ¶ added in v0.32.1
func ValidateDeclarations(declarations map[string]BindingType) error
ValidateDeclarations admits typed parameter declarations without values: a bounded count, identifier-safe unreserved names and well-formed types. A saved query and a draft being authored share these rules, so a name accepted while authoring is a name the query accepts.
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 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.
type PathSegment ¶
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.
type RepresentationSelector ¶
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"`
}