snowflake

package
v0.0.0-...-a86be45 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Snowflake

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

func NewSnowflake

func NewSnowflake(d int64, w int64) *Snowflake

func Parse

func Parse(seq int64) *Snowflake

func (*Snowflake) DatacenterId

func (s *Snowflake) DatacenterId() int64

func (*Snowflake) NextVal

func (s *Snowflake) NextVal() int64

func (*Snowflake) Sequence

func (s *Snowflake) Sequence() int64

func (*Snowflake) String

func (s *Snowflake) String() string

func (*Snowflake) Timestamp

func (s *Snowflake) Timestamp() int64

func (*Snowflake) WorkerId

func (s *Snowflake) WorkerId() int64

Jump to

Keyboard shortcuts

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