Documentation
¶
Index ¶
- type Heap
- func (h *Heap) Add(obj any) error
- func (h *Heap) Delete(obj any) error
- func (h *Heap) Get(obj any) (any, bool, error)
- func (h *Heap) GetByKey(key string) (any, bool, error)
- func (h *Heap) Len() int
- func (h *Heap) List() []any
- func (h *Heap) Peek() any
- func (h *Heap) Pop() (any, error)
- func (h *Heap) Update(obj any) error
- type KeyError
- type KeyFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Heap ¶
type Heap struct {
// contains filtered or unexported fields
}
Heap is a producer/consumer queue that implements a heap data structure. It can be used to implement priority queues and similar data structures.
func (*Heap) Add ¶
Add inserts an item, and puts it in the queue. The item is updated if it already exists.
Click to show internal directories.
Click to hide internal directories.