ringbuffer

package module
v0.0.0-...-6296c9a Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: MIT Imports: 2 Imported by: 0

README

ringbuffer

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RingBuffer

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

func MakeRingBuffer

func MakeRingBuffer(size uint64) *RingBuffer

func (*RingBuffer) Done

func (ring *RingBuffer) Done(pos uint64) error

rewrite the pos value

pos,err := ring.Read() if err != nil { xxx } defer ring.Done(pos)

func (*RingBuffer) IsEmpty

func (ring *RingBuffer) IsEmpty() bool

func (*RingBuffer) IsFull

func (ring *RingBuffer) IsFull() bool

check buffer full

func (*RingBuffer) Read

func (ring *RingBuffer) Read() (uint64, interface{})

read the last value

func (*RingBuffer) Write

func (ring *RingBuffer) Write(i interface{}) error

loop write in buffer

Jump to

Keyboard shortcuts

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