idgen

package
v1.1.16 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNewGenerator = errors.New("new id generator error")
)
View Source
var (
	// NewSnowflakeType FIXME: should not be deleted to avoid compiler optimized
	NewSnowflakeType = reflect.TypeOf(NewSnowflake)
)

Functions

func GormTx

func GormTx(tx *gorm.DB) utils.OptionFunc[option]

Types

type Generator

type Generator interface {
	Next(opts ...utils.OptionExtender) (id uint64, err error)
}

func NewSnowflake

func NewSnowflake() Generator

NewSnowflake it should be only one snowflake generator per service instance

Jump to

Keyboard shortcuts

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