• Stars
    star
    171
  • Rank 220,938 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 3 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Go 开发的一款分布式唯一 ID 生成系统

id-maker

Go 开发的一款分布式唯一 ID 生成系统

使用

有两种方式来调用接口:

  1. HTTP 方式
  2. gRPC 方式

HTTP 方式

1、健康检查:

curl http://127.0.0.1:8080/ping

2、获取 ID:

获取 tag 是 test 的 ID:

curl http://127.0.0.1:8080/v1/id/test

3、获取雪花 ID:

curl http://127.0.0.1:8080/v1/snowid

gRPC 方式

1、获取 ID:

grpcurl -plaintext -d '{"tag":"test"}' -import-path $HOME/src/id-maker/internal/controller/rpc/proto -proto segment.proto localhost:50051 proto.Gid/GetId

2、获取雪花 ID:

grpcurl -plaintext -import-path $HOME/src/id-maker/internal/controller/rpc/proto -proto segment.proto localhost:50051 proto.Gid/GetSnowId

本地开发

# Run MySQL
$ make compose-up

# Run app with migrations
$ make run

推荐阅读

More Repositories

1

gopher

Go 学习路线图,包括基础专栏,进阶专栏,源码阅读,实战开发,面试刷题,必读书单等一系列资源
Go
1,316
star
2

backend-interview

后端面试题汇总(Python、Redis、MySQL、PostgreSQL、Kafka、数据结构、算法、编程、网络)
Python
902
star
3

tech-blog

我的个人技术博客(Python、Django、Docker、Go、Redis、ElasticSearch、Kafka、Linux)
Python
399
star
4

minapp-example

微信小程序的一些 Demo
JavaScript
36
star
5

think

记录位置和想法,以时间线形式来展示的微信小程序
JavaScript
28
star
6

movie-calendar

微信小程序:一个电影日历
Python
14
star
7

go-example

Go 语言编程的一些代码示例,开箱即用。
Go
13
star
8

ai-study

全网最全人工智能学习资料,包含机器学习基础ML、深度学习基础DL、计算机视觉CV、自然语言处理NLP、推荐系统、语音识别、图神经网路、算法工程师面试题,AI产品,AI工具,prompt使用
11
star
9

init-mac

程序员买了一台新 Mac 之后,必装的一个软件或工具
9
star
10

zen

工作流引擎
Go
8
star
11

rms

使用 go-zero 实现的前后端分离权限管理系统
Go
4
star
12

leetcode-interview

leetcode 刷题宝典,大厂 offer 拿到手软,编程语言为 Python 和 Go
3
star
13

yongxinz

2
star
14

yongxinz.github.io

Personal blog
HTML
2
star
15

wego

有趣的运动管理分享工具
JavaScript
1
star
16

djapi

Python
1
star
17

webapp

CSS
1
star
18

gid

Golang 开发的一款分布式唯一 ID 生成系统
Go
1
star
19

lanxin-gpt

lanxin chatgpt bot
Go
1
star
20

lvzhou

Python
1
star