Documentation ¶
Index ¶
- func A1ColumnDecode(column string) (int, error)
- func A1ColumnEncode(index int) (string, error)
- func GetItem[T any](obj any, keys string, sep string) (T, error)
- func GetItem2[T any](obj any, keys string, sep string) (out T, err error)
- func GetItems(obj any, keys string, opts ...Option) []any
- func Ternary[T any](b bool, vt T, vf T) T
- func To[T any](obj any) (out T, err error)
- func ToForce[T any](obj any) (out T)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func A1ColumnDecode ¶ added in v1.5.0
A1ColumnDecode takes in A1 Notation & converts it to an index value
Column A is index 1, limit by int (more than ZZZ) ¶
E.g. C == 3, AC == 29, ABC == 731
https://stackoverflow.com/questions/70806630/convert-index-to-column-a1-notation-and-vice-versa
func A1ColumnEncode ¶ added in v1.5.0
A1ColumnEncode takes in an index value & converts it to A1 Notation
Index 1 is Column A, limit to ZZZ ¶
E.g. 3 == C, 29 == AC, 731 == ABC
func GetItem ¶
GetItem return generic type of specified keys. Allow only map[string]any/[]any parent. Faster but not flexible as GetItem2
func GetItems ¶ added in v1.4.0
GetItems return generic type of specified keys.
. for key separator
#k for key listing
#v or # for value listing
^ prefix for regular expression matching, use DotAlternative for dot.
Example: "path1.path2.items.#.^value_" to access keys, path1 > path2 > items (array) > each item > ^value_ = value of key that starts with "value_"
Example2: "path1.path2.#k" to access keys, path1 > path2 > list keys in part2 object.