issue9 / autoinc

Go 唯一 ID 自增服务

Home Page:https://pkg.go.dev/github.com/issue9/autoinc/v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

autoinc Go license codecov PkgGoDev

autoinc 提供了一个简单的 ID 自增功能

ai := autoinc.New(0, 1, 1)
ctx, cancel = context.WithCancel(context.Background())
defer cancel()
go ai.Serve(ctx)

for i:=0; i<10; i++ {
    fmt.Println(ai.MustID())
}

安装

go get github.com/issue9/autoinc/v2

版权

本项目采用 MIT 开源授权许可证,完整的授权说明可在 LICENSE 文件中找到。

About

Go 唯一 ID 自增服务

https://pkg.go.dev/github.com/issue9/autoinc/v2

License:MIT License


Languages

Language:Go 100.0%