srbuf

package module
v0.0.0-...-31ac8df Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2016 License: MIT Imports: 0 Imported by: 2

README

srbuf

Simple Ring Buffer in Go

Small, lightweight, efficient, and no-nonsense. Geared towards single byte read and write actions. Buffer size is static and declared when buffer is instantiated. Data overflow will simply overwrite oldest bytes. It is up to user application to read from buffer often enough to avoid overflow.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleRingBuff

type SimpleRingBuff struct {
	// contains filtered or unexported fields
}

func Create

func Create(bufSize int) *SimpleRingBuff

func (*SimpleRingBuff) AvailByteCnt

func (b *SimpleRingBuff) AvailByteCnt() int

func (*SimpleRingBuff) Clear

func (b *SimpleRingBuff) Clear()

func (*SimpleRingBuff) GetByte

func (b *SimpleRingBuff) GetByte() byte

func (*SimpleRingBuff) GetBytes

func (b *SimpleRingBuff) GetBytes(cnt int) []byte

Return Slice of all available bytes

func (*SimpleRingBuff) PeekBytes

func (b *SimpleRingBuff) PeekBytes(cnt int) []byte

Return Slice of all available bytes without incrementing pointers

func (*SimpleRingBuff) PutByte

func (b *SimpleRingBuff) PutByte(data byte)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL