Documentation
¶
Overview ¶
JSON processing.
Index ¶
- Variables
- func ConvertAnySlice[T any](v []any) ([]T, error)
- func ConvertAnySliceWithStr[T any](v []any) ([]pair.Pair[string, T], error)
- func CustomSWriteJson(c jsoniter.API, body any) (string, error)
- func DecodeJson(reader io.Reader, ptr any) error
- func EncodeJson(writer io.Writer, body any) error
- func EscapeString(s string) string
- func Indent(b []byte) string
- func IsValidJson(s []byte) bool
- func IsValidJsonStr(s string) bool
- func LowercaseNamingStrategy(name string) string
- func Marshal(body any) ([]byte, error)
- func ParseJson(body []byte, ptr any) error
- func ParseJsonAs[T any](body []byte) (T, error)
- func SIndent(b string) string
- func SParseJson(body string, ptr any) error
- func SParseJsonAs[T any](body string) (T, error)
- func SWriteIndent(body any) (string, error)
- func SWriteJson(body any) (string, error)
- func TrySWriteIndent(body any) string
- func TrySWriteJson(body any) string
- func Unmarshal(body []byte, ptr any) error
- func WriteJson(body any) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NamingStrategyTranslate = func(v string) string { return v }
)
Functions ¶
func ConvertAnySlice ¶ added in v0.4.13
Convert []any to []T through json serialization/deserialization.
func ConvertAnySliceWithStr ¶ added in v0.4.13
Convert []any to []T through json serialization/deserialization.
func CustomSWriteJson ¶
Write json as string using customized jsoniter.Config.
func EscapeString ¶
func IsValidJson ¶
func IsValidJsonStr ¶
func LowercaseNamingStrategy ¶
Change first rune to lower case.
func SWriteIndent ¶
func TrySWriteIndent ¶ added in v0.4.12
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.