Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RingBuffer ¶
type RingBuffer struct {
// contains filtered or unexported fields
}
RingBuffer is a circular buffer that implement io.Writer interface.
func New ¶
func New(size int) *RingBuffer
New returns a new RingBuffer whose buffer has the given size.
func (*RingBuffer) Bytes ¶
func (r *RingBuffer) Bytes() []byte
Bytes returns all available read bytes.
func (*RingBuffer) Capacity ¶
func (r *RingBuffer) Capacity() int
Capacity returns the size of the underlying buffer.
func (*RingBuffer) Reset ¶
func (r *RingBuffer) Reset()
Reset the read pointer and writer pointer to zero.
Click to show internal directories.
Click to hide internal directories.