Skip to content

A circular buffer implementation in Go with support for generics.

License

Notifications You must be signed in to change notification settings

cattlecloud/circlebuffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

circlebuffer

Go Reference License Build

circlebuffer provides a modern circular buffer Go library with support for generics.

Getting Started

The circlebuffer package can be added to a project with go-get.

go get cattlecloud.net/go/circlebuffer@latest
import "cattlecloud.net/go/circlebuffer"

Examples

Inserting elements
buf := circlebuffer.New[string](1024)
buf.Insert("alice")
buf.Insert("bob")
Iterating elements
for item := range buf.All() {
  // ...
}

License

The cattlecloud.net/go/circlebuffer module is open source under the BSD license.