Documentation ¶
Overview ¶
Package gset provides kinds of concurrent-safe(alternative) sets.
并发安全集合.
Index ¶
- type IntSet
- func (set *IntSet) Add(item int) *IntSet
- func (set *IntSet) BatchAdd(items []int) *IntSet
- func (set *IntSet) Clear()
- func (set *IntSet) Contains(item int) bool
- func (set *IntSet) Iterator(f func(v int) bool)
- func (set *IntSet) LockFunc(f func(m map[int]struct{}))
- func (set *IntSet) RLockFunc(f func(m map[int]struct{}))
- func (set *IntSet) Remove(key int)
- func (set *IntSet) Size() int
- func (set *IntSet) Slice() []int
- func (set *IntSet) String() string
- type InterfaceSet
- func (set *InterfaceSet) Add(item interface{}) *InterfaceSet
- func (set *InterfaceSet) BatchAdd(items []interface{}) *InterfaceSet
- func (set *InterfaceSet) Clear()
- func (set *InterfaceSet) Contains(item interface{}) bool
- func (set *InterfaceSet) Iterator(f func(v interface{}) bool)
- func (set *InterfaceSet) LockFunc(f func(m map[interface{}]struct{}))
- func (set *InterfaceSet) RLockFunc(f func(m map[interface{}]struct{}))
- func (set *InterfaceSet) Remove(key interface{})
- func (set *InterfaceSet) Size() int
- func (set *InterfaceSet) Slice() []interface{}
- func (set *InterfaceSet) String() string
- type Set
- type StringSet
- func (set *StringSet) Add(item string) *StringSet
- func (set *StringSet) BatchAdd(items []string) *StringSet
- func (set *StringSet) Clear()
- func (set *StringSet) Contains(item string) bool
- func (set *StringSet) Iterator(f func(v string) bool)
- func (set *StringSet) LockFunc(f func(m map[string]struct{}))
- func (set *StringSet) RLockFunc(f func(m map[string]struct{}))
- func (set *StringSet) Remove(key string)
- func (set *StringSet) Size() int
- func (set *StringSet) Slice() []string
- func (set *StringSet) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntSet ¶
type IntSet struct {
// contains filtered or unexported fields
}
type InterfaceSet ¶
type InterfaceSet struct {
// contains filtered or unexported fields
}
func NewInterfaceSet ¶
func NewInterfaceSet(unsafe ...bool) *InterfaceSet
func (*InterfaceSet) BatchAdd ¶
func (set *InterfaceSet) BatchAdd(items []interface{}) *InterfaceSet
批量添加
func (*InterfaceSet) Iterator ¶
func (set *InterfaceSet) Iterator(f func(v interface{}) bool)
给定回调函数对原始内容进行遍历,回调函数返回true表示继续遍历,否则停止遍历
func (*InterfaceSet) LockFunc ¶
func (set *InterfaceSet) LockFunc(f func(m map[interface{}]struct{}))
func (*InterfaceSet) RLockFunc ¶
func (set *InterfaceSet) RLockFunc(f func(m map[interface{}]struct{}))
Click to show internal directories.
Click to hide internal directories.