Documentation ¶
Index ¶
- Variables
- func Run(popCount int, duration time.Duration, lock sync.Locker, qu Queue, ...)
- type Circular
- func (cr *Circular) Add(it interface{}) error
- func (cr *Circular) Empty() bool
- func (cr *Circular) Find(fn IndexFunc) (interface{}, int)
- func (cr *Circular) Len() int
- func (cr *Circular) Next(index int) (interface{}, int)
- func (cr *Circular) Peek() interface{}
- func (cr *Circular) Pop() interface{}
- func (cr *Circular) Reset()
- type IPriorityItem
- type IndexFunc
- type LQueue
- func (lq *LQueue) Add(val interface{}) error
- func (lq *LQueue) AddTail(val interface{}) error
- func (lq *LQueue) Cap() int
- func (lq *LQueue) Empty() bool
- func (lq *LQueue) Find(fn IndexFunc) (interface{}, int)
- func (lq *LQueue) Len() int
- func (lq *LQueue) Peek() interface{}
- func (lq *LQueue) Pop() interface{}
- func (lq *LQueue) ToList() []interface{}
- type Node
- type PQueue
- func (pq *PQueue) Add(elem interface{}) error
- func (pq *PQueue) Empty() bool
- func (pq *PQueue) Find(fn IndexFunc) (interface{}, int)
- func (pq *PQueue) Head() IPriorityItem
- func (pq PQueue) Len() int
- func (pq PQueue) Less(i, j int) bool
- func (pq *PQueue) Peek() interface{}
- func (pq *PQueue) Pop() interface{}
- func (pq *PQueue) Push(x interface{})
- func (pq *PQueue) Remove(i int) interface{}
- func (pq PQueue) Swap(i, j int)
- type PriorityItem
- type Queue
- type ResetFunc
- type SQueue
- func (sq *SQueue) Add(elem interface{}) error
- func (sq *SQueue) Empty() bool
- func (sq *SQueue) Find(fn IndexFunc) (interface{}, int)
- func (sq *SQueue) Get(index int) interface{}
- func (sq *SQueue) Len() int
- func (sq *SQueue) Less(i, j int) bool
- func (sq *SQueue) Peek() interface{}
- func (sq *SQueue) Pop() interface{}
- func (sq *SQueue) Push(elem interface{})
- func (sq *SQueue) Swap(i, j int)
- func (sq *SQueue) ToList() []interface{}
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIsFull = errors.New("is full")
View Source
var ErrIsReleased = errors.New("size is zero")
View Source
var PriorityItemType = reflect.TypeOf((*IPriorityItem)(nil)).Elem()
Functions ¶
Types ¶
type Circular ¶
type Circular struct {
// contains filtered or unexported fields
}
func NewCircular ¶
type IPriorityItem ¶
type IPriorityItem interface { GValue() interface{} PValue() int64 }
func ConvertPriorityItem ¶
func ConvertPriorityItem(elem interface{}) IPriorityItem
type LQueue ¶
type LQueue struct {
// contains filtered or unexported fields
}
type Node ¶
type Node []IPriorityItem
type PQueue ¶
type PQueue []IPriorityItem
func (*PQueue) Head ¶
func (pq *PQueue) Head() IPriorityItem
Head returns the first item of a PQueue without removing it.
func (*PQueue) Pop ¶
func (pq *PQueue) Pop() interface{}
Pop implements the heap.Interface.Pop. Removes and returns element Len() - 1.
func (*PQueue) Push ¶
func (pq *PQueue) Push(x interface{})
Push implements the heap.Interface.Push. Adds x as element Len().
type PriorityItem ¶
type PriorityItem struct { Value interface{} Priority int64 }
func (*PriorityItem) GValue ¶
func (it *PriorityItem) GValue() interface{}
func (*PriorityItem) PValue ¶
func (it *PriorityItem) PValue() int64
type SQueue ¶
type SQueue struct {
// contains filtered or unexported fields
}
func (*SQueue) Push ¶
func (sq *SQueue) Push(elem interface{})
Push implements the heap.Interface.Push. Adds x as element Len().
Click to show internal directories.
Click to hide internal directories.