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)
| 2060 | // It scans the array without invoking a callback. |
| 2061 | // SYS-REQ-112 |
| 2062 | func GetArrayLen(data []byte, keys ...string) (int, error) { |
| 2063 | offset, err := containerStart(data, '[', keys...) |
| 2064 | if err != nil { |
| 2065 | return 0, err |
| 2066 | } |
| 2067 | |
| 2068 | return scanContainerLen(data, offset, '[') |
| 2069 | } |
| 2070 | |
| 2071 | // GetObjectLen returns the number of key-value pairs in the addressed JSON |
| 2072 | // object. It scans the object without invoking a callback. |