Documentation ¶
Index ¶
- type CycleQueue
- type FifoQueue
- func (s *FifoQueue) Append(item interface{}) bool
- func (s *FifoQueue) Capacity() int
- func (s *FifoQueue) Empty() bool
- func (s *FifoQueue) First() interface{}
- func (s *FifoQueue) Full() bool
- func (s *FifoQueue) Last() interface{}
- func (s *FifoQueue) Pop() interface{}
- func (s *FifoQueue) Shift() interface{}
- func (s *FifoQueue) Size() int
- type MultiMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CycleQueue ¶
type CycleQueue struct { Mutex sync.Mutex Attach interface{} Nodes []interface{} Capacity int Counting int }
CycleQueue is a basic FIFO queue based on a circular list.
func (*CycleQueue) Add ¶
func (q *CycleQueue) Add(n interface{})
Add adds a node to the cycle queue.
func (*CycleQueue) FetchAll ¶
func (q *CycleQueue) FetchAll(index int) ([]interface{}, int)
FetchAll ...
type FifoQueue ¶
type FifoQueue struct {
// contains filtered or unexported fields
}
FifoQueue is a head-tail linked list data structure implementation. It is based on a doubly linked list container, so that every operations time complexity is O(1).
every operations over an instiated Deque are synchronized and safe for concurrent usage.
func NewFifoQueue ¶
NewFifoQueue creates a Deque with the specified capacity limit.
func (*FifoQueue) Append ¶
Append inserts element at the back of the Deque in a O(1) time complexity, returning true if successful or false if the deque is at capacity.
func (*FifoQueue) First ¶
func (s *FifoQueue) First() interface{}
First returns the first value stored in the deque in a O(1) time complexity
func (*FifoQueue) Last ¶
func (s *FifoQueue) Last() interface{}
Last returns the last value stored in the deque in a O(1) time complexity
func (*FifoQueue) Pop ¶
func (s *FifoQueue) Pop() interface{}
Pop removes the last element of the deque in a O(1) time complexity