https://github.com/twiny/poxa
structured way to manage and rotate through a collection data structure.
https://github.com/twiny/poxa
Last synced: over 1 year ago
JSON representation
structured way to manage and rotate through a collection data structure.
- Host: GitHub
- URL: https://github.com/twiny/poxa
- Owner: twiny
- License: unlicense
- Created: 2023-08-04T21:35:50.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-16T00:51:21.000Z (almost 3 years ago)
- Last Synced: 2025-02-09T17:42:41.038Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spinner
## Overview
Spinner is a simple and efficient Go package that provides a rotating/spinning data structure. It is implemented using Go's new generics feature, allowing it to hold elements of any type. Under the hood, it uses Go's `container/ring` package to maintain a circular list of elements.
## Usage
```bash
go get github.com/twiny/poxa
```
```go
package main
import (
"fmt"
"github.com/twiny/poxa"
)
func main() {
sp := poxa.NewSpinner[int](1, 2, 3)
for i := 0; i < 5; i++ {
fmt.Println(sp.Next())
}
}
```