Documentation ¶
Index ¶
- Variables
- func Run(c Call, lock sync.Locker, qu Queue)
- type Call
- type Capacity
- func (sq *Capacity) Add(elem any) error
- func (sq *Capacity) Empty() bool
- func (sq *Capacity) Find(fn IndexFunc) (any, int)
- func (sq *Capacity) Get(index int) any
- func (sq *Capacity) Len() int
- func (sq *Capacity) Less(i, j int) bool
- func (sq *Capacity) Peek() any
- func (sq *Capacity) Pop() any
- func (sq *Capacity) Push(elem any)
- func (sq *Capacity) Swap(i, j int)
- func (sq *Capacity) ToList() []any
- type Circular
- type IPriority
- type IndexFunc
- type Linked
- func (lq *Linked) Add(val any) error
- func (lq *Linked) AddTail(val any) error
- func (lq *Linked) Cap() int
- func (lq *Linked) Empty() bool
- func (lq *Linked) Find(fn IndexFunc) (any, int)
- func (lq *Linked) Len() int
- func (lq *Linked) Peek() any
- func (lq *Linked) Pop() any
- func (lq *Linked) ToList() []any
- type Node
- type Priority
- func (pq *Priority) Add(elem any) error
- func (pq *Priority) Empty() bool
- func (pq *Priority) Find(fn IndexFunc) (any, int)
- func (pq *Priority) Head() IPriority
- func (pq *Priority) Len() int
- func (pq *Priority) Less(i, j int) bool
- func (pq *Priority) Peek() any
- func (pq *Priority) Pop() any
- func (pq *Priority) Push(x any)
- func (pq *Priority) Remove(i int) any
- func (pq *Priority) Swap(i, j int)
- type Queue
- type ResetFunc
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 PriorityType = reflect.TypeOf((*IPriority)(nil)).Elem()
Functions ¶
Types ¶
type Capacity ¶ added in v1.20.115
type Capacity struct {
// contains filtered or unexported fields
}
Capacity 固定长度的队列
func NewCapacity ¶ added in v1.20.115
func (*Capacity) Push ¶ added in v1.20.115
Push implements the heap.Interface.Push. Adds x as element Len().
type Circular ¶
type Circular struct {
// contains filtered or unexported fields
}
Circular 环型队列
func NewCircular ¶
type IPriority ¶ added in v1.3.58
func NewPriorityItem ¶ added in v1.3.58
type Linked ¶ added in v1.20.115
type Linked struct {
// contains filtered or unexported fields
}
Linked 链表式队列
type Priority ¶ added in v1.20.115
type Priority struct {
// contains filtered or unexported fields
}
Priority 优先级
func NewPriority ¶ added in v1.20.115
func NewPriority() *Priority
func (*Priority) Head ¶ added in v1.20.115
Head returns the first item of a Priority without removing it.
func (*Priority) Pop ¶ added in v1.20.115
Pop implements the heap.Interface.Pop. Removes and returns element Len() - 1.
func (*Priority) Push ¶ added in v1.20.115
Push implements the heap.Interface.Push. Adds x as element Len().
Click to show internal directories.
Click to hide internal directories.