snowflake

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Snowflake added in v0.0.2

type Snowflake struct {
	sync.Mutex // 锁
	// contains filtered or unexported fields
}

func New added in v0.0.2

func New(workerid int64, datacenterid int64) *Snowflake

example: id := snowflake.New(123, 456) myid, _ := id.GetId()

func (*Snowflake) GetId added in v0.0.2

func (s *Snowflake) GetId() (r int64, err error)

Jump to

Keyboard shortcuts

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