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)
| 2072 | // object. It scans the object without invoking a callback. |
| 2073 | // SYS-REQ-112 |
| 2074 | func GetObjectLen(data []byte, keys ...string) (int, error) { |
| 2075 | offset, err := containerStart(data, '{', keys...) |
| 2076 | if err != nil { |
| 2077 | return 0, err |
| 2078 | } |
| 2079 | |
| 2080 | return scanContainerLen(data, offset, '{') |
| 2081 | } |
| 2082 | |
| 2083 | // GetUint64 returns the value retrieved by internalGet, cast to a uint64 if |
| 2084 | // possible. Negative values and malformed integers return MalformedValueError; |