labels

package
v0.0.0-...-7f3ab3a Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpNone = PredicateOp("NONE")
	OpAny  = PredicateOp("ANY")

	OpEq = PredicateOp("=")
	OpLt = PredicateOp("<")
	OpGt = PredicateOp(">")

	OpContains = PredicateOp("CONTAINS")
	OpRegexp   = PredicateOp("REGEXP")

	OpIn = PredicateOp("IN")

	OpOR  = PredicateOp("OR")
	OpAND = PredicateOp("AND")
)

Variables

View Source
var ErrStopIter = fmt.Errorf("stop iteration")

Functions

This section is empty.

Types

type ID

type ID = hcorpus.ID

type IterFunc

type IterFunc = func(id ID, key, value []byte) error

type Pair

type Pair struct {
	Key   string
	Value []byte
}

func (Pair) String

func (t Pair) String() string

func (Pair) VInt64

func (t Pair) VInt64() (int64, error)

func (Pair) VTime

func (t Pair) VTime() (time.Time, error)

type PairSet

type PairSet map[string][]byte

func (PairSet) Slice

func (ts PairSet) Slice() (ret []Pair)

type Predicate

type Predicate struct {
	Op PredicateOp `json:"op"`

	Key string `json:"key"`

	Value      string   `json:"value,omitempty"`
	Values     []string `json:"values,omitempty"`
	SubQueries []Query  `json:"sub_queries,omitempty"`

	Limit int `json:"limit"`
}

type PredicateOp

type PredicateOp string

type Query

type Query struct {
	Where Predicate `json:"where"`
	Limit int       `json:"limit"`
}

type QueryBackend

type QueryBackend interface {
	ScanForward(ctx context.Context, span Span, fn IterFunc) error
	ScanInverted(ctx context.Context, tagKey string, fn IterFunc) error
	GetValue(ctx context.Context, id ID, tagKey string) ([]byte, error)
}

type ResultSet

type ResultSet struct {
	IDs                  []ID
	Offset, Count, Total int
}

func DoQuery

func DoQuery(ctx context.Context, be QueryBackend, q Query) (*ResultSet, error)

type Span

type Span = state.ByteSpan

Jump to

Keyboard shortcuts

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