Categorygithub.com/yingzhuo/snowflake-golang-client
modulepackage
1.0.3
Repository: https://github.com/yingzhuo/snowflake-golang-client.git
Documentation: pkg.go.dev

# README

snowflake-golang-client

安装:

go get -u github.com/yingzhuo/snowflake-golang-client

使用例:

package main

import (
	"fmt"

	cli "github.com/yingzhuo/snowflake-golang-client"
)

func main() {

	client := cli.NewClient(&cli.Config{
		Host:         "localhost",
		Port:         8080,
		ResponseType: cli.Protobuf,
	})

	if !client.Ping() {
		fmt.Println("链接失败")
		return
	}

	// 生成多个ID
	for _, v := range client.NextIds(10) {
		fmt.Println(v)
	}

	// 生成单个ID
	fmt.Println(client.NextId())
}

# Functions

No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author