(b []byte)
| 1384 | } |
| 1385 | |
| 1386 | func (j jsonObject) encodeInvertedIndexKeys(b []byte) ([][]byte, error) { |
| 1387 | // Checking for an empty object. |
| 1388 | if len(j) == 0 { |
| 1389 | return [][]byte{encoding.EncodeJSONEmptyObject(b)}, nil |
| 1390 | } |
| 1391 | |
| 1392 | var outKeys [][]byte |
| 1393 | for i := range j { |
| 1394 | children, err := j[i].v.encodeInvertedIndexKeys(nil) |
| 1395 | if err != nil { |
| 1396 | return nil, err |
| 1397 | } |
| 1398 | |
| 1399 | // We're trying to see if this is the end of the JSON path. If it is, then we don't want to |
| 1400 | // add an extra separator. |
| 1401 | end := isEnd(j[i].v) |
| 1402 | |
| 1403 | for _, childBytes := range children { |
| 1404 | encodedKey := bytes.Join([][]byte{b, |
| 1405 | encoding.EncodeJSONKeyStringAscending(nil, string(j[i].k), end), |
| 1406 | childBytes}, nil) |
| 1407 | |
| 1408 | outKeys = append(outKeys, encodedKey) |
| 1409 | } |
| 1410 | } |
| 1411 | return outKeys, nil |
| 1412 | } |
| 1413 | |
| 1414 | func (j jsonObject) encodeContainingInvertedIndexSpans( |
| 1415 | b []byte, isRoot, isObjectValue bool, |
nothing calls this directly
no test coverage detected