GetObjectLen returns the number of key-value pairs in the addressed JSON object. It scans the object without invoking a callback. SYS-REQ-112
(data []byte, keys ...string)
| 2091 | // object. It scans the object without invoking a callback. |
| 2092 | // SYS-REQ-112 |
| 2093 | func GetObjectLen(data []byte, keys ...string) (int, error) { |
| 2094 | offset, err := containerStart(data, '{', keys...) |
| 2095 | if err != nil { |
| 2096 | return 0, err |
| 2097 | } |
| 2098 | |
| 2099 | return scanContainerLen(data, offset, '{') |
| 2100 | } |
| 2101 | |
| 2102 | // GetUint64 returns the value retrieved by internalGet, cast to a uint64 if |
| 2103 | // possible. Negative values and malformed integers return MalformedValueError; |