Documentation ¶
Index ¶
- Constants
- func Clone(c interface{}, cloned ...interface{}) (res interface{})
- func Filter(slice interface{}, f func(interface{}) bool, dest ...interface{}) (res interface{})
- func Foreach(slice interface{}, f func(interface{}, interface{}) bool)
- func IsMatch(slice interface{}, f func(interface{}) bool) bool
- func Less(x interface{}, y interface{}) (lt bool)
- func Map(slice interface{}, f func(interface{}) interface{}, dest ...interface{}) (res interface{})
- func Match(slice interface{}, f func(interface{}) bool) (interface{}, interface{})
- func Reduce(slice interface{}, f func(interface{}, interface{}) interface{}, ...) (res interface{})
- type Array
- type Dict
- func (d *Dict) Clear()
- func (d *Dict) Clone() *Dict
- func (d *Dict) Contains(values ...interface{}) bool
- func (d *Dict) Foreach(f func(interface{}, interface{}) bool)
- func (d *Dict) HasKey(key interface{}) (exists bool)
- func (d *Dict) IsMatch(f func(interface{}) bool) bool
- func (d *Dict) Iterator() (di Iterator)
- func (d *Dict) KeyOf(value interface{}) interface{}
- func (d *Dict) Keys() (keys []interface{})
- func (d *Dict) KeysOf(value interface{}) (keys []interface{})
- func (d *Dict) KeysValues() (keys []interface{}, values []interface{})
- func (d *Dict) Len() int
- func (d *Dict) MapValue(key interface{}, value interface{}) (val interface{})
- func (d *Dict) Match(f func(interface{}) bool) (interface{}, interface{})
- func (d *Dict) Pairs() (pairs [][2]interface{})
- func (d *Dict) Pop() (key interface{}, value interface{})
- func (d *Dict) Remove(value interface{}) (keys []interface{})
- func (d *Dict) RemoveAt(key interface{}) (value interface{})
- func (d *Dict) Set(key interface{}, value interface{}) Dictionary
- func (d *Dict) SetDefault(key interface{}, value interface{}) Dictionary
- func (d *Dict) String() string
- func (d *Dict) ToMap() map[interface{}]interface{}
- func (d *Dict) Transaction(f func(ExtendedDictionary) bool)
- func (d *Dict) Update(m map[interface{}]interface{})
- func (d *Dict) UpdateDict(dt *Dict)
- func (d *Dict) UpdateDictionary(dt Dictionary)
- func (d *Dict) UpdateOrderedDict(od *OrderedDict)
- func (d *Dict) Values() (values []interface{})
- type DictIterator
- type Dictionary
- type ExtendedArray
- type ExtendedDictionary
- type Iterator
- type List
- func (l *List) Append(value interface{}) Array
- func (l *List) Clear()
- func (l *List) Clone() *List
- func (l *List) Contains(value ...interface{}) bool
- func (l *List) Extend(values []interface{})
- func (l *List) ExtendArray(arr Array)
- func (l *List) ExtendList(list *List)
- func (l *List) ExtendSet(set *Set)
- func (l *List) Filter(f func(interface{}) bool) ExtendedArray
- func (l *List) FilterList(f func(interface{}) bool) (newlist *List)
- func (l *List) First() interface{}
- func (l *List) Foreach(f func(int, interface{}) bool)
- func (l *List) Index(value interface{}) int
- func (l *List) Indexes(value interface{}) (indexes []int)
- func (l *List) Insert(index int, value interface{}) Array
- func (l *List) IsMatch(f func(interface{}) bool) bool
- func (l *List) Iterator() NumIterator
- func (l *List) Last() interface{}
- func (l *List) LastIndex(value interface{}) int
- func (l *List) Len() int
- func (l *List) Less(x int, y int) bool
- func (l *List) Map(f func(interface{}) interface{}) ExtendedArray
- func (l *List) MapList(f func(interface{}) interface{}) (newlist *List)
- func (l *List) MapValue(index int, value interface{}) (val interface{})
- func (l *List) Match(f func(interface{}) bool) (int, interface{})
- func (l *List) Pop() interface{}
- func (l *List) Reduce(f func(interface{}, interface{}) interface{}, init interface{}) (value interface{})
- func (l *List) Remove(value interface{})
- func (l *List) RemoveAt(index int) interface{}
- func (l *List) Reverse()
- func (l *List) Set(index int, value interface{}) Array
- func (l *List) Sort(less func(x interface{}, y interface{}) bool)
- func (l *List) String() string
- func (l *List) Swap(x int, y int)
- func (l *List) ToSet() (set *Set)
- func (l *List) ToSlice() []interface{}
- func (l *List) Transaction(f func(ExtendedArray) bool)
- type ListIterator
- type NumIterator
- type OrderedDict
- func (od *OrderedDict) Clear()
- func (od *OrderedDict) Clone() *OrderedDict
- func (od *OrderedDict) Contains(values ...interface{}) bool
- func (od *OrderedDict) Foreach(f func(interface{}, interface{}) bool)
- func (od *OrderedDict) HasKey(key interface{}) (exists bool)
- func (od *OrderedDict) IsMatch(f func(interface{}) bool) bool
- func (od *OrderedDict) Iterator() (di Iterator)
- func (od *OrderedDict) KeyOf(value interface{}) interface{}
- func (od *OrderedDict) Keys() []interface{}
- func (od *OrderedDict) KeysOf(value interface{}) (keys []interface{})
- func (od *OrderedDict) KeysValues() ([]interface{}, []interface{})
- func (od *OrderedDict) Len() int
- func (od *OrderedDict) MapValue(key interface{}, value interface{}) (val interface{})
- func (od *OrderedDict) Match(f func(interface{}) bool) (interface{}, interface{})
- func (od *OrderedDict) Pairs() (pairs [][2]interface{})
- func (od *OrderedDict) Pop() (key interface{}, value interface{})
- func (od *OrderedDict) Remove(value interface{}) (keys []interface{})
- func (od *OrderedDict) RemoveAt(key interface{}) interface{}
- func (od *OrderedDict) Reverse()
- func (od *OrderedDict) Set(key interface{}, value interface{}) Dictionary
- func (od *OrderedDict) SetDefault(key interface{}, value interface{}) Dictionary
- func (od *OrderedDict) Sort(less func(x interface{}, y interface{}) bool)
- func (od *OrderedDict) SortByKey(less func(x interface{}, y interface{}) bool)
- func (od *OrderedDict) String() string
- func (od *OrderedDict) ToMap() map[interface{}]interface{}
- func (od *OrderedDict) Transaction(f func(ExtendedDictionary) bool)
- func (od *OrderedDict) Update(m map[interface{}]interface{})
- func (od *OrderedDict) UpdateDict(d *Dict)
- func (od *OrderedDict) UpdateDictionary(d Dictionary)
- func (od *OrderedDict) UpdateOrderedDict(d *OrderedDict)
- func (od *OrderedDict) Values() []interface{}
- type OrderedDictIterator
- type PopIterator
- type Queue
- func (q *Queue) Clear()
- func (q *Queue) Clone() (qu *Queue)
- func (q *Queue) First() (val interface{})
- func (q *Queue) HasQueue() bool
- func (q *Queue) Iterator() PopIterator
- func (q *Queue) Last() (val interface{})
- func (q *Queue) Len() int
- func (q *Queue) Pull() (val interface{})
- func (q *Queue) PullDefault(def interface{}) interface{}
- func (q *Queue) PullOk() (val interface{}, ok bool)
- func (q *Queue) Push(val ...interface{})
- func (q *Queue) String() string
- func (q *Queue) ToList() *List
- func (q *Queue) ToSlice() []interface{}
- type QueueIterator
- type Set
- func (s *Set) Append(value interface{}) Array
- func (s *Set) Clear()
- func (s *Set) Clone() *Set
- func (s *Set) Contains(value ...interface{}) bool
- func (s *Set) Extend(values []interface{})
- func (s *Set) ExtendArray(arr Array)
- func (s *Set) ExtendList(list *List)
- func (s *Set) ExtendSet(set *Set)
- func (s *Set) Filter(f func(interface{}) bool) ExtendedArray
- func (s *Set) FilterSet(f func(interface{}) bool) (newset *Set)
- func (s *Set) First() interface{}
- func (s *Set) Foreach(f func(int, interface{}) bool)
- func (s *Set) Get(index int) interface{}
- func (s *Set) Index(value interface{}) int
- func (s *Set) Indexes(value interface{}) []int
- func (s *Set) Insert(index int, value interface{}) Array
- func (s *Set) IsMatch(f func(interface{}) bool) bool
- func (s *Set) Iterator() NumIterator
- func (s *Set) Last() interface{}
- func (s *Set) LastIndex(value interface{}) int
- func (s *Set) Len() int
- func (s *Set) Less(x int, y int) bool
- func (s *Set) Map(f func(interface{}) interface{}) ExtendedArray
- func (s *Set) MapSet(f func(interface{}) interface{}) (newset *Set)
- func (s *Set) MapValue(index int, value interface{}) (val interface{})
- func (s *Set) Match(f func(interface{}) bool) (int, interface{})
- func (s *Set) Pop() (val interface{})
- func (s *Set) Reduce(f func(interface{}, interface{}) interface{}, init interface{}) (value interface{})
- func (s *Set) Remove(value interface{})
- func (s *Set) RemoveAt(index int) (val interface{})
- func (s *Set) Reverse()
- func (s *Set) Set(index int, value interface{}) Array
- func (s *Set) Sort(f func(x interface{}, y interface{}) bool)
- func (s *Set) String() string
- func (s *Set) Swap(x int, y int)
- func (s *Set) ToList() *List
- func (s *Set) ToSlice() []interface{}
- func (s *Set) Transaction(f func(ExtendedArray) bool)
- type SortDictValue
- type SortList
- type Stack
- func (s *Stack) Clear()
- func (s *Stack) Clone() (st *Stack)
- func (s *Stack) Last() (value interface{})
- func (s *Stack) Len() int
- func (s *Stack) Pop() (value interface{})
- func (s *Stack) PopOk() (value interface{}, ok bool)
- func (s *Stack) Push(value interface{})
- func (s *Stack) String() string
- func (s *Stack) ToList() *List
- func (s *Stack) ToSlice() (slice []interface{})
Constants ¶
View Source
const ComfortLen = 10
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
func Filter(slice interface{}, f func(interface{}) bool, dest ...interface{}) (res interface{})
Types ¶
type Array ¶
type Array interface { Append(value interface{}) Array Contains(value ...interface{}) bool Extend(values []interface{}) ExtendArray(Array) First() interface{} Last() interface{} Index(value interface{}) int Indexes(value interface{}) []int LastIndex(value interface{}) int Set(index int, value interface{}) Array Insert(index int, value interface{}) Array MapValue(index int, value interface{}) interface{} Len() int Pop() interface{} Remove(value interface{}) RemoveAt(index int) interface{} Reverse() Iterator() NumIterator String() string ToSlice() []interface{} Clear() }
type Dict ¶
type Dict struct { util.ValueGetter // contains filtered or unexported fields }
func (*Dict) KeysValues ¶
func (d *Dict) KeysValues() (keys []interface{}, values []interface{})
func (*Dict) MapValue ¶
func (d *Dict) MapValue(key interface{}, value interface{}) (val interface{})
func (*Dict) Set ¶
func (d *Dict) Set(key interface{}, value interface{}) Dictionary
func (*Dict) SetDefault ¶
func (d *Dict) SetDefault(key interface{}, value interface{}) Dictionary
func (*Dict) Transaction ¶
func (d *Dict) Transaction(f func(ExtendedDictionary) bool)
func (*Dict) UpdateDict ¶
func (*Dict) UpdateDictionary ¶
func (d *Dict) UpdateDictionary(dt Dictionary)
func (*Dict) UpdateOrderedDict ¶
func (d *Dict) UpdateOrderedDict(od *OrderedDict)
type DictIterator ¶
type DictIterator struct {
// contains filtered or unexported fields
}
this is not thread/concurrent safe
func (*DictIterator) Get ¶
func (di *DictIterator) Get() (interface{}, interface{})
func (*DictIterator) Next ¶
func (di *DictIterator) Next(val ...interface{}) bool
func (*DictIterator) Reset ¶
func (di *DictIterator) Reset()
type Dictionary ¶
type Dictionary interface { Contains(values ...interface{}) bool HasKey(key interface{}) bool KeyOf(value interface{}) interface{} Keys() []interface{} Values() []interface{} KeysValues() (keys []interface{}, values []interface{}) Pairs() [][2]interface{} Pop() (key interface{}, value interface{}) Len() int MapValue(key interface{}, value interface{}) interface{} Remove(value interface{}) []interface{} RemoveAt(key interface{}) interface{} Set(key interface{}, value interface{}) Dictionary SetDefault(key interface{}, value interface{}) Dictionary ToMap() map[interface{}]interface{} Update(map[interface{}]interface{}) UpdateDictionary(Dictionary) Iterator() Iterator String() string Clear() }
type ExtendedArray ¶
type ExtendedArray interface { Array Less(x int, y int) bool Swap(x int, y int) Sort(less func(x interface{}, y interface{}) bool) Filter(func(interface{}) bool) ExtendedArray Foreach(func(int, interface{}) bool) IsMatch(func(interface{}) bool) bool Match(func(interface{}) bool) (index int, value interface{}) Map(func(interface{}) interface{}) ExtendedArray Reduce(f func(interface{}, interface{}) interface{}, init interface{}) interface{} Transaction(func(ExtendedArray) bool) }
type ExtendedDictionary ¶
type ExtendedDictionary interface { Dictionary Foreach(f func(interface{}, interface{}) bool) IsMatch(func(interface{}) bool) bool Match(f func(interface{}) bool) (key interface{}, value interface{}) Transaction(f func(ExtendedDictionary) bool) }
type Iterator ¶
type Iterator interface { Get() (interface{}, interface{}) Next(...interface{}) bool Reset() }
usage
for iter := li.Iterator(); iter.Next(&i, &value); { ... i, val := iter.GetI() // alternatively use this instead of .Next(&i, &value) }
type List ¶
type List struct { util.ValueGetter // contains filtered or unexported fields }
func (*List) ExtendArray ¶
func (*List) ExtendList ¶
func (*List) Filter ¶
func (l *List) Filter(f func(interface{}) bool) ExtendedArray
func (*List) FilterList ¶
func (*List) Iterator ¶
func (l *List) Iterator() NumIterator
func (*List) Map ¶
func (l *List) Map(f func(interface{}) interface{}) ExtendedArray
func (*List) Reduce ¶
func (l *List) Reduce(f func(interface{}, interface{}) interface{}, init interface{}) (value interface{})
func (*List) Transaction ¶
func (l *List) Transaction(f func(ExtendedArray) bool)
type ListIterator ¶
type ListIterator struct {
// contains filtered or unexported fields
}
usage
for iter := li.Iterator(); iter.Next(&i, &value); { ... i, val := iter.GetI() // alternatively use this instead of .Next(&i, &value) }
func (*ListIterator) Get ¶
func (li *ListIterator) Get() (interface{}, interface{})
func (*ListIterator) GetI ¶
func (li *ListIterator) GetI() (int, interface{})
func (*ListIterator) Next ¶
func (li *ListIterator) Next(val ...interface{}) (ok bool)
func (*ListIterator) Reset ¶
func (li *ListIterator) Reset()
type NumIterator ¶
type OrderedDict ¶
type OrderedDict struct { util.ValueGetter // contains filtered or unexported fields }
func NewOrderedDict ¶
func NewOrderedDict(def interface{}, m ...map[interface{}]interface{}) (d *OrderedDict)
func (*OrderedDict) Clear ¶
func (od *OrderedDict) Clear()
func (*OrderedDict) Clone ¶
func (od *OrderedDict) Clone() *OrderedDict
func (*OrderedDict) Contains ¶
func (od *OrderedDict) Contains(values ...interface{}) bool
func (*OrderedDict) Foreach ¶
func (od *OrderedDict) Foreach(f func(interface{}, interface{}) bool)
func (*OrderedDict) HasKey ¶
func (od *OrderedDict) HasKey(key interface{}) (exists bool)
func (*OrderedDict) IsMatch ¶
func (od *OrderedDict) IsMatch(f func(interface{}) bool) bool
func (*OrderedDict) Iterator ¶
func (od *OrderedDict) Iterator() (di Iterator)
func (*OrderedDict) KeyOf ¶
func (od *OrderedDict) KeyOf(value interface{}) interface{}
func (*OrderedDict) Keys ¶
func (od *OrderedDict) Keys() []interface{}
func (*OrderedDict) KeysOf ¶
func (od *OrderedDict) KeysOf(value interface{}) (keys []interface{})
func (*OrderedDict) KeysValues ¶
func (od *OrderedDict) KeysValues() ([]interface{}, []interface{})
func (*OrderedDict) Len ¶
func (od *OrderedDict) Len() int
func (*OrderedDict) MapValue ¶
func (od *OrderedDict) MapValue(key interface{}, value interface{}) (val interface{})
func (*OrderedDict) Match ¶
func (od *OrderedDict) Match(f func(interface{}) bool) (interface{}, interface{})
func (*OrderedDict) Pairs ¶
func (od *OrderedDict) Pairs() (pairs [][2]interface{})
func (*OrderedDict) Pop ¶
func (od *OrderedDict) Pop() (key interface{}, value interface{})
func (*OrderedDict) Remove ¶
func (od *OrderedDict) Remove(value interface{}) (keys []interface{})
func (*OrderedDict) RemoveAt ¶
func (od *OrderedDict) RemoveAt(key interface{}) interface{}
func (*OrderedDict) Reverse ¶
func (od *OrderedDict) Reverse()
func (*OrderedDict) Set ¶
func (od *OrderedDict) Set(key interface{}, value interface{}) Dictionary
func (*OrderedDict) SetDefault ¶
func (od *OrderedDict) SetDefault(key interface{}, value interface{}) Dictionary
func (*OrderedDict) Sort ¶
func (od *OrderedDict) Sort(less func(x interface{}, y interface{}) bool)
func (*OrderedDict) SortByKey ¶
func (od *OrderedDict) SortByKey(less func(x interface{}, y interface{}) bool)
func (*OrderedDict) String ¶
func (od *OrderedDict) String() string
func (*OrderedDict) ToMap ¶
func (od *OrderedDict) ToMap() map[interface{}]interface{}
func (*OrderedDict) Transaction ¶
func (od *OrderedDict) Transaction(f func(ExtendedDictionary) bool)
func (*OrderedDict) Update ¶
func (od *OrderedDict) Update(m map[interface{}]interface{})
func (*OrderedDict) UpdateDict ¶
func (od *OrderedDict) UpdateDict(d *Dict)
func (*OrderedDict) UpdateDictionary ¶
func (od *OrderedDict) UpdateDictionary(d Dictionary)
func (*OrderedDict) UpdateOrderedDict ¶
func (od *OrderedDict) UpdateOrderedDict(d *OrderedDict)
func (*OrderedDict) Values ¶
func (od *OrderedDict) Values() []interface{}
type OrderedDictIterator ¶
type OrderedDictIterator struct {
// contains filtered or unexported fields
}
func (*OrderedDictIterator) Get ¶
func (di *OrderedDictIterator) Get() (interface{}, interface{})
func (*OrderedDictIterator) Next ¶
func (di *OrderedDictIterator) Next(val ...interface{}) (ok bool)
func (*OrderedDictIterator) Reset ¶
func (di *OrderedDictIterator) Reset()
type PopIterator ¶
type PopIterator interface { NumIterator PopNext(...interface{}) bool }
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func (*Queue) Iterator ¶
func (q *Queue) Iterator() PopIterator
func (*Queue) PullDefault ¶
func (q *Queue) PullDefault(def interface{}) interface{}
type QueueIterator ¶
type QueueIterator struct {
// contains filtered or unexported fields
}
func (*QueueIterator) Get ¶
func (qi *QueueIterator) Get() (interface{}, interface{})
func (*QueueIterator) GetI ¶
func (qi *QueueIterator) GetI() (int, interface{})
func (*QueueIterator) Next ¶
func (qi *QueueIterator) Next(val ...interface{}) (ok bool)
func (*QueueIterator) PopNext ¶
func (qi *QueueIterator) PopNext(val ...interface{}) (ok bool)
func (*QueueIterator) Reset ¶
func (qi *QueueIterator) Reset()
type Set ¶
type Set struct { util.ValueGetter // contains filtered or unexported fields }
func (*Set) ExtendArray ¶
func (*Set) ExtendList ¶
func (*Set) Filter ¶
func (s *Set) Filter(f func(interface{}) bool) ExtendedArray
func (*Set) Iterator ¶
func (s *Set) Iterator() NumIterator
func (*Set) Map ¶
func (s *Set) Map(f func(interface{}) interface{}) ExtendedArray
func (*Set) Reduce ¶
func (s *Set) Reduce(f func(interface{}, interface{}) interface{}, init interface{}) (value interface{})
func (*Set) Transaction ¶
func (s *Set) Transaction(f func(ExtendedArray) bool)
type SortDictValue ¶
type SortDictValue struct {
// contains filtered or unexported fields
}
func (*SortDictValue) Len ¶
func (sd *SortDictValue) Len() int
func (*SortDictValue) Swap ¶
func (sd *SortDictValue) Swap(x int, y int)
Click to show internal directories.
Click to hide internal directories.