distributed-uid-generator

command module
v0.0.0-...-cbb9b3b Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

README

distributed-uid-generator

使用go语言编写的分布式id生成器。项目使用twitter的snowflake算法生成唯一id.使用httpRouter和go原生网络模块向外界提供http访问.添加Dockerfile用于docker部署.

默认位数分配

  • 时间位数:28bit,单位ms
  • 机器位数:22bit,(可以自行添加DataCenter标识位)
  • 序列位数:13bit
+------+----------------------+----------------+-----------+
| sign |     delta seconds    | worker node id | sequence  |
+------+----------------------+----------------+-----------+
   1bit          28bits              22bits         13bits

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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