Guuid基于 HTTP-REST 的 UUID 生成服务
Guuid 是一款由 Go 语言开发的,基于 HTTP-REST 的 UUID 生成服务
UUID(Universally Unique Identifier)全局唯一标识符,是指在一台机器上生成的数字,它保证对在同一时空中的所有机器都是唯一的。
Guuid使用了服务器主机名、运行的进程ID、时间戳、随机数、时序元素等一系列元素来保证生成UUID的唯一性。
UUID 16 bytes, 构成:
4 bytes 主机名&进程ID
4 bytes 时间戳
4 bytes 计数器
4 bytes 随机数
安装
$ go get -u github.com/dreamans/guuid/guuid-server $ cd $GOPATH/src/github.com/dreamans/guuid/guuid-server $ go install
运行
$GOPATH/bin/guuid-server -port 11223 -timeout 3
Usage:
-port 运行端口 -timeout 读写超时时间
运行成功:
⇨ http server started on [::]:11223
RestAPI
获取UUID
$ curl http://127.0.0.1:11223/get { "code": 200, "message": "OK", "uuid": "5d1b3abf-5ab2-2792-0000-00046b2155a4" }
批量获取UUID
$ curl http://127.0.0.1:11223/mget/100 { "code": 200, "message": "OK", "data": [ "5d1b3abf-5ab2-27cd-0000-00056d61a5e0", "5d1b3abf-5ab2-27cd-0000-000648f72a80", ... ] } 说明: 最多返回1000条记录
获取简版UUID
$ curl http://127.0.0.1:11223/get/simple { "code": 200, "message": "OK", "uuid": "5d1b3abf5ab22792000000046b2155a4" }
批量获取简版UUID
$ curl http://127.0.0.1:11223/mget/100/simple { "code": 200, "message": "OK", "data": [ "5d1b3abf5ab227cd000000056d61a5e0", "5d1b3abf5ab227cd0000000648f72a80", ... ] }
部署
LVS -> Nginx -> guuid-server
Configure Nginx
upstream guuid_server { server localhost:11211; server localhost:11212; server localhost:11213; } server { listen 80; server_name localhost; location / { proxy_pass http://guuid_server; } }
评论
real-apidoc基于 tp6 的 api 生成模块
基于tp6的api生成模块,参考fastadmin的api模块引用下载到tp6的extend\jmwl下usejmwl\realapidoc\Builder;usethink\facade\View;
real-apidoc基于 tp6 的 api 生成模块
0
springmvc_dbutils_plus基于 SpringMVC 的代码自动生成
基于springmvc与apache dbutils整合的以图形化方式运行按照模板定制一键化自动生成
springmvc_dbutils_plus基于 SpringMVC 的代码自动生成
0
Vowstag基于EntityFramwork的代码生成标签
基于EntityFramwork的代码生成标签。只需知道表结构就能通过标签获取数据,基本不需要编写后
Vowstag基于EntityFramwork的代码生成标签
0
Vowstag基于EntityFramwork的代码生成标签
基于EntityFramwork的代码生成标签。只需知道表结构就能通过标签获取数据,基本不需要编写后端代码。解决不同CMS的标签自成一派的弊端。
Vowstag基于EntityFramwork的代码生成标签
0
zy-im基于 Netty 的 IM 服务
zy-im是一个基于Netty的IM服务,支持http及多个应用。软件架构springboot2.3.4+netty4.1.54+redis+mongodb+protobuf使用说明http调用/re
zy-im基于 Netty 的 IM 服务
0
nfs-nodefileserver基于 Node.js 的文件服务
nfs-nodefileserver一个基于Node.js的文件服务,可作为中小型项目的文件服务,目前完成了文件上传、文件分片上传、文件合并等功能,数据库方面用的是MySQL,前端的上传插件调用的是百
nfs-nodefileserver基于 Node.js 的文件服务
0