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)
| 2131 | // object. It scans the object without invoking a callback. |
| 2132 | // SYS-REQ-112 |
| 2133 | func GetObjectLen(data []byte, keys ...string) (int, error) { |
| 2134 | offset, err := containerStart(data, '{', keys...) |
| 2135 | if err != nil { |
| 2136 | return 0, err |
| 2137 | } |
| 2138 | |
| 2139 | return scanContainerLen(data, offset, '{') |
| 2140 | } |
| 2141 | |
| 2142 | // GetUint64 returns the value retrieved by internalGet, cast to a uint64 if |
| 2143 | // possible. Negative values and malformed integers return MalformedValueError; |