query

package
v0.24.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckData

type CheckData struct {
	Name   string
	Domain string
	Aff    affine.Affinity
	Prog   []byte // a serialized rt.Execute_Slice
	Value  []byte // a serialized literal.Value
}

type FieldData

type FieldData struct {
	Name     string
	Affinity affine.Affinity
	Class    string
	Init     []byte
}

type NotImplemented

type NotImplemented string

NotImplemented - generic error used returned by QueryNone

func (NotImplemented) Error

func (e NotImplemented) Error() string

type NounInfo

type NounInfo struct {
	Domain, Id, Kind string // id is the string identifier for the noun, unique within the domain.
}

func (*NounInfo) IsValid

func (n *NounInfo) IsValid() bool

func (*NounInfo) String

func (n *NounInfo) String() (ret string)

type Query

type Query interface {
	IsDomainActive(name string) (bool, error)
	ActivateDomains(name string) (prev, next []string, err error)
	ReadChecks(actuallyJustThisOne string) ([]CheckData, error)
	// every field used by the passed kind
	FieldsOf(kind string) ([]FieldData, error)
	// given a plural or singular kind
	// return all ancestors starting with the kind itself
	KindOfAncestors(kind string) ([]string, error)
	NounInfo(name string) (NounInfo, error)
	NounName(id string) (string, error)
	NounNames(id string) ([]string, error)
	// a single field can contain a set of recursive spare values;
	// so this returns pairs of path, value.
	NounValues(id, field string) ([]ValueData, error)
	NounsByKind(kind string) ([]string, error)
	PluralToSingular(plural string) (string, error)
	PluralFromSingular(singular string) (string, error)
	// includes the parameters, followed by the result
	// the result can be a blank string for execute statements
	PatternLabels(pat string) ([]string, error)
	RulesFor(pat string) ([]RuleData, error)
	ReciprocalsOf(rel, id string) ([]string, error)
	RelativesOf(rel, id string) ([]string, error)
	Relate(rel, noun, otherNoun string) error
}

type QueryNone

type QueryNone string

QueryNone - implements Query by returning empty results for all reads, and the NotImplemented error for mutating methods.

func (QueryNone) ActivateDomains

func (q QueryNone) ActivateDomains(name string) (_, _ []string, err error)

func (QueryNone) FieldsOf

func (q QueryNone) FieldsOf(kind string) (_ []FieldData, _ error)

func (QueryNone) IsDomainActive

func (q QueryNone) IsDomainActive(name string) (_ bool, _ error)

func (QueryNone) KindOfAncestors

func (q QueryNone) KindOfAncestors(kind string) (_ []string, _ error)

func (QueryNone) NounInfo

func (q QueryNone) NounInfo(name string) (_ NounInfo, _ error)

func (QueryNone) NounName

func (q QueryNone) NounName(id string) (_ string, _ error)

func (QueryNone) NounNames

func (q QueryNone) NounNames(id string) (_ []string, _ error)

func (QueryNone) NounValues

func (q QueryNone) NounValues(id, field string) (_ []ValueData, _ error)

func (QueryNone) NounsByKind

func (q QueryNone) NounsByKind(kind string) (_ []string, _ error)

func (QueryNone) PatternLabels

func (q QueryNone) PatternLabels(pat string) (_ []string, _ error)

func (QueryNone) PluralFromSingular

func (q QueryNone) PluralFromSingular(singular string) (_ string, _ error)

func (QueryNone) PluralToSingular

func (q QueryNone) PluralToSingular(plural string) (_ string, _ error)

func (QueryNone) ReadChecks

func (q QueryNone) ReadChecks(actuallyJustThisOne string) (_ []CheckData, _ error)

func (QueryNone) ReciprocalsOf

func (q QueryNone) ReciprocalsOf(rel, id string) (_ []string, _ error)

func (QueryNone) Relate

func (q QueryNone) Relate(rel, noun, otherNoun string) error

func (QueryNone) RelativesOf

func (q QueryNone) RelativesOf(rel, id string) (_ []string, _ error)

func (QueryNone) RulesFor

func (q QueryNone) RulesFor(pat string) (_ []RuleData, _ error)

type RuleData

type RuleData struct {
	Name    string
	Stop    bool
	Jump    int
	Updates bool
	Prog    []byte // a serialized rt.Execute_Slice
}

type ValueData

type ValueData struct {
	Field string
	Path  string
	Value []byte // a serialized assignment or literal
}

Jump to

Keyboard shortcuts

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