Documentation ¶
Index ¶
- func Alter(ctx context.Context, v interface{}, path []string, new interface{}) (interface{}, error)
- func Merge(ctx context.Context, v interface{}, path []string, new interface{}) (interface{}, error)
- func SplitPath(path string) ([]string, error)
- func StrToInterface(s string) interface{}
- func Sum(ctx context.Context, v interface{}, path []string, new interface{}) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alter ¶
Alter a data structure. Requires a path (pre-split) and new structure as a JSON string. A more seasoned developer will see plenty of room for optimisation however this function was largely thrown together in a "let's create something that works first and worry about performance later" kind of sense (much like a lot of murex's code base). That being said, I will accept any pull requests from other developers wishing to improve this - or other - functions. I'm also open to any breaking changes those optimisations might bring (at least until the project reaches version 1.0).
func SplitPath ¶
SplitPath takes a string with a prefixed delimiter and separates it into a slice of path elements
func StrToInterface ¶
func StrToInterface(s string) interface{}
Types ¶
This section is empty.