Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yingzhuo/snowflake-golang-client
https://github.com/yingzhuo/snowflake-golang-client
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/yingzhuo/snowflake-golang-client
- Owner: yingzhuo
- License: apache-2.0
- Created: 2019-10-15T09:28:48.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-18T03:27:13.000Z (over 3 years ago)
- Last Synced: 2024-06-20T06:25:16.659Z (5 months ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# snowflake-golang-client
### 安装:
```bash
go get -u github.com/yingzhuo/snowflake-golang-client
```### 使用例:
```golang
package mainimport (
"fmt"cli "github.com/yingzhuo/snowflake-golang-client"
)func main() {
client := cli.NewClient(&cli.Config{
Host: "localhost",
Port: 8080,
})// 生成多个ID
for _, v := range client.NextIds(10) {
fmt.Println(v)
}// 生成单个ID
fmt.Println(client.NextId())
}
```