Documentation ¶
Index ¶
- Constants
- Variables
- type HeapQueue
- func (pq *HeapQueue) Close()
- func (pq *HeapQueue) Len() int
- func (pq *HeapQueue) Length() int
- func (pq *HeapQueue) Less(i, j int) bool
- func (pq *HeapQueue) Pop() any
- func (pq *HeapQueue) Push(x any)
- func (pq *HeapQueue) Read() (any, error)
- func (pq *HeapQueue) Swap(i, j int)
- func (pq *HeapQueue) Write(priority Priority, value any) error
- type HeapQueueItem
- type Priority
- type PriorityQueue
Constants ¶
View Source
const ( // High indicates the highest priority. High = Priority(0) // Mid indicates the medium priority. Mid = Priority(1) // Low indicates the lowest priority. Low = Priority(2) )
Variables ¶
View Source
var ( // ErrEmptyQueue is returned on attempt to read from an empty queue. ErrEmptyQueue = errors.New("attempt to read from an empty queue") // ErrClosed is returned when a queue is closed. ErrClosed = errors.New("queue is closed") )
Functions ¶
This section is empty.
Types ¶
type HeapQueue ¶
A HeapQueue implements priority.Interface using container/heap and holds Items.
type HeapQueueItem ¶
type HeapQueueItem struct {
// contains filtered or unexported fields
}
An HeapQueueItem is something we manage in a priority queue.
type Priority ¶
type Priority int
Priority is the type that indicates the priority of different queues.
Click to show internal directories.
Click to hide internal directories.