Documentation
¶
Index ¶
- func SetParser(parser JsonParser)
- type JsonArray
- func (ja *JsonArray) Add(value any)
- func (ja *JsonArray) AddAll(value []any)
- func (ja *JsonArray) Get(index int) any
- func (ja *JsonArray) GetFloat(index int) (float64, error)
- func (ja *JsonArray) GetFloatIgnoreError(index int) float64
- func (ja *JsonArray) GetInt(index int) (int, error)
- func (ja *JsonArray) GetIntIgnoreError(index int) int
- func (ja *JsonArray) GetJsonArray(index int) (*JsonArray, error)
- func (ja *JsonArray) GetJsonArrayIgnoreError(index int) *JsonArray
- func (ja *JsonArray) GetJsonObject(index int) (*JsonObject, error)
- func (ja *JsonArray) GetJsonObjectIgnoreError(index int) *JsonObject
- func (ja *JsonArray) GetString(index int) (string, error)
- func (ja *JsonArray) GetStringIgnoreError(index int) string
- func (ja *JsonArray) Length() int
- func (ja *JsonArray) Remove(index int)
- func (ja *JsonArray) ToJsonStr() string
- func (ja *JsonArray) ToStruct(s any) error
- func (ja *JsonArray) UnmarshalJSON(data []byte) error
- type JsonObject
- func (jo *JsonObject) ContainsKey(key string) bool
- func (jo *JsonObject) ForEach(f func(key string))
- func (jo *JsonObject) Get(key string) any
- func (jo *JsonObject) GetBool(key string) (bool, error)
- func (jo *JsonObject) GetBoolIgnoreError(key string) bool
- func (jo *JsonObject) GetFloat(key string) (float64, error)
- func (jo *JsonObject) GetFloatIgnoreError(key string) float64
- func (jo *JsonObject) GetInt(key string) (int, error)
- func (jo *JsonObject) GetIntIgnoreError(key string) int
- func (jo *JsonObject) GetJsonArray(key string) (*JsonArray, error)
- func (jo *JsonObject) GetJsonArrayIgnoreError(key string) *JsonArray
- func (jo *JsonObject) GetJsonObject(key string) (*JsonObject, error)
- func (jo *JsonObject) GetJsonObjectIgnoreError(key string) *JsonObject
- func (jo *JsonObject) GetString(key string) (string, error)
- func (jo *JsonObject) GetStringIgnoreError(key string) string
- func (jo *JsonObject) Keys() []string
- func (jo *JsonObject) Length() int
- func (jo *JsonObject) Put(key string, value any)
- func (jo *JsonObject) PutAll(val map[string]any)
- func (jo *JsonObject) Remove(key string)
- func (jo *JsonObject) ToJsonStr() string
- func (jo *JsonObject) ToStruct(s any) error
- func (jo *JsonObject) UnmarshalJSON(data []byte) error
- type JsonParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetParser ¶
func SetParser(parser JsonParser)
Types ¶
type JsonArray ¶
type JsonArray struct {
// contains filtered or unexported fields
}
func NewJsonArray ¶
func NewJsonArray() *JsonArray
func NewJsonArrayWithVal ¶ added in v0.3.0
func ParseToArray ¶
func (*JsonArray) GetFloatIgnoreError ¶ added in v0.1.2
func (*JsonArray) GetIntIgnoreError ¶ added in v0.1.2
func (*JsonArray) GetJsonArrayIgnoreError ¶ added in v0.1.2
func (*JsonArray) GetJsonObject ¶
func (ja *JsonArray) GetJsonObject(index int) (*JsonObject, error)
func (*JsonArray) GetJsonObjectIgnoreError ¶ added in v0.1.2
func (ja *JsonArray) GetJsonObjectIgnoreError(index int) *JsonObject
func (*JsonArray) GetStringIgnoreError ¶ added in v0.1.2
func (*JsonArray) UnmarshalJSON ¶ added in v0.4.0
type JsonObject ¶
type JsonObject struct {
// contains filtered or unexported fields
}
func NewJsonObject ¶
func NewJsonObject() *JsonObject
func NewJsonObjectWithVal ¶ added in v0.3.0
func NewJsonObjectWithVal(v map[string]any) *JsonObject
func ParseToJsonObject ¶
func ParseToJsonObject(v any) (*JsonObject, error)
func (*JsonObject) ContainsKey ¶
func (jo *JsonObject) ContainsKey(key string) bool
func (*JsonObject) ForEach ¶ added in v0.5.0
func (jo *JsonObject) ForEach(f func(key string))
func (*JsonObject) Get ¶
func (jo *JsonObject) Get(key string) any
func (*JsonObject) GetBoolIgnoreError ¶ added in v0.1.2
func (jo *JsonObject) GetBoolIgnoreError(key string) bool
func (*JsonObject) GetFloatIgnoreError ¶ added in v0.1.2
func (jo *JsonObject) GetFloatIgnoreError(key string) float64
func (*JsonObject) GetIntIgnoreError ¶ added in v0.1.2
func (jo *JsonObject) GetIntIgnoreError(key string) int
func (*JsonObject) GetJsonArray ¶
func (jo *JsonObject) GetJsonArray(key string) (*JsonArray, error)
func (*JsonObject) GetJsonArrayIgnoreError ¶ added in v0.1.2
func (jo *JsonObject) GetJsonArrayIgnoreError(key string) *JsonArray
func (*JsonObject) GetJsonObject ¶
func (jo *JsonObject) GetJsonObject(key string) (*JsonObject, error)
func (*JsonObject) GetJsonObjectIgnoreError ¶ added in v0.1.2
func (jo *JsonObject) GetJsonObjectIgnoreError(key string) *JsonObject
func (*JsonObject) GetStringIgnoreError ¶ added in v0.1.2
func (jo *JsonObject) GetStringIgnoreError(key string) string
func (*JsonObject) Keys ¶ added in v0.5.0
func (jo *JsonObject) Keys() []string
func (*JsonObject) Length ¶
func (jo *JsonObject) Length() int
func (*JsonObject) Put ¶
func (jo *JsonObject) Put(key string, value any)
func (*JsonObject) PutAll ¶ added in v0.3.0
func (jo *JsonObject) PutAll(val map[string]any)
func (*JsonObject) Remove ¶
func (jo *JsonObject) Remove(key string)
func (*JsonObject) ToJsonStr ¶
func (jo *JsonObject) ToJsonStr() string
func (*JsonObject) ToStruct ¶
func (jo *JsonObject) ToStruct(s any) error
func (*JsonObject) UnmarshalJSON ¶ added in v0.4.0
func (jo *JsonObject) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.