bytebuffer

package
v0.0.0-...-104e4b5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2013 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Number of overhead bytes for each data item
	SlotOverhead = 2

	// Minimum slot size
	MinSlotSize = SlotOverhead

	// Maximum data size, -SlotOverhead because we are using 2 bytes to store the size of the data
	MaxDataSize = 64*1024 - SlotOverhead

	// Maximum number of slots the data item can occupy
	MaxDataSlots = MaxDataSize / MinSlotSize

	MaxProducerCount = 1
)

Variables

View Source
var (
	ErrDataInvalid              = fmt.Errorf("bytebuffer: Data Invalid")
	ErrDataExceedsMaxSize       = fmt.Errorf("bytebuffer: Data Size Exceeds MaxDataSize")
	ErrDataExceedsMaxSlots      = fmt.Errorf("bytebuffer: Data Size Exceeds MaxDataSlots")
	ErrSlotSizeTooSmall         = fmt.Errorf("bytebuffer: Slot Size Is Too Small")
	ErrNotPowerOfTwo            = fmt.Errorf("bytebuffer: Slot Count Must Be Power of Two")
	ErrMaxProducerCountExceeded = fmt.Errorf("bytebuffer: This ringbuffer only allows %d producer(s)", MaxProducerCount)
	ErrMaxDataSlotsExceeded     = fmt.Errorf("bytebuffer: Max Data Slots (%d) Exceeded", MaxDataSlots)
)

Functions

func New

func New(slotSize, slotCount int) (ringbuffer.RingBuffer, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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