package
1.0.33
Repository: https://github.com/eluv-io/common-go.git
Documentation: pkg.go.dev

# Functions

AsPath returns a new path initialized from path and the given segments and is equivalent to: Path(path).CopyAppend(segments...).
BoolAt returns the bool value at the given path in the given target structure.
CombinePathQuery prefixes the given query with the provided path.
Copy creates a copy of the target data structure.
Delete removes the element of the target data structure at the given path and returns the potentially modified structure and a bool indicating whether the structure was modified.
EscapeSeparators escapes all separators in the given path string, using the given optional path separator and corresponding path encoder (RFC6901).
FilterGlob filters the given target according to the provided "select" and "remove" paths.
Flatten converts the given data structure into a list of flattened paths, their corresponding values and type information.
Float64At returns the float64 value at the given path in the given target structure.
Get returns the element at the given path in the target data structure.
Int64At returns the int64 value at the given path in the given target structure.
MapAt returns the map[string]interface{} value at the given path in the given target structure.
Merge calls MergeWithOptions with default MergeOptions MakeCopy=false.
MergeCopy calls MergeWithOptions with MakeCopy=true.
MergeWithOptions merges the given source data structures into the target structure at the provided path.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewValue creates a new Value wrapper from the given value and error.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
P creates a new path from the given paths or path segments with the default '/' separator.
ParsePath parses the given path string into a Path object, using the given optional path separator and the default path decoder (RFC6901).
ParsePathDec parses the given path string into a Path object, using the given optional path separator and path decoder (may be nil).
ParsePaths parses all paths in the given slice into Path objects, using the given optional path separator and the default path decoder (RFC6901).
PathWith returns a new path initialized from s and the given segments and is equivalent to: NewPath(append([]string{s}, segments...)...).
Query queries the given target data structure.
Replace visits every element in the given target structure and calls the provided replacement function with it.
Resolve resolves a path on the given target structure and returns the corresponding sub-structure.
Set inserts or replaces the element of the target data structure at the given path with the provided data.
Set inserts or replaces the element of the target data structure at the given path with the provided data.
SliceAt returns the []interface{} value at the given path in the given target structure.
StringAt returns the string value at the given path in the given target structure.
StringSliceAt returns the []interface{} value at the given path in the given target structure as a []string.
Unflatten reverses the process of flattening: it turns a flattened structure into generic go maps and slices.
Unwraps any directly nested Value objects and returns the raw data.
Visit visits each element in the target data structure.
Wrap wraps the given data structure as a structured Value object, offering query, manipulation and conversion functions for the data.
WrapJson parses the given JSON document and returns the result as Value.

# Constants

ArrayMergeModes is the enum of ArrayMergeMode.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
MergeOptions are the options available for merge operations.
No description provided by the author
Value is a wrapper around structured data or the result of a structured data operation with convenience functions for querying and manipulating the structured data and accessing it as a specific data type.

# Interfaces

Transformer is an interface for arbitrary transformations of structured data.

# Type aliases

ArrayMergeMode defines a mode for merging arrays.
CopyFn is a custom a function that allows implementing custom copy behavior for specific values by returning true and the custom copy.
No description provided by the author
ReplaceFn is the visitor function called for each element in the target structure.
TransformerFn is a transformation function for data items encountered when resolving a path.
VisitFn is the visitor function.
No description provided by the author