Documentation ¶
Index ¶
- type BytesQueue
- func (q *BytesQueue) Capacity() int
- func (q *BytesQueue) CheckGet(index int) error
- func (q *BytesQueue) Get(index int) ([]byte, error)
- func (q *BytesQueue) Len() int
- func (q *BytesQueue) Peek() ([]byte, error)
- func (q *BytesQueue) Pop() ([]byte, error)
- func (q *BytesQueue) Push(data []byte) (int, error)
- func (q *BytesQueue) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BytesQueue ¶
type BytesQueue struct {
// contains filtered or unexported fields
}
BytesQueue is a non-thread safe queue type of fifo based on bytes array. For every push operation index of entry is returned. It can be used to read the entry later
func NewBytesQueue ¶
func NewBytesQueue(initialCapacity int, maxCapacity int, verbose bool) *BytesQueue
NewBytesQueue initialize new bytes queue. Initial capacity is used in bytes array allocation When verbose flag is set then information about memory allocation are printed
func (*BytesQueue) Capacity ¶
func (q *BytesQueue) Capacity() int
Capacity returns number of allocated bytes for queue
func (*BytesQueue) CheckGet ¶ added in v1.2.1
func (q *BytesQueue) CheckGet(index int) error
CheckGet checks if an entry can be read from index
func (*BytesQueue) Get ¶
func (q *BytesQueue) Get(index int) ([]byte, error)
Get reads entry from index
func (*BytesQueue) Peek ¶
func (q *BytesQueue) Peek() ([]byte, error)
Peek reads the oldest entry from list without moving head pointer
func (*BytesQueue) Pop ¶
func (q *BytesQueue) Pop() ([]byte, error)
Pop reads the oldest entry from queue and moves head pointer to the next one
Click to show internal directories.
Click to hide internal directories.