Go
Need help with circbuf?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.
armon

Description

Golang circular (ring) buffer

138 Stars 20 Forks MIT License 9 Commits 0 Opened issues

Services available

Need anything else?

circbuf

This repository provides the

circbuf
package. This provides a
Buffer
object which is a circular (or ring) buffer. It has a fixed size, but can be written to infinitely. Only the last
size
bytes are ever retained. The buffer implements the
io.Writer
interface.

Documentation

Full documentation can be found on Godoc

Usage

The

circbuf
package is very easy to use:
buf, _ := NewBuffer(6)
buf.Write([]byte("hello world"))

if string(buf.Bytes()) != " world" { panic("should only have last 6 bytes!") }

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.