snowflake

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SnowFlake

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

func NewShowFlake

func NewShowFlake(epoch, workerId, dataCenterId int64) (*SnowFlake, error)

创建一个 snowid 生成器 epoch: 开始产生ID的纪元时间戳 workerId: 工作ID标识 dataCenterId: 数据ID标识

func (*SnowFlake) NextId

func (s *SnowFlake) NextId() (*SnowId, error)

得到下一个ID

type SnowId

type SnowId struct {
	RawId int64
}

func SnowRaw

func SnowRaw(raw int64) *SnowId

Jump to

Keyboard shortcuts

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