Documentation ¶
Overview ¶
Package queue implements a generic queue using a ring buffer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { // Len returns the number of elements available. Len() int // At returns the element at i. At(i int) interface{} // Set sets the element at i to x. // If x is nil, that element should be cleared. Set(i int, x interface{}) }
A type implementing Interface can be used to store elements in a Queue.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
A Queue wraps an Interface to provide queue operations.
func (*Queue) Len ¶
Len returns the length of the queue. This is different from the underlying interface's length.
func (*Queue) Peek ¶
func (q *Queue) Peek() interface{}
Peek returns the element at the front of the queue. If the queue is empty, Peek panics.
Click to show internal directories.
Click to hide internal directories.