GetObjectLen returns the number of key-value pairs in the addressed JSON object. It scans the object without invoking a callback. SYS-REQ-112
(data []byte, keys ...string)
| 1999 | // object. It scans the object without invoking a callback. |
| 2000 | // SYS-REQ-112 |
| 2001 | func GetObjectLen(data []byte, keys ...string) (int, error) { |
| 2002 | offset, err := containerStart(data, '{', keys...) |
| 2003 | if err != nil { |
| 2004 | return 0, err |
| 2005 | } |
| 2006 | |
| 2007 | return scanContainerLen(data, offset, '{') |
| 2008 | } |
| 2009 | |
| 2010 | // GetUint64 returns the value retrieved by internalGet, cast to a uint64 if |
| 2011 | // possible. Negative values and malformed integers return MalformedValueError; |