json

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NamingStrategyTranslate = LowercaseNamingStrategy
)

Functions

func CustomSWriteJson

func CustomSWriteJson(c jsoniter.API, body any) (string, error)

Write json as string using customized jsoniter.Config.

func DecodeJson

func DecodeJson(reader io.Reader, ptr any) error

Decode json.

func EncodeJson

func EncodeJson(writer io.Writer, body any) error

Encode json.

func Indent added in v0.1.19

func Indent(b []byte) string

func IsValidJson added in v0.1.13

func IsValidJson(s []byte) bool

func IsValidJsonStr added in v0.1.13

func IsValidJsonStr(s string) bool

func LowercaseNamingStrategy

func LowercaseNamingStrategy(name string) string

Change first rune to lower case.

func ParseJson

func ParseJson(body []byte, ptr any) error

Parse json bytes.

func SIndent added in v0.1.19

func SIndent(b string) string

func SParseJson

func SParseJson(body string, ptr any) error

Parse json string.

func SWriteIndent added in v0.1.12

func SWriteIndent(body any) (string, error)

func SWriteJson

func SWriteJson(body any) (string, error)

Write json as string.

func WriteJson

func WriteJson(body any) ([]byte, error)

Write json as bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL