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.
Click to show internal directories.
Click to hide internal directories.