Documentation
¶
Index ¶
- Variables
- func IsArray(d []byte) bool
- func IsBool(d []byte) bool
- func IsEmptyArray(d []byte) bool
- func IsEmptyObject(d []byte) bool
- func IsFalse(d []byte) bool
- func IsNull(d []byte) bool
- func IsNumber(data []byte) bool
- func IsObject(d []byte) bool
- func IsString(d []byte) bool
- func IsTrue(d []byte) bool
- func Marshal(v interface{}) ([]byte, error)
- func NewDecoder(r io.Reader) *json.Decoder
- func NewEncoder(w io.Writer) *json.Encoder
- func Unmarshal(data []byte, v any) error
- type Number
- type Object
- type RawMessage
- func (d RawMessage) ContainsEscapeRune() bool
- func (d RawMessage) Equal(data []byte) bool
- func (d RawMessage) IsArray() bool
- func (d RawMessage) IsBool() bool
- func (d RawMessage) IsEmptyArray() bool
- func (d RawMessage) IsEmptyObject() bool
- func (d RawMessage) IsFalse() bool
- func (d RawMessage) IsNull() bool
- func (d RawMessage) IsNumber() bool
- func (d RawMessage) IsObject() bool
- func (d RawMessage) IsString() bool
- func (d RawMessage) IsTrue() bool
- func (d RawMessage) Len() int
- func (d RawMessage) MarshalJSON() ([]byte, error)
- func (d *RawMessage) UnmarshalJSON(data []byte) error
- type Type
Constants ¶
This section is empty.
Variables ¶
var ( Null = RawMessage("null") True = RawMessage("true") False = RawMessage("false") )
Functions ¶
func IsEmptyArray ¶
func IsEmptyObject ¶
func IsFalse ¶
IsFalse reports true if data appears to be a json boolean value of false. It is possible that it will report false positives of malformed json as it only checks the first character and length.
IsFalse does not parse strings
func IsNumber ¶
IsValid reports whether s is a valid JSON number literal.
Taken from encoding/json/scanner.go
Types ¶
type Object ¶
type Object map[string]RawMessage
func (Object) MarshalJSON ¶
func (*Object) UnmarshalJSON ¶
type RawMessage ¶
type RawMessage []byte
func (RawMessage) ContainsEscapeRune ¶
func (d RawMessage) ContainsEscapeRune() bool
ContainsEscapeRune reports whether the string value of d contains "\" It returns false if d is not a quoted string.
func (RawMessage) Equal ¶
func (d RawMessage) Equal(data []byte) bool
func (RawMessage) IsArray ¶
func (d RawMessage) IsArray() bool
IsArray reports whether the data is a json array. It does not check whether the json is malformed.
func (RawMessage) IsBool ¶
func (d RawMessage) IsBool() bool
IsBool reports true if data appears to be a json boolean value. It is possible that it will report false positives of malformed json.
IsBool does not parse strings
func (RawMessage) IsEmptyArray ¶
func (d RawMessage) IsEmptyArray() bool
func (RawMessage) IsEmptyObject ¶
func (d RawMessage) IsEmptyObject() bool
func (RawMessage) IsFalse ¶
func (d RawMessage) IsFalse() bool
IsFalse reports true if data appears to be a json boolean value of false. It is possible that it will report false positives of malformed json as it only checks the first character and length.
IsFalse does not parse strings
func (RawMessage) IsNull ¶
func (d RawMessage) IsNull() bool
func (RawMessage) IsNumber ¶
func (d RawMessage) IsNumber() bool
func (RawMessage) IsObject ¶
func (d RawMessage) IsObject() bool
func (RawMessage) IsString ¶
func (d RawMessage) IsString() bool
func (RawMessage) IsTrue ¶
func (d RawMessage) IsTrue() bool
IsTrue reports true if data appears to be a json boolean value of true. It is possible that it will report false positives of malformed json as it only checks the first character and length.
IsTrue does not parse strings
func (RawMessage) Len ¶
func (d RawMessage) Len() int
func (RawMessage) MarshalJSON ¶
func (d RawMessage) MarshalJSON() ([]byte, error)
func (*RawMessage) UnmarshalJSON ¶
func (d *RawMessage) UnmarshalJSON(data []byte) error