tjson

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidKeyErr = errors.New("invalid key")
View Source
var InvalidSliceIndexErr = errors.New("invalid slice index")
View Source
var KeyNotFoundErr = errors.New("not found key")

Functions

func GetBool

func GetBool(content []byte, key string) (bool, error)

func GetBoolSlice

func GetBoolSlice(content []byte, key string) ([]bool, error)

func GetBoolWithDefault

func GetBoolWithDefault(content []byte, key string, defaultVal bool) bool

func GetEverySlice

func GetEverySlice(content []byte, key string) (interface{}, error)

func GetFloat

func GetFloat(content []byte, key string) (float64, error)

func GetFloatSlice

func GetFloatSlice(content []byte, key string) ([]float64, error)

func GetFloatWithDefault

func GetFloatWithDefault(content []byte, key string, defaultVal float64) float64

func GetInt

func GetInt(content []byte, key string) (int, error)

func GetIntSlice

func GetIntSlice(content []byte, key string) ([]int, error)

func GetIntWithDefault

func GetIntWithDefault(content []byte, key string, defaultVal int) int

func GetRawMessage

func GetRawMessage(content []byte, key string) (json.RawMessage, error)

GetRawMessage 返回原始片段,如果需要自己处理的话,可以自己处理

func GetString

func GetString(content []byte, key string) (string, error)

func GetStringSlice

func GetStringSlice(content []byte, key string) ([]string, error)

func GetStringWithDefault

func GetStringWithDefault(content []byte, key string, defaultVal string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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