https://github.com/floatdrop/fifo
https://github.com/floatdrop/fifo
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/floatdrop/fifo
- Owner: floatdrop
- License: mit
- Created: 2022-03-28T08:35:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-30T08:27:08.000Z (over 3 years ago)
- Last Synced: 2025-03-14T01:31:43.681Z (4 months ago)
- Language: Go
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# fifo
[](https://pkg.go.dev/github.com/floatdrop/fifo)
[](https://github.com/floatdrop/fifo/actions/workflows/ci.yml)

[](https://goreportcard.com/report/github.com/floatdrop/fifo)Thread safe GoLang fixed size FIFO with O(1) `Get`.
## Example
```go
import (
"fmt""github.com/floatdrop/fifo"
)func main() {
cache := fifo.New[string, int](256)cache.Push("Hello", 5)
if e := cache.Get("Hello"); e != nil {
fmt.Println(*e)
// Output: 5
}
}
```