query

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Query

type Query struct {
	Kind    base.Kind    `json:"kind,omitempty"`
	Context QueryContext `json:"context,omitempty"`
	Fetch   QueryFetch   `json:"fetch,omitempty"`
	Spec    Spec         `json:"spec,omitempty"`
}

type QueryContext

type QueryContext map[string]any

type QueryFetch

type QueryFetch string
const (
	QueryFetchLinks QueryFetch = "links"
	QueryFetchItems QueryFetch = "items"
)

type QueryResult

type QueryResult[T any] struct {
	Kind     QueryResultKind `json:"kind,omitempty"`
	ItemKind base.Kind       `json:"itemKind,omitempty"`
	Items    []T             `json:"items,omitempty"`
	Links    []base.Link     `json:"links,omitempty"`
	Query    Query           `json:"query,omitempty"`
}

type QueryResultKind

type QueryResultKind string
const (
	QueryResultKindQueryresult QueryResultKind = "queryresult"
)

type Spec

type Spec struct {
	Match SpecMatch `json:"match,omitempty"`
	Terms []Term    `json:"terms,omitempty"`
}

type SpecMatch

type SpecMatch string
const (
	SpecMatchAll  SpecMatch = "all"
	SpecMatchAny  SpecMatch = "any"
	SpecMatchNone SpecMatch = "none"
)

type Term

type Term struct {
	Op       TermOp `json:"op,omitempty"`
	Property string `json:"property,omitempty"`
	Rel      string `json:"rel,omitempty"`
	Tag      string `json:"tag,omitempty"`
	Value    any    `json:"value,omitempty"`
}

type TermOp

type TermOp string
const (
	TermOpEqual            TermOp = "="
	TermOpGreaterThan      TermOp = ">"
	TermOpGreaterThanEqual TermOp = ">="
	TermOpLessThan         TermOp = "<"
	TermOpLessThanEqual    TermOp = "<="
	TermOpNotEqual         TermOp = "!="
	TermOpRegex            TermOp = "~"
	TermOpExists           TermOp = "exists"
	TermOpNotExists        TermOp = "!exists"
)

Jump to

Keyboard shortcuts

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