path

package
v0.0.0-...-6dfdce2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPath = errors.New("invalid path")

Functions

func Visit

func Visit[T any](v Visitor[T], x Expr) (T, error)

Types

type Expr

type Expr struct {
	Kind     Kind
	Value    string
	Children []Expr
}

Expr is the result of parsing a path expression.

type Kind

type Kind byte

Kind is the kind of the path node.

const (
	// Invalid - Not a valid AST.
	Invalid Kind = iota

	// String value.
	String

	// Integer value.
	Integer

	// Rel name.
	Rel

	// Op - name of an operation (join, inverse, intersection etc).
	Op
)

type Visitor

type Visitor[T any] interface {
	String(x string) (T, error)
	Integer(x int) (T, error)
	Rel(name string) (T, error)
	Op(name string, args []T) (T, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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