Documentation
¶
Index ¶
- type Queue
- func (q *Queue) CutRangeItem()
- func (q *Queue) Dequeue() (interface{}, error)
- func (q *Queue) Enqueue(item interface{})
- func (q *Queue) Get(i int) (interface{}, error)
- func (q *Queue) Len() int
- func (q *Queue) Next() interface{}
- func (q *Queue) Peak() (interface{}, error)
- func (q *Queue) PeakAt(i int) (interface{}, error)
- func (q *Queue) ResetRange()
- func (q *Queue) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue represents the FIFO list of items
func (*Queue) CutRangeItem ¶ added in v1.1.0
func (q *Queue) CutRangeItem()
CutRangeItem removes the current item in the range: O(1)
func (*Queue) Dequeue ¶
Dequeue returns the first item from queue: O(1). if queue is empty, returns an error
func (*Queue) Enqueue ¶
func (q *Queue) Enqueue(item interface{})
Enqueue add the item to the queue: O(1)
func (*Queue) Get ¶
Get returns the item at the given index from the list: O(n) returns an error if queue empty/out of bounds
func (*Queue) Next ¶ added in v1.1.0
func (q *Queue) Next() interface{}
Next will return the next item in queue Returns nil if the range reaches the end of the queue: O(n)
func (*Queue) Peak ¶
Peak returns the next value in queue but does not remove from queue: O(1) returns error if queue empty
func (*Queue) PeakAt ¶
PeakAt returns the item at the index i from the queue: O(n) returns error if queue empty/out of bounds
func (*Queue) ResetRange ¶ added in v1.1.0
func (q *Queue) ResetRange()
ResetRange will set the seek to start: O(1)