gitee.com/zhongguo168a/gocodes@v0.0.0-20230609140523-e1828349603f/datax/setx/iface.go (about) 1 package setx 2 3 type ISetObject[K comparable, V any] interface { 4 Reset(data map[K]V) 5 Set(key K, value V) 6 SetByMap(m map[K]V) 7 SetBySet(other *SetObject[K, V]) 8 Get(key K) (V, bool) 9 Combine(other *SetObject[K, V]) *SetObject[K, V] 10 Delete(key K) 11 Exists(key K) bool 12 Length() int 13 Pop(key K) (v V, exists bool) 14 IsEmpty() bool 15 Items() (items []V) 16 Keys() (keys []K) 17 ForRange(handler func(key K, val V) (err error)) error 18 First(handler func(key K, val V) bool) (result V) 19 Filter(cond func(key K, val V) bool) *SetObject[K, V] 20 }