GetValue return the primitive value of the JSON.
()
| 617 | |
| 618 | // GetValue return the primitive value of the JSON. |
| 619 | func (bj BinaryJSON) GetValue() any { |
| 620 | switch bj.TypeCode { |
| 621 | case JSONTypeCodeInt64: |
| 622 | return bj.GetInt64() |
| 623 | case JSONTypeCodeUint64: |
| 624 | return bj.GetUint64() |
| 625 | case JSONTypeCodeDuration: |
| 626 | return bj.GetDuration() |
| 627 | case JSONTypeCodeFloat64: |
| 628 | return bj.GetFloat64() |
| 629 | case JSONTypeCodeString: |
| 630 | return bj.GetString() |
| 631 | case JSONTypeCodeDate, JSONTypeCodeDatetime: |
| 632 | return bj.GetTime() |
| 633 | } |
| 634 | logutil.BgLogger().Error("unreachable JSON type", zap.Any("type", bj.TypeCode)) |
| 635 | return nil |
| 636 | } |
| 637 | |
| 638 | // CreateBinaryJSON creates a BinaryJSON from interface. |
| 639 | func CreateBinaryJSON(in any) BinaryJSON { |
nothing calls this directly
no test coverage detected