Documentation
¶
Index ¶
- func Delete(object interface{}, path string) error
- func Get(object interface{}, path string) (interface{}, error)
- func Set(object interface{}, path string, value interface{}) error
- type Deleter
- type Getter
- type Path
- func (path Path) Delete(object interface{}) error
- func (path Path) Get(object interface{}) (interface{}, error)
- func (path Path) HasTail() bool
- func (path Path) Head() string
- func (path Path) Index(maximum int) (int, error)
- func (path Path) IsEmpty() bool
- func (path Path) IsTailEmpty() bool
- func (path Path) Push(value string) Path
- func (path Path) Set(object interface{}, value interface{}) error
- func (path Path) Split() (string, Path)
- func (path Path) String() string
- func (path Path) Tail() Path
- type Setter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deleter ¶ added in v0.3.0
Deleter interface allows other objects to make it easy to trace through their property trees, and delete values from them.
type Getter ¶
Getter interface allows other objects to make it easy to trace through their property trees, and get values from them.
type Path ¶
type Path []string
Path is a reference to a value within another data object.
func (Path) HasTail ¶ added in v0.1.2
HasTail returns TRUE if this path has one or more items in its tail.
func (Path) Index ¶
Index is useful for vetting array indices. It attempts to convert the Head() token int an integer, and then check that the integer is within the designated array bounds (is greater than zero, and less than the maximum value provided to the function).
It returns the array index and an error
func (Path) IsTailEmpty ¶ added in v0.1.3
IsTailEmpty returns TRUE if this path has one or more items in its tail.
func (Path) Push ¶ added in v0.2.0
Push returns a new path with a new value appended to the beginning of the path.
func (Path) Split ¶ added in v0.3.0
Split returns two values, the Head and the Tail of the current path