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

About the developer

armon
147 Stars 21 Forks MIT License 9 Commits 0 Opened issues

Description

Golang circular (ring) buffer

Services available

!
?

Need anything else?

Contributors list

# 4,493
Go
vault
Amazon ...
Terrafo...
6 commits
# 3,915
Ruby
Terrafo...
Go
terrafo...
1 commit
# 617
Ruby
Go
Terrafo...
Vagrant
1 commit

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.