query

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 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 struct {
	Kind     QueryResultKind `json:"kind,omitempty"`
	ItemKind base.Kind       `json:"itemKind,omitempty"`
	Items    []any           `json:"items"`
	Links    []base.Link     `json:"links"`
	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"`
	Sort  *SpecSort `json:"sort,omitempty"`
}

type SpecMatch

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

type SpecSort added in v1.0.0

type SpecSort struct {
	By    string        `json:"by"`
	Order SpecSortOrder `json:"order,omitempty"`
}

type SpecSortOrder added in v1.0.0

type SpecSortOrder string
const (
	SpecSortOrderAsc  SpecSortOrder = "asc"
	SpecSortOrderDesc SpecSortOrder = "desc"
)

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 (
	TermOpEq        TermOp = "="
	TermOpGt        TermOp = ">"
	TermOpGte       TermOp = ">="
	TermOpLt        TermOp = "<"
	TermOpLte       TermOp = "<="
	TermOpNe        TermOp = "!="
	TermOpMatch     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