GetArrayLen returns the number of elements in the addressed JSON array. It scans the array without invoking a callback. SYS-REQ-112
(data []byte, keys ...string)
| 2173 | // It scans the array without invoking a callback. |
| 2174 | // SYS-REQ-112 |
| 2175 | func GetArrayLen(data []byte, keys ...string) (int, error) { |
| 2176 | offset, err := containerStart(data, '[', keys...) |
| 2177 | if err != nil { |
| 2178 | return 0, err |
| 2179 | } |
| 2180 | |
| 2181 | return scanContainerLen(data, offset, '[') |
| 2182 | } |
| 2183 | |
| 2184 | // GetObjectLen returns the number of key-value pairs in the addressed JSON |
| 2185 | // object. It scans the object without invoking a callback. |