getJSONInvertedIndexKeyLength returns the length of encoded JSON inverted index key at the start of b.
(buf []byte)
| 2558 | // getJSONInvertedIndexKeyLength returns the length of encoded JSON inverted index |
| 2559 | // key at the start of b. |
| 2560 | func getJSONInvertedIndexKeyLength(buf []byte) (int, error) { |
| 2561 | len, err := getInvertedIndexKeyLength(buf) |
| 2562 | if err != nil { |
| 2563 | return 0, err |
| 2564 | } |
| 2565 | |
| 2566 | switch buf[len] { |
| 2567 | case jsonEmptyArray, jsonEmptyObject: |
| 2568 | return len + 1, nil |
| 2569 | |
| 2570 | default: |
| 2571 | valLen, err := PeekLength(buf[len:]) |
| 2572 | if err != nil { |
| 2573 | return 0, err |
| 2574 | } |
| 2575 | |
| 2576 | return len + valLen, nil |
| 2577 | } |
| 2578 | } |
no test coverage detected
searching dependent graphs…