Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sequence

import "github.com/cognusion/go-sequence"

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.

seq.go

type Seq struct {
    // 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(start int) *Seq

New returns an initialized Seq suitable for most cases

func NewWithHashIDLength(start, hashIDlength int) *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 (s *Seq) NextHashID() string

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


Generated by godoc2md

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

⌂ 换网址