query

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidUID is returned when uid could not be decoded from the query.
	ErrInvalidUID = errors.New("ErrInvalidUID")
	// ErrInvalidName is returned when name could not be decoded from the query.
	ErrInvalidName = errors.New("ErrInvalidName")
	// ErrInvalidGroup is returned when group could not be decoded from the query.
	ErrInvalidGroup = errors.New("ErrInvalidGroup")
	// ErrInvalidVersion is returned when version could not be decoded from query.
	ErrInvalidVersion = errors.New("ErrInvalidVersion")
	// ErrInvalidKind is returned when kind could not be decoded from query.
	ErrInvalidKind = errors.New("ErrInvalidKind")
	// ErrInvalidNamespace is returned when namespace could not be decoded from the query.
	ErrInvalidNamespace = errors.New("ErrInvalidNamespace")
	// ErrInvalidEntity is returned when entity could not be decoded from the query.
	ErrInvalidEntity = errors.New("ErrInvalidEntity")
	// ErrNotImplemented is returned when requesting a feature that has not been implemented yet
	ErrNotImplemented = errors.New("ErrNotImplemented")
)

Functions

This section is empty.

Types

type EntityVal

type EntityVal int

EntityVal is query entity value

const (
	Node EntityVal = iota
	Edge
)

func (EntityVal) String

func (v EntityVal) String() string

type MatchFunc

type MatchFunc func(interface{}) bool

MatchFunc to execute when matching a value.

type Matcher

type Matcher interface {
	// Match given value
	Match(interface{}) bool
	// Predicate returns matcher Predicate
	Predicate() Predicate
}

Matcher returns query matcher

type Predicate

type Predicate interface {
	// Type returns predicate type
	Type() Type
	// Value returns predicate value
	Value() interface{}
	// String implements fmt.Stringer
	String() string
}

Predicate is query predicate

type Query

type Query interface {
	// Add a new predicate with MatchFunc to Query
	Add(Predicate, ...MatchFunc) Query
	// Matcher returns Matcher for given Type
	Matcher(Type) Matcher
	// Reset resets Query
	Reset() Query
	// String implements fmt.Stringer
	String() string
}

Query is an experimental query interface. This is truly a wild experiment, alas it is used for querying space.Plan and space.Top.

type Type added in v0.0.3

type Type int

Type is predicate type

const (
	UID Type = iota
	Name
	Group
	Version
	Kind
	Namespace
	Weight
	Entity
	Attrs
)

func (Type) String added in v0.0.3

func (p Type) String() string

type WildCard added in v0.0.3

type WildCard int

WildCard defines query wildcards

const (
	Any WildCard = iota
)

func (WildCard) String added in v0.0.3

func (v WildCard) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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