Documentation ¶
Index ¶
- Variables
- type RingBuf
- func (rb *RingBuf) Begin() int64
- func (rb *RingBuf) Dump() []byte
- func (rb *RingBuf) End() int64
- func (rb *RingBuf) EqualAt(p []byte, off int64) bool
- func (rb *RingBuf) Evacuate(off int64, length int) (newOff int64)
- func (rb *RingBuf) ReadAt(p []byte, off int64) (n int, err error)
- func (rb *RingBuf) Resize(newSize int)
- func (rb *RingBuf) Size() int64
- func (rb *RingBuf) Skip(length int64)
- func (rb *RingBuf) String() string
- func (rb *RingBuf) Write(p []byte) (n int, err error)
- func (rb *RingBuf) WriteAt(p []byte, off int64) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOutOfRange = errors.New("out of range")
Functions ¶
This section is empty.
Types ¶
type RingBuf ¶
type RingBuf struct {
// contains filtered or unexported fields
}
Ring buffer has a fixed size, when data exceeds the size, old data will be overwritten by new data. It only contains the data in the stream from begin to end
func NewRingBuf ¶
func (*RingBuf) Evacuate ¶
Evacuate read the data at off, then write it to the the data stream, Keep it from being overwritten by new data.
Click to show internal directories.
Click to hide internal directories.