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) Foreach(fn IndexFunc)
- func (sq *Capacity) Get(index int) any
- func (sq *Capacity) Len() int
- func (sq *Capacity) Peek() any
- func (sq *Capacity) Pop() any
- func (sq *Capacity) Push(elem any) error
- func (sq *Capacity) SetLocation(l *time.Location)
- func (sq *Capacity) ToList() []any
- type Circular
- func (cr *Circular) Add(it any) error
- func (cr *Circular) Empty() bool
- func (cr *Circular) Find(fn IndexFunc) (any, int)
- func (cr *Circular) Foreach(fn IndexFunc)
- func (cr *Circular) Len() int
- func (cr *Circular) Next(index int) (any, int)
- func (cr *Circular) Peek() any
- func (cr *Circular) Pop() any
- func (cr *Circular) Push(it any) error
- func (cr *Circular) Reset()
- type GeneratePriorityFn
- 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) Foreach(fn IndexFunc)
- func (lq *Linked) Len() int
- func (lq *Linked) Peek() any
- func (lq *Linked) Pop() any
- func (lq *Linked) Push(val any) error
- func (lq *Linked) ToList() []any
- 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) Foreach(fn IndexFunc)
- func (pq *Priority) Head() IPriority
- func (pq *Priority) Len() int
- func (pq *Priority) Peek() any
- func (pq *Priority) Pop() any
- func (pq *Priority) Push(x any) error
- func (pq *Priority) Remove(i int) any
- func (pq *Priority) SetLocation(l *time.Location)
- 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) SetLocation ¶ added in v1.21.3
type Circular ¶
type Circular struct {
// contains filtered or unexported fields
}
Circular 环型队列
func NewCircular ¶
type GeneratePriorityFn ¶ added in v1.21.3
type GeneratePriorityFn func() int64
func WithUnixNano ¶ added in v1.21.3
func WithUnixNano(l *time.Location) GeneratePriorityFn
type IPriority ¶ added in v1.3.58
func NewPriorityItem ¶ added in v1.3.58
func NewPriorityItem(elem any, fn GeneratePriorityFn) IPriority
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) Remove ¶ added in v1.20.115
Remove removes and returns the element at index i from the Priority.
func (*Priority) SetLocation ¶ added in v1.21.3
Click to show internal directories.
Click to hide internal directories.