Documentation ¶
Index ¶
- Constants
- Variables
- func GetSubobjectBytes(data []byte, key string) ([]byte, error)
- func IndentBytes(b []byte, prefix, indent string) ([]byte, error)
- func IndentReader(r io.Reader, prefix, indent string) ([]byte, error)
- func JSONParserGetArrayIntOneOnly(data []byte, key string) (int, error)
- func JSONParserGetArrayString(data []byte, key string) ([]string, error)
- func JSONParserGetArrayStringOneOnly(data []byte, key string) (string, error)
- func MarshalBase64(i any) (string, error)
- func MarshalSimple(v any, prefix, indent string) ([]byte, error)
- func MustGetSubobjectBytes(data []byte, key string) []byte
- func MustMarshal(i any, embedError bool) []byte
- func MustMarshalIndent(i any, prefix, indent string, embedError bool) []byte
- func MustMarshalSimple(v any, prefix, indent string) []byte
- func MustMarshalString(i any, embedError bool) string
- func MustUnmarshal(data []byte, v any)
- func PrintReaderIndent(r io.Reader, prefix, indent string) ([]byte, error)
- func ReadFile(filename string, v any) ([]byte, error)
- func UnmarshalMSI(data map[string]any, v any) error
- func UnmarshalReader(r io.Reader, v any) ([]byte, error)
- func UnmarshalStrict(data []byte, v any) error
- func WriteFile(filename string, v any, prefix, indent string, perm fs.FileMode) error
- type Bool
- type Int64
- type String
Constants ¶
View Source
const FileExt = ".json"
Variables ¶
View Source
var ( MarshalPrefix = "" MarshalIndent = " " )
Functions ¶
func IndentBytes ¶ added in v0.41.5
IndentBytes converts a JSON byte array into a prettified byte array.
func IndentReader ¶ added in v0.41.6
IndentReader returns a byte slice of indented JSON given an `io.Reader`. It is useful to use with `http.Response.Body` which is an `io.ReadCloser`.
func JSONParserGetArrayIntOneOnly ¶ added in v0.37.0
func JSONParserGetArrayString ¶ added in v0.37.0
func JSONParserGetArrayStringOneOnly ¶ added in v0.37.0
func MarshalBase64 ¶
func MustGetSubobjectBytes ¶
func MustMarshal ¶
func MustMarshalIndent ¶
func MustMarshalSimple ¶
func MustMarshalString ¶
func MustUnmarshal ¶ added in v0.37.5
func PrintReaderIndent ¶ added in v0.41.5
PrintReaderIndent returns an indented JSON byte array given an `io.Reader`.
func UnmarshalStrict ¶ added in v0.39.4
Types ¶
type Bool ¶
type Bool bool
Bool implements a tolerant reader for `bool` type.
func (*Bool) UnmarshalJSON ¶
type Int64 ¶
type Int64 int64
Int64 implements a tolerant reader for `int64` type.
func (*Int64) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.