Help us shape the future of Go! Take the 2026 Go Developer Survey

ringbuf

package module
v0.0.0-...-e44ed7f Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2015 License: GPL-3.0 Imports: 1 Imported by: 3

README

Ringbuf

Ringbuf is a simple lock-free implementation of a ringbuffer for the go language.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes

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

func NewBytes

func NewBytes(r *Ringbuf) *Bytes

func NewRingbufBytes

func NewRingbufBytes(size int64) *Bytes

func (*Bytes) Close

func (rb *Bytes) Close()

func (*Bytes) EOF

func (rb *Bytes) EOF()

func (*Bytes) Ringbuf

func (rb *Bytes) Ringbuf() *Ringbuf

func (*Bytes) Write

func (rb *Bytes) Write(b []byte) (int, error)

type Data

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

type Reader

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

func NewReader

func NewReader(r *Ringbuf) *Reader

func (*Reader) Cancel

func (r *Reader) Cancel()

func (*Reader) GetOptions

func (r *Reader) GetOptions() *ReaderOptions

func (*Reader) ReadCh

func (r *Reader) ReadCh() <-chan interface{}

func (*Reader) SetOptions

func (r *Reader) SetOptions(opts *ReaderOptions)

Warning: this is not a safe operation. Do not set the configuration options after aquiring a reading channel with ReadCh().

type ReaderBytes

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

func NewReaderBytes

func NewReaderBytes(r *Bytes) *ReaderBytes

func (*ReaderBytes) Read

func (r *ReaderBytes) Read(p []byte) (bread int, err error)

type ReaderOptions

type ReaderOptions struct {
	NoStarve bool
}

type Ringbuf

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

func NewRingbuf

func NewRingbuf(size int64) *Ringbuf

func (*Ringbuf) Cancel

func (r *Ringbuf) Cancel()

func (*Ringbuf) EOF

func (r *Ringbuf) EOF()

func (*Ringbuf) Run

func (r *Ringbuf) Run()

func (*Ringbuf) Write

func (r *Ringbuf) Write(data interface{})

Safe write via channel.

type Write

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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