gitee.com/zhongguo168a/gocodes@v0.0.0-20230609140523-e1828349603f/datax/listx/iface.go (about) 1 package listx 2 3 type IList interface { 4 Add(items ...interface{}) 5 AddConf(cond func(index int, item interface{}) bool, items ...interface{}) 6 Set(index int, val interface{}) 7 SetList(val []interface{}) 8 At(index int) interface{} 9 Clear() 10 Dispose() 11 Clone() *List 12 Contains(item interface{}) bool 13 ContainsCond(cond func(index int, item interface{}) bool) bool 14 CountCond(cond func(index int, item interface{}) bool) int 15 Every(cond func(index int, item interface{}) bool) bool 16 First(cond func(index int, item interface{}) bool) (val interface{}, has bool) 17 Filter(cond func(index int, item interface{}) bool) *List 18 ForRange(handler func(index int, item interface{}) error) 19 IndexOfConf(cond func(index int, item interface{}) bool) int 20 IndexOf(item interface{}) int 21 Last(cond func(index int, item interface{}) bool) (val interface{}, has bool) 22 Length() int 23 Pop() interface{} 24 Push(item interface{}) 25 PushList(val IList) 26 Remove(item interface{}) 27 RemoveAt(i int) 28 Replace(i int, item interface{}) 29 Reverse() 30 Shift() interface{} 31 Slice() []interface{} 32 Self() *List 33 Sort(compare func(a, b interface{}) int) 34 Unshift(item interface{}) 35 Unique() *List 36 UniqueByCustomKey(getKey func(item interface{}) string) *List 37 Union(a IList) *List 38 UnionByCustomKey(a IList, getKey func(a interface{}) string) *List 39 40 GroupByCount(count int) (r []*List) 41 GroupByCustomKey(getKey func(item interface{}) string) map[string]*List 42 }