No description
| .gitignore | Initial commit | |
| go.mod | Updates for codeberg. | |
| go.sum | Initial commit of go-sequence | |
| LICENSE | Initial commit | |
| Readme.md | Updates for codeberg. | |
| seq.go | Initial commit of go-sequence | |
| seq_test.go | Initial commit of go-sequence | |
sequence
import "codeberg.org/mgkeller/go-sequence"
Overview
Package sequence provides a performant goro-safe incrementing sequencer, with randomized HashID-encoding of the values to work as a font of IDs for errors, requests, etc.
Index
Package files
type Seq
typeSeqstruct{// contains filtered or unexported fields}Seq is a sequencer. It should never be used by default, and instead obtained via a New function
func New
funcNew(startint)*SeqNew returns an initialized Seq suitable for most cases
func NewWithHashIDLength
funcNewWithHashIDLength(start,hashIDlengthint)*SeqNewWithHashIDLength returns an initilized Seq with the minimum hashID length set as specified
func (*Seq) Next
func(s*Seq)Next()intNext returns the next int in the sequence
func (*Seq) NextHashID
func(s*Seq)NextHashID()stringNextHashID returns the hashID-encoded value of the next int in the sequence
Generated by godoc2md