idGenerator

package
v1.0.28 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MinIDtor

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

func New

func New(cli *redis.Client, name string, minID, maxID int64) *MinIDtor

使用redis bitmap实现ID分配器,总是分配最小的可用ID minID 不设置默认为1 maxID 0 表示不设置最大值

func (*MinIDtor) FreeID

func (idtor *MinIDtor) FreeID(id int64) bool

func (*MinIDtor) NewID

func (idtor *MinIDtor) NewID() int64

分配一个最小的可用ID

Jump to

Keyboard shortcuts

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