Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrBucketIsFull = fmt.Errorf("bucket is fully")
)
Functions ¶
Types ¶
type Bucket ¶
type Bucket interface { // Add // 添加元素. Add(item interface{}) (total int, err error) // Count // 桶元素量. Count() int // IsEmpty // 是否为空. IsEmpty() bool // Pop // 取出1个元素. Pop() (item interface{}, exists bool) // Popn // 取出N个元素. // // 参数 limit 为需取出元素量. 返回 items 为已取出的元素列表, total 为取出前桶 // 内元素总量, count 为实际取出元素量. Popn(limit int) (items []interface{}, total, count int) // SetCapacity // 设置容量. SetCapacity(n int) Bucket }
Bucket 数据桶.
Click to show internal directories.
Click to hide internal directories.