Documentation
¶
Index ¶
- type BytesIterationer
- type DBSet
- func (s *DBSet) Add(bytes ...[]byte) *DBSet
- func (s *DBSet) Clear() *DBSet
- func (s *DBSet) Complement(full *DBSet) *DBSet
- func (s *DBSet) Dir(dir string) *DBSet
- func (s *DBSet) Empty() bool
- func (s *DBSet) Has(bytes ...[]byte) bool
- func (s *DBSet) HasAny(bytes ...[]byte) bool
- func (s *DBSet) Intersect(other *DBSet) *DBSet
- func (s *DBSet) Iteration() BytesIterationer
- func (s *DBSet) Release() *DBSet
- func (s *DBSet) Remove(bytes ...[]byte) *DBSet
- func (s *DBSet) Size() int
- func (s *DBSet) Union(other *DBSet) *DBSet
- type Set
- type StringIteration
- type StringIterationer
- type StringSet
- func (s *StringSet) Add(strings ...string) *StringSet
- func (s *StringSet) Clear() *StringSet
- func (s *StringSet) Complement(full *StringSet) *StringSet
- func (s *StringSet) Empty() bool
- func (s *StringSet) Has(strings ...string) bool
- func (s *StringSet) HasAny(strings ...string) bool
- func (s *StringSet) Intersect(other *StringSet) *StringSet
- func (s *StringSet) Iteration() StringIterationer
- func (s *StringSet) Remove(strings ...string) *StringSet
- func (s *StringSet) Size() int
- func (s *StringSet) Union(other *StringSet) *StringSet
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BytesIterationer ¶
type BytesIterationer interface {
// Next 是否有下一个数据.
Next() bool
// Key 获取数据.
Key() []byte
// Release 释放迭代.
Release()
}
BytesIterationer 字节迭代器接口.
type DBSet ¶
type DBSet struct {
// contains filtered or unexported fields
}
DBSet 基于数据库的集合.
Example ¶
s := NewDBSet().Add([]byte("str1"), []byte("str2"))
defer s.Release()
i := s.Iteration()
defer i.Release()
for i.Next() {
fmt.Println("value:", i.Key())
}
Output: value: [115 116 114 49] value: [115 116 114 50]
type Set ¶
type Set interface {
// Union 合并.
Union(other Set) Set
// Intersect 交集.
Intersect(other Set) Set
// Empty 集合是否为空.
Empty() bool
// Clear 清空.
Clear() Set
}
Set 接口.
type StringIteration ¶
type StringIteration struct {
// contains filtered or unexported fields
}
StringIteration 字符串迭代器.
type StringIterationer ¶
StringIterationer 字符串迭代器接口.
Click to show internal directories.
Click to hide internal directories.