Documentation
¶
Index ¶
- Variables
- func GetBool(content []byte, key string) (bool, error)
- func GetBoolSlice(content []byte, key string) ([]bool, error)
- func GetBoolWithDefault(content []byte, key string, defaultVal bool) bool
- func GetDiff[T any](v1 *T, v2 *T) ds.BuiltinSet[string]
- func GetEverySlice(content []byte, key string) (interface{}, error)
- func GetFloat(content []byte, key string) (float64, error)
- func GetFloatSlice(content []byte, key string) ([]float64, error)
- func GetFloatWithDefault(content []byte, key string, defaultVal float64) float64
- func GetInt(content []byte, key string) (int, error)
- func GetIntSlice(content []byte, key string) ([]int, error)
- func GetIntWithDefault(content []byte, key string, defaultVal int) int
- func GetRawMessage(content []byte, key string) (json.RawMessage, error)
- func GetString(content []byte, key string) (string, error)
- func GetStringSlice(content []byte, key string) ([]string, error)
- func GetStringWithDefault(content []byte, key string, defaultVal string) string
- func Marshal(v any) (string, error)
- func MarshalIndent(v any, prefix, indent string) (string, error)
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 GetEverySlice ¶
func GetFloatWithDefault ¶
func GetRawMessage ¶
func GetRawMessage(content []byte, key string) (json.RawMessage, error)
GetRawMessage 返回原始片段,如果需要自己处理的话,可以自己处理
func GetStringWithDefault ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.