Documentation ¶
Index ¶
- Constants
- Variables
- type Boolean
- type Float
- type Integer
- type JsonArray
- func (j *JsonArray) Get(index int) (*Value, error)
- func (j *JsonArray) GetBoolean(index int) (bool, error)
- func (j *JsonArray) GetFloat64(index int) (float64, error)
- func (j *JsonArray) GetInt(index int) (int, error)
- func (j *JsonArray) GetInt64(index int) (int64, error)
- func (j *JsonArray) GetJsonArray(index int) *JsonArray
- func (j *JsonArray) GetJsonObject(index int) *JsonObject
- func (j *JsonArray) GetNullBoolean(index int) (*Boolean, error)
- func (j *JsonArray) GetNullFloat(index int) (*Float, error)
- func (j *JsonArray) GetNullInt(index int) (*Integer, error)
- func (j *JsonArray) GetNullLong(index int) (*Long, error)
- func (j *JsonArray) GetString(index int) (string, error)
- func (j *JsonArray) String() string
- func (j *JsonArray) Value() []*Value
- type JsonObject
- func (j *JsonObject) Get(key string) (*Value, error)
- func (j *JsonObject) GetBoolean(key string) (bool, error)
- func (j *JsonObject) GetFloat64(key string) (float64, error)
- func (j *JsonObject) GetInt(key string) (int, error)
- func (j *JsonObject) GetInt64(key string) (int64, error)
- func (j *JsonObject) GetJsonArray(key string) *JsonArray
- func (j *JsonObject) GetJsonObject(key string) *JsonObject
- func (j *JsonObject) GetNullBoolean(key string) (*Boolean, error)
- func (j *JsonObject) GetNullFloat(key string) (*Float, error)
- func (j *JsonObject) GetNullInt(key string) (*Integer, error)
- func (j *JsonObject) GetNullLong(key string) (*Long, error)
- func (j *JsonObject) GetString(key string) (string, error)
- func (j *JsonObject) HasKey(key string) bool
- func (j *JsonObject) Put(key string, val interface{})
- func (j *JsonObject) Sort() *JsonObject
- func (j *JsonObject) String() string
- func (j *JsonObject) Value() map[string]*Value
- type KeyNotFoundError
- type Long
- type Value
- func (v *Value) Boolean() (bool, error)
- func (v *Value) Float64() (float64, error)
- func (v *Value) Int() (int, error)
- func (v *Value) Int64() (int64, error)
- func (v *Value) JsonArray() *JsonArray
- func (v *Value) JsonObject() *JsonObject
- func (v *Value) MarshalJSON() ([]byte, error)
- func (v *Value) NullBoolean() (*Boolean, error)
- func (v *Value) NullFloat() (*Float, error)
- func (v *Value) NullInt() (*Integer, error)
- func (v *Value) NullLong() (*Long, error)
- func (v *Value) String() (string, error)
- type ValueTransformTypeError
Constants ¶
View Source
const ( JSONOBJECTTYPE = "JsonObject" JSONARRAYTYPE = "JsonArray" STRINGTYPE = "string" BOOLEANTYPE = "bool" )
Variables ¶
View Source
var ( IndexOutOfRangeError = errors.New("index out of range") ValueNotNumberError = errors.New("value is not number") )
Functions ¶
This section is empty.
Types ¶
type JsonArray ¶
type JsonArray struct {
// contains filtered or unexported fields
}
func ParseArray ¶
func (*JsonArray) GetJsonArray ¶
func (*JsonArray) GetJsonObject ¶
func (j *JsonArray) GetJsonObject(index int) *JsonObject
type JsonObject ¶
type JsonObject struct {
// contains filtered or unexported fields
}
func NewJsonObject ¶
func NewJsonObject() *JsonObject
func ParseObject ¶
func ParseObject(jsonStr string) (*JsonObject, error)
func (*JsonObject) GetBoolean ¶
func (j *JsonObject) GetBoolean(key string) (bool, error)
func (*JsonObject) GetFloat64 ¶
func (j *JsonObject) GetFloat64(key string) (float64, error)
func (*JsonObject) GetJsonArray ¶
func (j *JsonObject) GetJsonArray(key string) *JsonArray
func (*JsonObject) GetJsonObject ¶
func (j *JsonObject) GetJsonObject(key string) *JsonObject
func (*JsonObject) GetNullBoolean ¶
func (j *JsonObject) GetNullBoolean(key string) (*Boolean, error)
func (*JsonObject) GetNullFloat ¶
func (j *JsonObject) GetNullFloat(key string) (*Float, error)
func (*JsonObject) GetNullInt ¶
func (j *JsonObject) GetNullInt(key string) (*Integer, error)
func (*JsonObject) GetNullLong ¶
func (j *JsonObject) GetNullLong(key string) (*Long, error)
func (*JsonObject) HasKey ¶
func (j *JsonObject) HasKey(key string) bool
func (*JsonObject) Put ¶
func (j *JsonObject) Put(key string, val interface{})
func (*JsonObject) Sort ¶
func (j *JsonObject) Sort() *JsonObject
func (*JsonObject) String ¶
func (j *JsonObject) String() string
func (*JsonObject) Value ¶
func (j *JsonObject) Value() map[string]*Value
type KeyNotFoundError ¶
type KeyNotFoundError struct {
Key string
}
func (KeyNotFoundError) Error ¶
func (e KeyNotFoundError) Error() string
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func (*Value) JsonObject ¶
func (v *Value) JsonObject() *JsonObject
func (*Value) MarshalJSON ¶
func (*Value) NullBoolean ¶
type ValueTransformTypeError ¶
type ValueTransformTypeError struct {
Type string
}
func (ValueTransformTypeError) Error ¶
func (e ValueTransformTypeError) Error() string
Click to show internal directories.
Click to hide internal directories.