Documentation ¶
Index ¶
- Variables
- type Item
- func (i *Item) Append(values ...*Item)
- func (i *Item) Attr(key string) *TempItem
- func (i *Item) DelIdx(index int)
- func (i *Item) DelKey(key string)
- func (i *Item) Empty() bool
- func (i *Item) FindIdx(filterFunc func(val *Item) bool) int
- func (i *Item) Idx(index int) *TempItem
- func (i *Item) Len() int
- func (i *Item) Map(mapFunc func(val *Item) interface{}) []interface{}
- func (i *Item) Put(key string, value *Item)
- func (i *Item) PutIdx(index int, newItem *Item)
- func (i *Item) RangeArr(callback func(index int, value *Item) error) error
- func (i *Item) RangeObj(callback func(key string, value *Item) error) error
- func (i *Item) Shuffle()
- func (i *Item) String() string
- func (i *Item) Struct() interface{}
- func (i *Item) Ti() *TempItem
- func (i *Item) Type() JsonType
- func (i *Item) ValuesArr() []*Item
- type JsonType
- type TempItem
- func (ti *TempItem) Attr(key string) *TempItem
- func (ti *TempItem) Bool() (bool, bool)
- func (ti *TempItem) Done() (*Item, bool)
- func (ti *TempItem) Float() (float64, bool)
- func (ti *TempItem) Idx(index int) *TempItem
- func (ti *TempItem) Int() (int, bool)
- func (ti *TempItem) Int64() (int64, bool)
- func (ti *TempItem) Set(val interface{}) *TempItem
- func (ti *TempItem) String() (string, bool)
- func (ti *TempItem) Val() interface{}
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBreakRange = errors.New("break arr or obj range")
ErrBreakRange 停止遍历
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item 表示一个 JSON 数据项
func (*Item) Empty ¶
Empty 返回当前项是否为空
如果 Type 为 obj, 值为 {}, 返回 true 如果 Type 为 arr, 值为 [], 返回 true 如果 Type 为 val, 值为 nil 或 "", 返回 true 其余情况, 返回 false
type TempItem ¶
type TempItem struct {
// contains filtered or unexported fields
}
TempItem 临时暂存 Item 对象
Click to show internal directories.
Click to hide internal directories.