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)
| 2079 | // It scans the array without invoking a callback. |
| 2080 | // SYS-REQ-112 |
| 2081 | func GetArrayLen(data []byte, keys ...string) (int, error) { |
| 2082 | offset, err := containerStart(data, '[', keys...) |
| 2083 | if err != nil { |
| 2084 | return 0, err |
| 2085 | } |
| 2086 | |
| 2087 | return scanContainerLen(data, offset, '[') |
| 2088 | } |
| 2089 | |
| 2090 | // GetObjectLen returns the number of key-value pairs in the addressed JSON |
| 2091 | // object. It scans the object without invoking a callback. |