Documentation ¶
Index ¶
- type Buffer
- func (r *Buffer) AddFirst(element interface{})
- func (r *Buffer) AddLast(element interface{})
- func (r *Buffer) Cap() int
- func (r *Buffer) Get(pos int) interface{}
- func (r *Buffer) GetFirst() interface{}
- func (r *Buffer) GetLast() interface{}
- func (r *Buffer) Len() int
- func (r *Buffer) RemoveFirst()
- func (r *Buffer) RemoveLast()
- func (r *Buffer) Reserve(n int)
- func (r *Buffer) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a deque maintained over a ring buffer.
Note: it is backed by a slice (unlike container/ring which is backed by a linked list).
func (*Buffer) AddFirst ¶
func (r *Buffer) AddFirst(element interface{})
AddFirst add element to the front of the Buffer and doubles it's underlying slice if necessary.
func (*Buffer) AddLast ¶
func (r *Buffer) AddLast(element interface{})
AddLast adds element to the end of the Buffer and doubles it's underlying slice if necessary.
func (*Buffer) GetFirst ¶
func (r *Buffer) GetFirst() interface{}
GetFirst returns an element at the front of the Buffer.
func (*Buffer) GetLast ¶
func (r *Buffer) GetLast() interface{}
GetLast returns an element at the front of the Buffer.
func (*Buffer) RemoveFirst ¶
func (r *Buffer) RemoveFirst()
RemoveFirst removes a single element from the front of the Buffer.
func (*Buffer) RemoveLast ¶
func (r *Buffer) RemoveLast()
RemoveLast removes a single element from the end of the Buffer.
Click to show internal directories.
Click to hide internal directories.