snowflake

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToBin

func ConvertToBin(num int64) string

* 将十进制数字转化为二进制字符串

Types

type IdWorker

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

* 构造

func CreateWorker

func CreateWorker(workerId int64, datacenterId int64) (*IdWorker, error)

* 创建SnowflakeIdWorker * workerId 工作ID (0~31) * datacenterId 数据中心ID (0~31)

func (*IdWorker) NextId

func (w *IdWorker) NextId() int64

* 获取ID

Jump to

Keyboard shortcuts

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