Documentation
¶
Index ¶
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) 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.