Documentation ¶
Index ¶
- Variables
- func Marshal(obj *JsonValue, opts ...Option) (string, error)
- func SqlToJson(u interface{}, options ...Option) (string, error)
- type Filter
- type JsonValue
- func NewArray() *JsonValue
- func NewBool(b bool) *JsonValue
- func NewBoolean(b bool) *JsonValue
- func NewByUnmarshal(s string) (*JsonValue, error)
- func NewFloat(f float64) *JsonValue
- func NewFromString(s string) (*JsonValue, error)
- func NewInt(i int) *JsonValue
- func NewInt32(i int32) *JsonValue
- func NewInt64(i int64) *JsonValue
- func NewNull() *JsonValue
- func NewObject() *JsonValue
- func NewString(s string) *JsonValue
- func NewUint(i uint) *JsonValue
- func NewUint32(i uint32) *JsonValue
- func NewUint64(i uint64) *JsonValue
- func (this *JsonValue) Append(newOne *JsonValue, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) AppendBool(b bool, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) AppendBoolean(b bool, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) AppendFloat(f float64, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) AppendInt(i int, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) AppendInt32(i int32, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) AppendInt64(i int64, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) AppendNull(keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) AppendString(s string, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) AppendUint(i uint, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) AppendUint32(i uint32, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) AppendUint64(i uint64, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) ArrayForeach(callback func(index int, value *JsonValue) error) error
- func (obj *JsonValue) Bool() bool
- func (obj *JsonValue) Boolean() bool
- func (obj *JsonValue) Delete(first interface{}, keys ...interface{}) error
- func (obj *JsonValue) Float() float64
- func (obj *JsonValue) Get(first interface{}, keys ...interface{}) (*JsonValue, error)
- func (obj *JsonValue) GetAtIndex(index int) (*JsonValue, error)
- func (obj *JsonValue) GetBool(first interface{}, keys ...interface{}) (bool, error)
- func (obj *JsonValue) GetBoolean(first interface{}, keys ...interface{}) (bool, error)
- func (obj *JsonValue) GetByKey(keys ...string) (*JsonValue, error)
- func (obj *JsonValue) GetFloat(first interface{}, keys ...interface{}) (float64, error)
- func (obj *JsonValue) GetInt(first interface{}, keys ...interface{}) (int, error)
- func (obj *JsonValue) GetInt32(first interface{}, keys ...interface{}) (int32, error)
- func (obj *JsonValue) GetInt64(first interface{}, keys ...interface{}) (int64, error)
- func (obj *JsonValue) GetString(first interface{}, keys ...interface{}) (string, error)
- func (obj *JsonValue) GetUint(first interface{}, keys ...interface{}) (uint, error)
- func (obj *JsonValue) GetUint32(first interface{}, keys ...interface{}) (uint32, error)
- func (obj *JsonValue) GetUint64(first interface{}, keys ...interface{}) (uint64, error)
- func (this *JsonValue) Insert(newOne *JsonValue, index interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) InsertBool(b bool, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) InsertBoolean(b bool, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) InsertFloat(f float64, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) InsertInt(i int, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) InsertInt32(i int32, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) InsertInt64(i int64, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) InsertNull(first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) InsertString(s string, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) InsertUint(i uint, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) InsertUint32(i uint32, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) InsertUint64(i uint64, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (obj *JsonValue) Int() int
- func (obj *JsonValue) Int32() int32
- func (obj *JsonValue) Int64() int64
- func (obj *JsonValue) IsArray() bool
- func (obj *JsonValue) IsBool() bool
- func (obj *JsonValue) IsBoollean() bool
- func (this *JsonValue) IsFloat() bool
- func (obj *JsonValue) IsNull() bool
- func (obj *JsonValue) IsNumber() bool
- func (obj *JsonValue) IsObject() bool
- func (this *JsonValue) IsSigned() bool
- func (obj *JsonValue) IsString() bool
- func (this *JsonValue) IsUnsigned() bool
- func (obj *JsonValue) Len() int
- func (obj *JsonValue) Length() int
- func (obj *JsonValue) Marshal(opts ...Option) (string, error)
- func (to *JsonValue) MergeFrom(from *JsonValue, optList ...Option) error
- func (this *JsonValue) ObjectForeach(callback func(key string, value *JsonValue) error) error
- func (this *JsonValue) Set(newOne *JsonValue, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetArray(first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetBool(b bool, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetBoolean(b bool, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetFloat(f float64, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetInt(i int, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetInt32(i int32, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetInt64(i int64, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetNull(first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetObject(first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetString(s string, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetUint(i uint, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetUint32(i uint32, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (this *JsonValue) SetUint64(i uint64, first interface{}, keys ...interface{}) (*JsonValue, error)
- func (obj *JsonValue) String() string
- func (this *JsonValue) Swap(i, j int) error
- func (obj *JsonValue) Type() ValueType
- func (obj *JsonValue) TypeString() string
- func (obj *JsonValue) Uint() uint
- func (obj *JsonValue) Uint32() uint32
- func (obj *JsonValue) Uint64() uint64
- type Option
- type Sort
- type ValueType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DataTypeError = errors.New("invalid parameter type") ParaError = errors.New("parameter invalid") JsonFormatError = errors.New("json string format error") JsonTypeError = errors.New("json target type error") IndexOutOfBoundsError = errors.New("index out of bounds") NotAnArrayError = errors.New("target is not an array") NotAnObjectError = errors.New("target is not an object") NotAStringError = errors.New("target is not a string") NotANumberError = errors.New("target is not a number") NotABoolError = errors.New("target is not a bool") ObjectNotFoundError = errors.New("object not found") )
Functions ¶
Types ¶
type JsonValue ¶
type JsonValue struct {
// contains filtered or unexported fields
}
func NewBoolean ¶
func NewByUnmarshal ¶
func NewFromString ¶
func (*JsonValue) AppendBool ¶
func (*JsonValue) AppendBoolean ¶
func (*JsonValue) AppendFloat ¶
func (*JsonValue) AppendInt32 ¶
func (*JsonValue) AppendInt64 ¶
func (*JsonValue) AppendNull ¶
func (*JsonValue) AppendString ¶
==== AppendXxx ====
func (*JsonValue) AppendUint ¶
func (*JsonValue) AppendUint32 ¶
func (*JsonValue) AppendUint64 ¶
func (*JsonValue) ArrayForeach ¶
==================== foreach
func (*JsonValue) GetBoolean ¶
func (*JsonValue) InsertBool ¶
func (*JsonValue) InsertBoolean ¶
func (*JsonValue) InsertFloat ¶
func (*JsonValue) InsertInt32 ¶
func (*JsonValue) InsertInt64 ¶
func (*JsonValue) InsertNull ¶
func (*JsonValue) InsertString ¶
func (this *JsonValue) InsertString(s string, first interface{}, keys ...interface{}) (*JsonValue, error)
==== InsertXxx ====
func (*JsonValue) InsertUint ¶
func (*JsonValue) InsertUint32 ¶
func (*JsonValue) InsertUint64 ¶
func (*JsonValue) IsBoollean ¶
func (*JsonValue) IsUnsigned ¶
func (*JsonValue) ObjectForeach ¶
func (*JsonValue) SetBoolean ¶
func (*JsonValue) SetString ¶
func (this *JsonValue) SetString(s string, first interface{}, keys ...interface{}) (*JsonValue, error)
==== SetXxx ====
func (*JsonValue) TypeString ¶
type ValueType ¶
type ValueType int
data definitions same as jsonparser
const ( NotExist ValueType = ValueType(jsonparser.NotExist) String ValueType = ValueType(jsonparser.String) Number ValueType = ValueType(jsonparser.Number) Object ValueType = ValueType(jsonparser.Object) Array ValueType = ValueType(jsonparser.Array) Boolean ValueType = ValueType(jsonparser.Boolean) Null ValueType = ValueType(jsonparser.Null) Unknown ValueType = ValueType(jsonparser.Unknown) )
Click to show internal directories.
Click to hide internal directories.