IdGenerator

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Next added in v1.7.0

func Next() int64

Types

type IdGenerator

type IdGenerator interface {
	Next() int64
}

type SnowflakeIdGenerator

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

func NewSnowflakeIdGenerator added in v1.7.0

func NewSnowflakeIdGenerator(nid int64) (*SnowflakeIdGenerator, error)

func (*SnowflakeIdGenerator) Next

func (s *SnowflakeIdGenerator) Next() int64

type StringIdGenerator added in v1.7.0

type StringIdGenerator interface {
	Next() string
}

func NewStringIdGenerator added in v1.7.0

func NewStringIdGenerator(nid int16, len int) StringIdGenerator

Jump to

Keyboard shortcuts

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