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 ¶
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
Click to show internal directories.
Click to hide internal directories.