package
Version:
v1.1.5
Opens a new window with list of versions in this module.
Published: Jun 12, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
利用雪花算法,生成分布式唯一ID
id := ID()
fmt.Println(id, ServerId(id))
Documentation
¶
ServerId 根据生成的snowId计算出机器ID
A Node struct holds the basic information needed for a snowflake generator
NewNode returns a new snowflake node that can be used to generate snowflake IDs
参数为机器ID 机器注册中心ID
Source Files
¶
Click to show internal directories.
Click to hide internal directories.