uniquegenerator

package
v2.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NaiveUniqueIntGenerator

type NaiveUniqueIntGenerator struct {
	// contains filtered or unexported fields
}

NaiveUniqueIntGenerator is a native implement of UniqueIntGenerator

func NewNaiveUniqueIntGenerator

func NewNaiveUniqueIntGenerator() *NaiveUniqueIntGenerator

NewNaiveUniqueIntGenerator returns a new NaiveUniqueIntGenerator object

func (*NaiveUniqueIntGenerator) GetInt

func (generator *NaiveUniqueIntGenerator) GetInt() int

GetInt returns a unique integer

func (*NaiveUniqueIntGenerator) GetInts

func (generator *NaiveUniqueIntGenerator) GetInts(count int) (int, int)

GetInts returns the begin and end of a batch of unique integers

type UniqueIntGenerator

type UniqueIntGenerator interface {
	GetInt() int
	GetInts(count int) (int, int)
}

UniqueIntGenerator provide methods to generate unique integers

func GetUniqueIntGeneratorIns

func GetUniqueIntGeneratorIns() UniqueIntGenerator

GetUniqueIntGeneratorIns returns a singleton of UniqueIntGenerator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL