Versions in this module Expand all Collapse all v0 v0.3.3 Dec 9, 2020 v0.3.2 Mar 18, 2019 Changes in this version + type Ring struct + func NewRing(capacity int) *Ring + func (b *Ring) Capacity() int + func (b *Ring) Clear() + func (b *Ring) Empty() bool + func (b *Ring) FreeSize() int + func (b *Ring) Full() bool + func (b *Ring) Read(data []byte) int + func (b *Ring) Size() int + func (b *Ring) Write(data []byte) bool v0.3.1 Oct 24, 2018 Changes in this version + type AtomicFixedSizeRingBuf struct + A [2][]byte + Beg int + N int + Use int + func NewAtomicFixedSizeRingBuf(maxViewInBytes int) *AtomicFixedSizeRingBuf + func (b *AtomicFixedSizeRingBuf) Adopt(me []byte) + func (b *AtomicFixedSizeRingBuf) Advance(n int) + func (b *AtomicFixedSizeRingBuf) AdvanceBytesTwo(tb TwoBuffers) + func (b *AtomicFixedSizeRingBuf) Bytes(makeCopy bool) []byte + func (b *AtomicFixedSizeRingBuf) BytesTwo() TwoBuffers + func (b *AtomicFixedSizeRingBuf) ContigLen() int + func (b *AtomicFixedSizeRingBuf) Read(p []byte) (n int, err error) + func (b *AtomicFixedSizeRingBuf) ReadAndMaybeAdvance(p []byte, doAdvance bool) (n int, err error) + func (b *AtomicFixedSizeRingBuf) ReadFrom(r io.Reader) (n int64, err error) + func (b *AtomicFixedSizeRingBuf) ReadWithoutAdvance(p []byte) (n int, err error) + func (b *AtomicFixedSizeRingBuf) Readable() int + func (b *AtomicFixedSizeRingBuf) Reset() + func (b *AtomicFixedSizeRingBuf) Write(p []byte) (n int, err error) + func (b *AtomicFixedSizeRingBuf) WriteTo(w io.Writer) (n int64, err error) + type FixedSizeRingBuf struct + A [2][]byte + Beg int + N int + Readable int + Use int + func NewFixedSizeRingBuf(maxViewInBytes int) *FixedSizeRingBuf + func (b *FixedSizeRingBuf) Adopt(me []byte) + func (b *FixedSizeRingBuf) Advance(n int) + func (b *FixedSizeRingBuf) Bytes() []byte + func (b *FixedSizeRingBuf) BytesTwo(makeCopy bool) (first []byte, second []byte) + func (b *FixedSizeRingBuf) ContigLen() int + func (b *FixedSizeRingBuf) LegalPos() (a0, aLast, b0, bLast int) + func (b *FixedSizeRingBuf) Read(p []byte) (n int, err error) + func (b *FixedSizeRingBuf) ReadAndMaybeAdvance(p []byte, doAdvance bool) (n int, err error) + func (b *FixedSizeRingBuf) ReadFrom(r io.Reader) (n int64, err error) + func (b *FixedSizeRingBuf) ReadWithoutAdvance(p []byte) (n int, err error) + func (b *FixedSizeRingBuf) Reset() + func (b *FixedSizeRingBuf) Write(p []byte) (n int, err error) + func (b *FixedSizeRingBuf) WriteAndMaybeOverwriteOldestData(p []byte) (n int, err error) + func (b *FixedSizeRingBuf) WriteTo(w io.Writer) (n int64, err error) + func (f *FixedSizeRingBuf) Avail() int + func (f *FixedSizeRingBuf) DeleteMostRecentBytes(n int) + func (f *FixedSizeRingBuf) First() int + func (f *FixedSizeRingBuf) Kth(k int) int + func (f *FixedSizeRingBuf) Last() int + func (f *FixedSizeRingBuf) Nextpos(from int) int + func (f *FixedSizeRingBuf) Prevpos(from int) int + type Float64RingBuf struct + A []float64 + Beg int + N int + Readable int + func NewFloat64RingBuf(maxViewInBytes int) *Float64RingBuf + func (b *Float64RingBuf) Adopt(me []float64) + func (b *Float64RingBuf) Advance(n int) + func (b *Float64RingBuf) Earliest() (v float64, ok bool) + func (b *Float64RingBuf) ReadFloat64(p []float64) (n int, err error) + func (b *Float64RingBuf) ReadWithoutAdvance(p []float64) (n int, err error) + func (b *Float64RingBuf) Reset() + func (b *Float64RingBuf) TwoContig(makeCopy bool) (first []float64, second []float64) + func (b *Float64RingBuf) Write(p []float64) (n int, err error) + func (b *Float64RingBuf) WriteAndMaybeOverwriteOldestData(p []float64) (n int, err error) + type PointerRingBuf struct + A []interface{} + Beg int + N int + Readable int + func NewPointerRingBuf(sliceN int) *PointerRingBuf + func (b *PointerRingBuf) Adopt(me []interface{}) + func (b *PointerRingBuf) Advance(n int) + func (b *PointerRingBuf) Push(p []interface{}) (n int, err error) + func (b *PointerRingBuf) PushAndMaybeOverwriteOldestData(p []interface{}) (n int, err error) + func (b *PointerRingBuf) ReadPtrs(p []interface{}) (n int, err error) + func (b *PointerRingBuf) ReadWithoutAdvance(p []interface{}) (n int, err error) + func (b *PointerRingBuf) Reset() + func (b *PointerRingBuf) TwoContig() (first []interface{}, second []interface{}) + func (b *PointerRingBuf) WritePtrs(p []interface{}) (n int, err error) + type TwoBuffers struct + First []byte + Second []byte v0.3.0 Jul 29, 2018 Changes in this version + var ErrFileExists = errors.New("buffer: log file already exists") + var ErrNotArrived = errors.New("buffer: data has not yet arrived") + var ErrPartialData = errors.New("buffer: partial data returned") + func GetLittleEndianUint32(b []byte, offset int) uint32 + func GetLittleEndianUint64(b []byte, offset int) uint64 + func PutLittleEndianUint32(b []byte, offset int, v uint32) + func PutLittleEndianUint64(b []byte, offset int, v uint64) + type Buffer struct + func Load(filename string) (*Buffer, error) + func New(capacity int, filename string) (*Buffer, error) + func (b *Buffer) Close() error + func (b *Buffer) DontNeed(c Cursor) error + func (b *Buffer) Insert(data []byte) error + func (b *Buffer) Len() uint64 + func (b *Buffer) Read(data []byte, c Cursor) (n int, next Cursor, err error) + func (b *Buffer) ReadFirst(data []byte) (n int, next Cursor, err error) + func (b *Buffer) Remaining(from Cursor) uint64 + func (b *Buffer) Unmap() + type Cursor struct + func (c Cursor) Seq() uint64