package
module
Version:
v0.0.0-...-bf8250b
Opens a new window with list of versions in this module.
Published: Jul 31, 2022
License: Apache-2.0
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
简单唯一id生成器
唯一id生成规则:机器ip+进程pid+毫秒时间戳+自增序列
其中机器ip为机器的所有ip地址经过计算得出的hash值
下载方式
go get github.com/tyanxie/tid
使用方式
// 导包
import "github.com/tyanxie/tid"
// 使用Generate函数
id := tid.Generate()
fmt.Println(id)
Documentation
¶
Package tid 生成唯一id工具
生成规则:机器ip+进程pid+毫秒时间戳+自增序列
注意该包如果初始化失败则会直接panic
Source Files
¶
Click to show internal directories.
Click to hide internal directories.