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)
| 1987 | // It scans the array without invoking a callback. |
| 1988 | // SYS-REQ-112 |
| 1989 | func GetArrayLen(data []byte, keys ...string) (int, error) { |
| 1990 | offset, err := containerStart(data, '[', keys...) |
| 1991 | if err != nil { |
| 1992 | return 0, err |
| 1993 | } |
| 1994 | |
| 1995 | return scanContainerLen(data, offset, '[') |
| 1996 | } |
| 1997 | |
| 1998 | // GetObjectLen returns the number of key-value pairs in the addressed JSON |
| 1999 | // object. It scans the object without invoking a callback. |