• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.gitignoreH A D14-Feb-2019252

LICENSEH A D14-Feb-20191.1 KiB

README.mdH A D14-Feb-2019611

circbuf.goH A D14-Feb-20192.1 KiB

circbuf_test.goH A D14-Feb-20193.3 KiB

go.modH A D14-Feb-201932

README.md

1circbuf
2=======
3
4This repository provides the `circbuf` package. This provides a `Buffer` object
5which is a circular (or ring) buffer. It has a fixed size, but can be written
6to infinitely. Only the last `size` bytes are ever retained. The buffer implements
7the `io.Writer` interface.
8
9Documentation
10=============
11
12Full documentation can be found on [Godoc](http://godoc.org/github.com/armon/circbuf)
13
14Usage
15=====
16
17The `circbuf` package is very easy to use:
18
19```go
20buf, _ := NewBuffer(6)
21buf.Write([]byte("hello world"))
22
23if string(buf.Bytes()) != " world" {
24    panic("should only have last 6 bytes!")
25}
26
27```
28
29