【文件属性】:
文件名称:nats-proxy:http-nats代理
文件大小:20KB
文件格式:ZIP
更新时间:2021-05-17 04:28:46
Go
REST到NATS代理。
基于REST API。
用于在NATS消息传递平台上构建REST API的微框架。 框架的一部分是将HTTP协议桥接到NATS协议的代理。
用法示例
通过nats-proxy客户端连接到NATS的服务:
clientConn, _ := nats.Connect(nats.DefaultURL)
natsClient, _ := NewNatsClient(clientConn)
natsClient.GET("/test/:event/:session", func(c *Context) {
reqEvent = c.PathVariable("event")
reqSession = c.PathVariable("session")
respStruct := struct {
User string
}{
"Rad
【文件预览】:
nats-proxy-master
----util_test.go(579B)
----.gitignore(50B)
----context_test.go(3KB)
----protobuf_test.go(316B)
----request.go(2KB)
----request_test.go(1KB)
----protobuf.go(492B)
----LICENSE(1KB)
----protobuf.pb.go(5KB)
----protobuf.proto(444B)
----proxy_test.go(7KB)
----response_test.go(335B)
----util.go(2KB)
----context.go(5KB)
----.travis.yml(679B)
----client_test.go(2KB)
----client.go(5KB)
----README.MD(3KB)
----proxy.go(6KB)
----response.go(1KB)