Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONMarshaler ¶ added in v0.19.0
type JSONMarshaler interface {
JSON() []byte
}
JSONMarshaler is an interface that types can implement to provide a JSON representation of themselves.
type Raw ¶
type Raw []byte
Raw is a type based on []byte with custom UnmarshalJSON and MarshalJSON methods to handle double escaped JSON and raw data.
func (Raw) MarshalJSON ¶
MarshalJSON satisfies json.Marshaler. If valid JSON is provided it will be escaped and returned as a JSON string, otherwise return the data as is.
func (*Raw) UnmarshalJSON ¶
UnmarshalJSON satisfies json.Unmarshaler. It unquotes escaped JSON if it's escaped, otherwise sets the data as is.
Click to show internal directories.
Click to hide internal directories.