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)
| 2119 | // It scans the array without invoking a callback. |
| 2120 | // SYS-REQ-112 |
| 2121 | func GetArrayLen(data []byte, keys ...string) (int, error) { |
| 2122 | offset, err := containerStart(data, '[', keys...) |
| 2123 | if err != nil { |
| 2124 | return 0, err |
| 2125 | } |
| 2126 | |
| 2127 | return scanContainerLen(data, offset, '[') |
| 2128 | } |
| 2129 | |
| 2130 | // GetObjectLen returns the number of key-value pairs in the addressed JSON |
| 2131 | // object. It scans the object without invoking a callback. |