dot

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cursor

type Cursor interface {
	CurrentValue() rt.Value
	SetAtIndex(int, rt.Value) error
	GetAtIndex(int) (Cursor, error)
	SetAtField(string, rt.Value) error
	GetAtField(string) (Cursor, error)
}

Cursor - generic access to objects, lists, and records.

func MakeObjectCursor

func MakeObjectCursor(run rt.Runtime, name string) Cursor

supports requesting fields from the runtime where the top level is the id of the object or meta.Variables

func MakeValueCursor

func MakeValueCursor(run rt.Runtime, val rt.Value) Cursor

supports requesting fields from a record uses the runtime to create sub-records when needed.

type Dotted

type Dotted interface {
	Peek(Cursor) (Cursor, error)
	Poke(Cursor, rt.Value) error
	// contains filtered or unexported methods
}

Dotted - path operations to access the contents of certain targets.

type Endpoint

type Endpoint struct {
	// contains filtered or unexported fields
}

the final position in a path where we might want to get or put a value. returned by FindEndpoint()

func FindEndpoint

func FindEndpoint(run rt.Runtime, name string, path Path) (ret Endpoint, err error)

expects there's at least one path element

func (Endpoint) GetValue

func (last Endpoint) GetValue() (ret rt.Value, err error)

func (Endpoint) SetValue

func (last Endpoint) SetValue(newValue rt.Value) (err error)

this walks up the tree to write back the final value.

type Field

type Field string

field name to pick a value from a record.

func (Field) Field

func (dot Field) Field() string

raw string

func (Field) Peek

func (dot Field) Peek(c Cursor) (Cursor, error)

func (Field) Poke

func (dot Field) Poke(c Cursor, newValue rt.Value) (err error)

type Index

type Index int

zero-based index to pick a value from a list.

func (Index) Index

func (dot Index) Index() int

raw int

func (Index) Peek

func (dot Index) Peek(c Cursor) (Cursor, error)

func (Index) Poke

func (dot Index) Poke(c Cursor, newValue rt.Value) error

type Path

type Path []Dotted

contains Index and Fields

func (Path) String

func (dl Path) String() string

Jump to

Keyboard shortcuts

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