Documentation
¶
Index ¶
- type DelayedBuffer
- type SeekerBuffer
- func (b *SeekerBuffer) Bytes() []byte
- func (b *SeekerBuffer) Close() error
- func (b *SeekerBuffer) Len() int
- func (b *SeekerBuffer) Read(p []byte) (int, error)
- func (b *SeekerBuffer) Rewind() error
- func (b *SeekerBuffer) Seek(offset int64, whence int) (int64, error)
- func (b *SeekerBuffer) Write(p []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DelayedBuffer ¶
type DelayedBuffer struct {
// contains filtered or unexported fields
}
DelayedBuffer is the buffer that holds items until either the buffer filled or a specified time limit is reached
func NewDelayedBuffer ¶
func (*DelayedBuffer) Close ¶
func (b *DelayedBuffer) Close() error
func (*DelayedBuffer) Put ¶
func (b *DelayedBuffer) Put(items ...[]byte)
type SeekerBuffer ¶
type SeekerBuffer struct {
// contains filtered or unexported fields
}
Buffer is a ReadWriteCloser that supports seeking. It's intended to replicate the functionality of bytes.Buffer that I use in my projects.
Note that the seeking is limited to the read marker; all writes are append-only.
func NewSeekerBuffer ¶
func NewSeekerBuffer(data []byte) *SeekerBuffer
func (*SeekerBuffer) Bytes ¶
func (b *SeekerBuffer) Bytes() []byte
Bytes returns the underlying bytes from the current position.
func (*SeekerBuffer) Close ¶
func (b *SeekerBuffer) Close() error
Close clears all the data out of the buffer and sets the read position to 0.
func (*SeekerBuffer) Len ¶
func (b *SeekerBuffer) Len() int
Len returns the length of data remaining to be read.
func (*SeekerBuffer) Rewind ¶
func (b *SeekerBuffer) Rewind() error
Rewind resets the read pointer to 0.
Click to show internal directories.
Click to hide internal directories.