path

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2017 License: Apache-2.0 Imports: 12 Imported by: 171

Documentation

Overview

Package path contains types that represent data references.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Linker

type Linker interface {
	// Link returns the link to the pointee of this object at p.
	// If nil, nil is returned then the path cannot be followed.
	Link(ctx context.Context, p Node) (Node, error)
}

Linker is the interface implemented by types that can point to other objects.

type Node

type Node interface {
	// Text returns the string representation of the path.
	// The returned string must be consistent for equal paths.
	Text() string

	// Parent returns the path that this path derives from.
	// If this path is a root, then Base returns nil.
	Parent() Node

	// Path returns this path node as a path.
	Path() *Any

	// Validate checks the path for correctness, returning an error if any
	// issues are found.
	Validate() error
}

Node is the interface for types that represent a reference to a capture, command list, single command, memory, state or sub-object. A path can be passed between client and server using RPCs in order to describe some data in a capture.

func ToList

func ToList(n Node) []Node

ToList unchains the parents of each node, returning them as a list, starting with the root node.

Jump to

Keyboard shortcuts

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