idgen

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT 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