1
0
Fork
You've already forked go-sequence
0
No description
  • Go 100%
2023年03月11日 10:05:35 -05:00
.gitignore Initial commit 2021年12月26日 11:09:55 -05:00
go.mod Updates for codeberg. 2023年03月11日 10:05:35 -05:00
go.sum Initial commit of go-sequence 2021年12月26日 11:27:10 -05:00
LICENSE Initial commit 2021年12月26日 11:09:55 -05:00
Readme.md Updates for codeberg. 2023年03月11日 10:05:35 -05:00
seq.go Initial commit of go-sequence 2021年12月26日 11:27:10 -05:00
seq_test.go Initial commit of go-sequence 2021年12月26日 11:27:10 -05:00

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

seq.go

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)*Seq

New returns an initialized Seq suitable for most cases

func NewWithHashIDLength

funcNewWithHashIDLength(start,hashIDlengthint)*Seq

NewWithHashIDLength returns an initilized Seq with the minimum hashID length set as specified

func (*Seq) Next

func(s*Seq)Next()int

Next returns the next int in the sequence

func (*Seq) NextHashID

func(s*Seq)NextHashID()string

NextHashID returns the hashID-encoded value of the next int in the sequence


Generated by godoc2md