tid

package module
v0.0.0-...-bf8250b Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

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

Overview

Package tid 生成唯一id工具 生成规则:机器ip+进程pid+毫秒时间戳+自增序列 注意该包如果初始化失败则会直接panic

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate() string

Generate 生成唯一id

Types

This section is empty.

Jump to

Keyboard shortcuts

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