1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-12-05 21:56:14 +02:00

[FEATURE] dashboard support publish messages (#2373)

* [feature] dashboard

* [feat] support publish message
This commit is contained in:
Johnson C
2021-12-02 13:15:38 +08:00
committed by GitHub
parent 1e4dd94b71
commit c0e0b2b225
27 changed files with 617 additions and 153 deletions

View File

@@ -1,4 +1,4 @@
# Dashboard
# Go Micro Dashboard
## Installation
@@ -12,4 +12,10 @@ go install github.com/asim/go-micro/cmd/dashboard/v4@latest
dashboard --registry etcd --server_address :4000
```
Visit: [http://localhost:4000](http://localhost:4000)(default admin@micro)
## Docker
```
docker run -d --name micro-dashboard -p 8082:8082 xpunch/go-micro-dashboard:latest
```
Visit: [http://localhost:4000](http://localhost:4000)(deafult admin@micro)

View File

@@ -2,6 +2,11 @@ package config
import "time"
const (
Name = "go.micro.dashboard"
Version = "1.1.0"
)
type Config struct {
Server ServerConfig
}

View File

@@ -20,6 +20,7 @@ import (
// internal instance of Config
var _cfg *Config = &Config{
Server: ServerConfig{
Address: ":8082",
Auth: AuthConfig{
Username: "admin",
Password: "micro",

View File

@@ -3,31 +3,37 @@ module github.com/asim/go-micro/cmd/dashboard/v4
go 1.17
require (
github.com/asim/go-micro/plugins/client/grpc/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/client/http/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/client/mucp/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/config/encoder/toml/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/config/encoder/yaml/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/registry/consul/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/registry/etcd/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/registry/eureka/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/registry/gossip/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/registry/kubernetes/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/registry/nacos/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/registry/nats/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/registry/zookeeper/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/server/http/v4 v4.0.0-20211118090700-90b3e4af0b58
github.com/asim/go-micro/plugins/broker/kafka/v4 v4.0.0-20211124174154-b25d744f5c51
github.com/asim/go-micro/plugins/broker/mqtt/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/broker/nats/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/broker/rabbitmq/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/broker/redis/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/client/grpc/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/client/http/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/client/mucp/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/config/encoder/toml/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/config/encoder/yaml/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/registry/consul/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/registry/etcd/v4 v4.0.0-20211124174154-b25d744f5c51
github.com/asim/go-micro/plugins/registry/eureka/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/registry/gossip/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/registry/kubernetes/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/registry/nacos/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/registry/nats/v4 v4.0.0-20211201082631-1e4dd94b71f1
github.com/asim/go-micro/plugins/registry/zookeeper/v4 v4.0.0-20211124174154-b25d744f5c51
github.com/asim/go-micro/plugins/server/http/v4 v4.0.0-20211124174154-b25d744f5c51
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gin-gonic/gin v1.7.6
github.com/gin-gonic/gin v1.7.7
github.com/pkg/errors v0.9.1
go-micro.dev/v4 v4.4.0
golang.org/x/net v0.0.0-20210510120150-4163338589ed
golang.org/x/net v0.0.0-20210614182718-04defd469f4e
)
require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
github.com/Shopify/sarama v1.29.1 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/aliyun/alibaba-cloud-sdk-go v1.61.976 // indirect
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect
@@ -38,6 +44,11 @@ require (
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/eapache/go-resiliency v1.2.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/eclipse/paho.mqtt.golang v1.3.5 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/fatih/color v1.9.0 // indirect
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8 // indirect
@@ -54,8 +65,11 @@ require (
github.com/go-zookeeper/zk v1.0.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/gomodule/redigo v1.8.5 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/hashicorp/consul/api v1.9.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
@@ -65,39 +79,50 @@ require (
github.com/hashicorp/go-multierror v1.1.0 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.0 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/hashicorp/memberlist v0.2.2 // indirect
github.com/hashicorp/serf v0.9.5 // indirect
github.com/hudl/fargo v1.3.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.0.0 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/klauspost/compress v1.12.2 // indirect
github.com/leodido/go-urn v1.2.0 // indirect
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f // indirect
github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/miekg/dns v1.1.43 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/hashstructure v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/nacos-group/nacos-sdk-go/v2 v2.0.0-Beta.1 // indirect
github.com/nats-io/jwt v1.1.0 // indirect
github.com/nats-io/nats.go v1.10.0 // indirect
github.com/nats-io/nkeys v0.1.4 // indirect
github.com/nats-io/jwt/v2 v2.2.0 // indirect
github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30 // indirect
github.com/nats-io/nkeys v0.3.0 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 // indirect
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pierrec/lz4 v2.6.0+incompatible // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/streadway/amqp v1.0.0 // indirect
github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3 // indirect
github.com/ugorji/go/codec v1.1.7 // indirect
github.com/urfave/cli/v2 v2.3.0 // indirect
@@ -108,10 +133,10 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
golang.org/x/text v0.3.6 // indirect
google.golang.org/appengine v1.6.5 // indirect
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect

View File

@@ -55,6 +55,9 @@ github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:i
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ=
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/sarama v1.29.1 h1:wBAacXbYVLmWieEA/0X/JagDdCZ8NVFOfS6l6+2u5S0=
github.com/Shopify/sarama v1.29.1/go.mod h1:mdtqvCSg8JOxk8PmpTNGyo6wzd4BMm4QXSfDnTXmgkE=
github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk=
github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
@@ -79,34 +82,44 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asim/go-micro/plugins/client/grpc/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:6hMPATkwvKGUja2J8dpRxcOxTrdXeptsyCDQIfiMqgE=
github.com/asim/go-micro/plugins/client/grpc/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:P/Jjf1gCQqBAgpVerr3opyTU594ns1t0JZXsDAYh86c=
github.com/asim/go-micro/plugins/client/http/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:PB5w/6vNStSlIK/tM/bGKTDAyv+1dCMcyY1Y4wl8CTw=
github.com/asim/go-micro/plugins/client/http/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:b6uXG9QOlAs3Eh1es67Y6Mq6ALHyoQT+t0tFZEWW8+8=
github.com/asim/go-micro/plugins/client/mucp/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:O12t7PU3vTeTIunISClMOUdTU5NPFY0pbM9Dzl9TQCU=
github.com/asim/go-micro/plugins/client/mucp/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:ZXjR4r15LatjvBSKIXqi9/frEVw28kmcvOZ7rkaAACg=
github.com/asim/go-micro/plugins/config/encoder/toml/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:W8f93ySjxuAS/mGm9z/LuQKdMrFIaRlGmaq3rIrnVFE=
github.com/asim/go-micro/plugins/config/encoder/toml/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:x7YIgC4Do+BCihPbENDqjTsUfm3OkOB1GEgrpck2iJ4=
github.com/asim/go-micro/plugins/config/encoder/yaml/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:3Pd0Mh7y3rtMqtq++06HptnBkjcI6afeUGWOTRPHbc0=
github.com/asim/go-micro/plugins/config/encoder/yaml/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:tRcpGjk28FtJQyp4DtmCMdEIyr/wDkCmtVQtv8dx4t0=
github.com/asim/go-micro/plugins/registry/consul/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:tJlCfjxnd9mxetTn6ae4xDEKYpwhbpKK+mxyaTo7+0k=
github.com/asim/go-micro/plugins/registry/consul/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:cCagHmMVGVea+8gzr0AC+yXtwtCIB6iXh20ipF9coOA=
github.com/asim/go-micro/plugins/registry/etcd/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:j4sQMvTxxs0qu4NhdPoyZit7wVYPdEx+ZVZjWiRctIY=
github.com/asim/go-micro/plugins/registry/etcd/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:maR33ztnKc7VeMioGfl1vq3Jm7fzztbNoRWTncu96sc=
github.com/asim/go-micro/plugins/registry/eureka/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:INuunkRlDxXrqPlwZM1jcmRnSf6SXCoaUukw4oSYSFk=
github.com/asim/go-micro/plugins/registry/eureka/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:CrbuvEFuiWZd+BCrvSFF35BTYsUAPMrvNIhGb7UdPI4=
github.com/asim/go-micro/plugins/registry/gossip/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:URCxTnGw6KesKZDb41HrSyaUUIovdcIM21Ni+GojThM=
github.com/asim/go-micro/plugins/registry/gossip/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:6rLyGiwvfYh60RSHnV8rQgw2nA01oj8UMSmYP+j2eps=
github.com/asim/go-micro/plugins/registry/kubernetes/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:8+23lyD21q1meyspVI/5zea/NgwCw97sEBwQ/lEzAmA=
github.com/asim/go-micro/plugins/registry/kubernetes/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:OPhLYTs5ounZ+TaoHT9W/qSgoTGyx4OycNsSR60PuHY=
github.com/asim/go-micro/plugins/registry/nacos/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:LI7hjf54t7j+zzIXI+mg8YtHJjEVJsLhZi4ZHBMKGDw=
github.com/asim/go-micro/plugins/registry/nacos/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:E6DSmDRtS7He6PkfnWGNj4y8fCr6XYlftsbOlI3ZNqk=
github.com/asim/go-micro/plugins/registry/nats/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:JOau6JXvJJSih7Oh2l1tD36+B5wG1pHL/8B2YJw7JhQ=
github.com/asim/go-micro/plugins/registry/nats/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:n4K0361IySJ/hmIfaIg8q2NDNAVDL9DUC6Bh7gS4ihg=
github.com/asim/go-micro/plugins/registry/zookeeper/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:h/Twd8vYBrxM0auY2cWn3QTDmr1FxPKV3QY1Pj+7mvc=
github.com/asim/go-micro/plugins/registry/zookeeper/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:1u6V7M1VOgFGkXafSPUGhBVf6W3l0Zl+5pdsVztkdzA=
github.com/asim/go-micro/plugins/server/http/v4 v4.0.0-20211118090700-90b3e4af0b58 h1:+X10ZhkCDrnSE+YPnJlg0bTxOtvfHO+hJlG/LKN88oc=
github.com/asim/go-micro/plugins/server/http/v4 v4.0.0-20211118090700-90b3e4af0b58/go.mod h1:LEsuhy4ZF3UGT9VSOoj/ZP0MZt4brlgwJVG7/LAac+I=
github.com/asim/go-micro/plugins/broker/kafka/v4 v4.0.0-20211124174154-b25d744f5c51 h1:M6PKj4Rwy0fVmrI53KqAiw60gGMI3Js1faSeI4uRgAI=
github.com/asim/go-micro/plugins/broker/kafka/v4 v4.0.0-20211124174154-b25d744f5c51/go.mod h1:Lagmt4bIzAq6APlwpTQxUbh+1xfqgYS8Qeja8w3boV8=
github.com/asim/go-micro/plugins/broker/mqtt/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:rGrxmHP4I/hXWiaOJJSjOnhnIYJ6OQANDVCCbj1wVq8=
github.com/asim/go-micro/plugins/broker/mqtt/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:IuTGyj/A67ywbJG2jIPeaHZOmimjKq/xQqOeUo5bEE0=
github.com/asim/go-micro/plugins/broker/nats/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:vk2vwh6GozuMTR4xANf4NWOhzHEmjJ8AKDHgCau1cic=
github.com/asim/go-micro/plugins/broker/nats/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:Y/DBtJ+Z1GVM0lIIBmsYfYU5tUrdqOiku0aYb3+SZoI=
github.com/asim/go-micro/plugins/broker/rabbitmq/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:LCaaCamGk2KCui8EyO/Gr7NZWMFaOMzqb/iANtmqcyI=
github.com/asim/go-micro/plugins/broker/rabbitmq/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:B/znrfbAKqPhVBDmKpwoIb8qx2Lhrww/1yL1rcE0Kik=
github.com/asim/go-micro/plugins/broker/redis/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:Yhn5PixugZVFVyfX5TxP9vLJRG1Hj6LbVBCC5jO9xBA=
github.com/asim/go-micro/plugins/broker/redis/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1://EU7a+nW+5ZCseQkg90XXQI1ZwPSLF49IdUUIM5PM0=
github.com/asim/go-micro/plugins/client/grpc/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:GCEFKXorNsDzKKOWXueuYJipG8l++4fAogY+wpTrduc=
github.com/asim/go-micro/plugins/client/grpc/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:P/Jjf1gCQqBAgpVerr3opyTU594ns1t0JZXsDAYh86c=
github.com/asim/go-micro/plugins/client/http/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:jx7TbrIapl+HOkmQKQQVZ10eDw1fxRhJg7ohIqEed+w=
github.com/asim/go-micro/plugins/client/http/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:b6uXG9QOlAs3Eh1es67Y6Mq6ALHyoQT+t0tFZEWW8+8=
github.com/asim/go-micro/plugins/client/mucp/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:I8bfcO2hD3g9sLkxET2c2PgMzPgN3U3HtgqFWtsYOBY=
github.com/asim/go-micro/plugins/client/mucp/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:ZXjR4r15LatjvBSKIXqi9/frEVw28kmcvOZ7rkaAACg=
github.com/asim/go-micro/plugins/config/encoder/toml/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:OMANsL5Bz8D+cqP0agREkCUQMD4ZtU3ke3KqZi/Xd3I=
github.com/asim/go-micro/plugins/config/encoder/toml/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:x7YIgC4Do+BCihPbENDqjTsUfm3OkOB1GEgrpck2iJ4=
github.com/asim/go-micro/plugins/config/encoder/yaml/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:HreQX7FWtYXU5Zp+tHZ3TW4ck3DfG16jKslKlR3fqRA=
github.com/asim/go-micro/plugins/config/encoder/yaml/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:tRcpGjk28FtJQyp4DtmCMdEIyr/wDkCmtVQtv8dx4t0=
github.com/asim/go-micro/plugins/registry/consul/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:P1flbbRCOp7WiY2benDCzpplZ2aRN7BtY08tcpLZiLc=
github.com/asim/go-micro/plugins/registry/consul/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:cCagHmMVGVea+8gzr0AC+yXtwtCIB6iXh20ipF9coOA=
github.com/asim/go-micro/plugins/registry/etcd/v4 v4.0.0-20211124174154-b25d744f5c51 h1:gXD6unb70+lX6X2qWq4EG/3tM0tTx7HZMrf5925RRU8=
github.com/asim/go-micro/plugins/registry/etcd/v4 v4.0.0-20211124174154-b25d744f5c51/go.mod h1:maR33ztnKc7VeMioGfl1vq3Jm7fzztbNoRWTncu96sc=
github.com/asim/go-micro/plugins/registry/eureka/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:EOiQJYDtT/yEsnPyUmj893Mhu3iL++Yo3uN8JNyWnZA=
github.com/asim/go-micro/plugins/registry/eureka/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:CrbuvEFuiWZd+BCrvSFF35BTYsUAPMrvNIhGb7UdPI4=
github.com/asim/go-micro/plugins/registry/gossip/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:tKiOojNZOZPC4G0mJHDIknlDUWYHmfyTBgOF45suK6Y=
github.com/asim/go-micro/plugins/registry/gossip/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:6rLyGiwvfYh60RSHnV8rQgw2nA01oj8UMSmYP+j2eps=
github.com/asim/go-micro/plugins/registry/kubernetes/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:fnEH9/B648yYVioy4aoI1nl+Z/KSFf6+opwHvwsBh08=
github.com/asim/go-micro/plugins/registry/kubernetes/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:oSNX75DUoUh/Fn3LABL5Ukf2OwjSBTrTm8pFsHeFfw8=
github.com/asim/go-micro/plugins/registry/nacos/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:qAJ8wIcxh7TvaQcWecGPvb7xpn17n7gRFQb67eU0p3U=
github.com/asim/go-micro/plugins/registry/nacos/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:E6DSmDRtS7He6PkfnWGNj4y8fCr6XYlftsbOlI3ZNqk=
github.com/asim/go-micro/plugins/registry/nats/v4 v4.0.0-20211201082631-1e4dd94b71f1 h1:pJkFhfu+bWTfOfdJ4PG47xHEXPWiCNkE57XyfPJM5Q4=
github.com/asim/go-micro/plugins/registry/nats/v4 v4.0.0-20211201082631-1e4dd94b71f1/go.mod h1:n4K0361IySJ/hmIfaIg8q2NDNAVDL9DUC6Bh7gS4ihg=
github.com/asim/go-micro/plugins/registry/zookeeper/v4 v4.0.0-20211124174154-b25d744f5c51 h1:6eqdlnrL/0y9C9j9TvNztaUchuhB0BeYrzqowHDSsHM=
github.com/asim/go-micro/plugins/registry/zookeeper/v4 v4.0.0-20211124174154-b25d744f5c51/go.mod h1:1u6V7M1VOgFGkXafSPUGhBVf6W3l0Zl+5pdsVztkdzA=
github.com/asim/go-micro/plugins/server/http/v4 v4.0.0-20211124174154-b25d744f5c51 h1:wYFQxeAjrCWA6hxR2qw72iMaNxU8BqNf65JfgMOC0NA=
github.com/asim/go-micro/plugins/server/http/v4 v4.0.0-20211124174154-b25d744f5c51/go.mod h1:LEsuhy4ZF3UGT9VSOoj/ZP0MZt4brlgwJVG7/LAac+I=
github.com/aws/aws-sdk-go v1.37.27/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
@@ -184,8 +197,14 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-resiliency v1.2.0 h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q=
github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/eclipse/paho.mqtt.golang v1.3.5 h1:sWtmgNxYM9P2sP+xEItMozsR3w0cqZFlqnNN1bdl41Y=
github.com/eclipse/paho.mqtt.golang v1.3.5/go.mod h1:eTzb4gxwwyWpqBUHGQZ4ABAV7+Jgm1PklsYT/eo8Hcc=
github.com/ef-ds/deque v1.0.4/go.mod h1:gXDnTC3yqvBcHbq2lcExjtAcVrOnJCbMcZXmuj8Z4tg=
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
@@ -207,10 +226,14 @@ github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2 h1:cZqz+yOJ/R64LcKjNQOdARott/jP7BnUQ9Ah7KaZCvw=
github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo=
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8 h1:a9ENSRDFBUPkJ5lCgVZh26+ZbGyoVJG7yb5SSzF5H54=
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
@@ -220,8 +243,8 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.7.6 h1:Ma2JlolDP9KCHuHTrW58EIIxVUQKxSxzuCKguCYyFas=
github.com/gin-gonic/gin v1.7.6/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY=
github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs=
github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U=
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-acme/lego/v4 v4.4.0/go.mod h1:l3+tFUFZb590dWcqhWZegynUthtaHJbG2fevUpoOOE0=
@@ -301,7 +324,11 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y=
github.com/gomodule/redigo v1.8.5 h1:nRAxCa+SVsyjSBrtZmG/cqb6VbTmuRzpg/PoTFlpumc=
github.com/gomodule/redigo v1.8.5/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@@ -340,7 +367,10 @@ github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
@@ -406,6 +436,18 @@ github.com/infobloxopen/infoblox-go-client v1.1.1/go.mod h1:BXiw7S2b9qJoM8MS40vf
github.com/jarcoal/httpmock v1.0.6/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs=
github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=
github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM=
github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8=
github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o=
github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg=
github.com/jcmturner/gokrb5/v8 v8.4.2 h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJzodkA=
github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc=
github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY=
github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc=
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4=
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
@@ -439,6 +481,9 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.12.2 h1:2KCfW3I9M7nSc5wOqXAlW2v2U6v+w6cbjvbfp+OykW8=
github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -501,6 +546,9 @@ github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKju
github.com/miekg/dns v1.1.40/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg=
github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
@@ -533,15 +581,23 @@ github.com/nacos-group/nacos-sdk-go/v2 v2.0.0-Beta.1 h1:TNQJ4ZJvBwxLNzXTg7ZyVtBH
github.com/nacos-group/nacos-sdk-go/v2 v2.0.0-Beta.1/go.mod h1:4jAk6l0dnS/0w4RnRqf1CcqmWlbgEguZeEPUn9+e/dI=
github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04/go.mod h1:5sN+Lt1CaY4wsPvgQH/jsuJi4XO2ssZbdsIizr4CVC8=
github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU=
github.com/nats-io/jwt v1.1.0 h1:+vOlgtM0ZsF46GbmUoadq0/2rChNS45gtxHEa3H1gqM=
github.com/nats-io/jwt v1.1.0/go.mod h1:n3cvmLfBfnpV4JJRN7lRYCyZnw48ksGsbThGXEk4w9M=
github.com/nats-io/nats-server/v2 v2.1.9 h1:Sxr2zpaapgpBT9ElTxTVe62W+qjnhPcKY/8W5cnA/Qk=
github.com/nats-io/jwt v1.2.2 h1:w3GMTO969dFg+UOKTmmyuu7IGdusK+7Ytlt//OYH/uU=
github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q=
github.com/nats-io/jwt/v2 v2.0.2/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY=
github.com/nats-io/jwt/v2 v2.2.0 h1:Yg/4WFK6vsqMudRg91eBb7Dh6XeVcDMPHycDE8CfltE=
github.com/nats-io/jwt/v2 v2.2.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k=
github.com/nats-io/nats-server/v2 v2.1.9/go.mod h1:9qVyoewoYXzG1ME9ox0HwkkzyYvnlBDugfR4Gg/8uHU=
github.com/nats-io/nats.go v1.10.0 h1:L8qnKaofSfNFbXg0C5F71LdjPRnmQwSsA4ukmkt1TvY=
github.com/nats-io/nats-server/v2 v2.3.1 h1:tR8rp+ohGbqPGHROuzlvNzvw4G5TTeA5jUkxnSTEYPE=
github.com/nats-io/nats-server/v2 v2.3.1/go.mod h1:dUf7Cm5z5LbciFVwWx54owyCKm8x4/hL6p7rrljhLFY=
github.com/nats-io/nats.go v1.10.0/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE=
github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30 h1:9GqilBhZaR3xYis0JgMlJjNw933WIobdjKhilXm+Vls=
github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w=
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nkeys v0.1.4 h1:aEsHIssIk6ETN5m2/MD8Y4B2X7FfXrBAUdkyRvbVYzA=
github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s=
github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s=
github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8=
github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4=
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
@@ -581,6 +637,8 @@ github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTK
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A=
github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -622,6 +680,8 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKcyumwBO6qip7RNQ5r77yrssm9bfCowcLEBcU5IA=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
@@ -665,6 +725,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo=
github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As=
@@ -702,6 +764,8 @@ github.com/vinyldns/go-vinyldns v0.0.0-20200917153823-148a5f6b8f14/go.mod h1:RWc
github.com/vultr/govultr/v2 v2.0.0/go.mod h1:2PsEeg+gs3p/Fo5Pw8F9mv+DUBEOlrNZ8GmCTGmhOhs=
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=
github.com/xdg/scram v1.0.3/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
@@ -759,11 +823,14 @@ golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -828,6 +895,7 @@ golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
@@ -836,8 +904,9 @@ golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I=
golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q=
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -863,6 +932,7 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -919,8 +989,9 @@ golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201113234701-d7a72108b828/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
@@ -937,8 +1008,10 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE=
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

View File

@@ -16,12 +16,9 @@ func NewRouteRegistrar() route.Registrar {
return service{}
}
func (s service) RegisterAuthRoute(router gin.IRoutes) {
router.GET("/api/account/profile", s.Profile)
}
func (s service) RegisterNonAuthRoute(router gin.IRoutes) {
func (s service) RegisterRoute(router gin.IRoutes) {
router.POST("/api/account/login", s.Login)
router.Use(route.AuthRequired()).GET("/api/account/profile", s.Profile)
}
type loginRequest struct {

View File

@@ -7,3 +7,8 @@ type callRequest struct {
Request string `json:"request"`
Timeout int64 `json:"timeout"`
}
type publishRequest struct {
Topic string `json:"topic" binding:"required"`
Message string `json:"message" binding:"required"`
}

View File

@@ -3,6 +3,7 @@ package client
import (
"context"
"encoding/json"
"sync"
"time"
"github.com/asim/go-micro/cmd/dashboard/v4/handler/route"
@@ -20,29 +21,31 @@ import (
type service struct {
client client.Client
registry registry.Registry
clients map[string]client.Client
clientsMu sync.Mutex
}
func NewRouteRegistrar(client client.Client, registry registry.Registry) route.Registrar {
return service{client: client, registry: registry}
return &service{client: client, registry: registry}
}
func (s service) RegisterAuthRoute(router gin.IRoutes) {
router.POST("/api/client/endpoint/call", s.CallEndpoint)
}
func (s service) RegisterNonAuthRoute(router gin.IRoutes) {
func (s *service) RegisterRoute(router gin.IRoutes) {
router.Use(route.AuthRequired()).
POST("/api/client/call", s.Call).
POST("/api/client/publish", s.Publish)
}
// @Security ApiKeyAuth
// @Tags Client
// @ID client_callEndpoint
// @ID client_call
// @Param input body callRequest true "request"
// @Success 200 {object} object "success"
// @Failure 400 {object} string
// @Failure 401 {object} string
// @Failure 500 {object} string
// @Router /api/client/endpoint/call [post]
func (s *service) CallEndpoint(ctx *gin.Context) {
// @Router /api/client/call [post]
func (s *service) Call(ctx *gin.Context) {
var req callRequest
if err := ctx.ShouldBindJSON(&req); nil != err {
ctx.Render(400, render.String{Format: err.Error()})
@@ -69,16 +72,7 @@ func (s *service) CallEndpoint(ctx *gin.Context) {
ctx.Render(400, render.String{Format: "service node not found"})
return
}
switch srv.Nodes[0].Metadata["server"] {
case "grpc":
c = cgrpc.NewClient()
case "http":
c = chttp.NewClient()
case "mucp":
c = cmucp.NewClient()
default:
c = s.client
}
c = s.getClient(srv.Nodes[0].Metadata["server"])
break
}
if c == nil {
@@ -104,3 +98,67 @@ func (s *service) CallEndpoint(ctx *gin.Context) {
}
ctx.JSON(200, resp)
}
// @Security ApiKeyAuth
// @Tags Client
// @ID client_publish
// @Param input body publishRequest true "request"
// @Success 200 {object} object "success"
// @Failure 400 {object} string
// @Failure 401 {object} string
// @Failure 500 {object} string
// @Router /api/client/publish [post]
func (s *service) Publish(ctx *gin.Context) {
var req publishRequest
if err := ctx.ShouldBindJSON(&req); nil != err {
ctx.Render(400, render.String{Format: err.Error()})
return
}
var msg json.RawMessage
if len(req.Message) > 0 {
if err := json.Unmarshal([]byte(req.Message), &msg); err != nil {
ctx.Render(400, render.String{Format: "parse request failed: %s", Data: []interface{}{err.Error()}})
return
}
}
err := s.client.Publish(ctx, client.NewMessage(req.Topic, msg, client.WithMessageContentType("application/json")))
if err != nil {
if merr := errors.Parse(err.Error()); merr != nil {
ctx.JSON(200, gin.H{"success": false, "error": merr})
} else {
ctx.JSON(200, gin.H{"success": false, "error": err.Error})
}
return
}
ctx.JSON(200, gin.H{"success": true})
}
func (s *service) getClient(serverType string) client.Client {
if serverType == s.client.String() {
return s.client
}
s.clientsMu.Lock()
defer s.clientsMu.Unlock()
if s.clients == nil {
s.clients = make(map[string]client.Client)
} else {
if c, ok := s.clients[serverType]; ok {
return c
}
}
var c client.Client
switch serverType {
case "grpc":
c = cgrpc.NewClient()
s.clients[serverType] = c
case "http":
c = chttp.NewClient()
s.clients[serverType] = c
case "mucp":
c = cmucp.NewClient()
s.clients[serverType] = c
default:
c = s.client
}
return c
}

View File

@@ -0,0 +1,23 @@
package client
import (
"testing"
"go-micro.dev/v4/client"
)
func TestGetClient(t *testing.T) {
s := &service{client: client.DefaultClient}
if s.getClient("grpc").String() != "grpc" {
t.Fail()
}
if s.getClient("http").String() != "http" {
t.Fail()
}
if s.getClient("mucp").String() != "mucp" {
t.Fail()
}
if s.getClient("other").String() != client.DefaultClient.String() {
t.Fail()
}
}

View File

@@ -23,17 +23,15 @@ func Register(opts Options) error {
return err
}
if cfg := config.GetServerConfig().CORS; cfg.Enable {
router.Use(CorsHandler(cfg.Origin))
router.Use(route.CorsHandler(cfg.Origin))
}
authRouter := router.Group("").Use(AuthRequired())
for _, r := range []route.Registrar{
account.NewRouteRegistrar(),
handlerclient.NewRouteRegistrar(opts.Client, opts.Client.Options().Registry),
registry.NewRouteRegistrar(opts.Client.Options().Registry),
statistics.NewRouteRegistrar(opts.Client.Options().Registry),
} {
r.RegisterNonAuthRoute(router)
r.RegisterAuthRoute(authRouter)
r.RegisterRoute(router)
}
return nil
}

View File

@@ -12,11 +12,12 @@ type getServiceListResponse struct {
}
type registryService struct {
Name string `json:"name" binding:"required"`
Version string `json:"version" binding:"required"`
Metadata map[string]string `json:"metadata,omitempty"`
Endpoints []registryEndpoint `json:"endpoints,omitempty"`
Nodes []registryNode `json:"nodes,omitempty"`
Name string `json:"name" binding:"required"`
Version string `json:"version" binding:"required"`
Metadata map[string]string `json:"metadata,omitempty"`
Handlers []registryEndpoint `json:"handlers,omitempty"`
Subscribers []registryEndpoint `json:"subscribers,omitempty"`
Nodes []registryNode `json:"nodes,omitempty"`
}
type registryEndpoint struct {
@@ -42,8 +43,12 @@ type getServiceDetailResponse struct {
Services []registryService `json:"services"`
}
type getServiceEndpointsResponse struct {
Endpoints []registryEndpoint `json:"endpoints"`
type getServiceHandlersResponse struct {
Handlers []registryEndpoint `json:"handlers"`
}
type getServiceSubscribersResponse struct {
Subscribers []registryEndpoint `json:"subscribers"`
}
func convertRegistryValue(v *registry.Value) registryValue {

View File

@@ -17,13 +17,12 @@ func NewRouteRegistrar(registry registry.Registry) route.Registrar {
return service{registry: registry}
}
func (s service) RegisterAuthRoute(router gin.IRoutes) {
router.GET("/api/registry/services", s.GetServices)
router.GET("/api/registry/service", s.GetServiceDetail)
router.GET("/api/registry/service/endpoints", s.GetServiceEndpoints)
}
func (s service) RegisterNonAuthRoute(router gin.IRoutes) {
func (s service) RegisterRoute(router gin.IRoutes) {
router.Use(route.AuthRequired()).
GET("/api/registry/services", s.GetServices).
GET("/api/registry/service", s.GetServiceDetail).
GET("/api/registry/service/handlers", s.GetServiceHandlers).
GET("/api/registry/service/subscribers", s.GetServiceSubscribers)
}
// @Security ApiKeyAuth
@@ -87,14 +86,23 @@ func (s *service) GetServiceDetail(ctx *gin.Context) {
if len(version) > 0 && s.Version != version {
continue
}
endpoints := make([]registryEndpoint, 0, len(s.Endpoints))
handlers := make([]registryEndpoint, 0)
subscribers := make([]registryEndpoint, 0)
for _, e := range s.Endpoints {
endpoints = append(endpoints, registryEndpoint{
Name: e.Name,
Request: convertRegistryValue(e.Request),
Response: convertRegistryValue(e.Response),
Metadata: e.Metadata,
})
if isSubscriber(e) {
subscribers = append(subscribers, registryEndpoint{
Name: e.Metadata["topic"],
Request: convertRegistryValue(e.Request),
Metadata: e.Metadata,
})
} else {
handlers = append(handlers, registryEndpoint{
Name: e.Name,
Request: convertRegistryValue(e.Request),
Response: convertRegistryValue(e.Response),
Metadata: e.Metadata,
})
}
}
nodes := make([]registryNode, 0, len(s.Nodes))
for _, n := range s.Nodes {
@@ -105,11 +113,12 @@ func (s *service) GetServiceDetail(ctx *gin.Context) {
})
}
resp.Services = append(resp.Services, registryService{
Name: s.Name,
Version: s.Version,
Metadata: s.Metadata,
Endpoints: endpoints,
Nodes: nodes,
Name: s.Name,
Version: s.Version,
Metadata: s.Metadata,
Handlers: handlers,
Subscribers: subscribers,
Nodes: nodes,
})
}
ctx.JSON(200, resp)
@@ -117,15 +126,15 @@ func (s *service) GetServiceDetail(ctx *gin.Context) {
// @Security ApiKeyAuth
// @Tags Registry
// @ID registry_getServiceEndpoints
// @ID registry_getServiceHandlers
// @Param name query string true "service name"
// @Param version query string false "service version"
// @Success 200 {object} getServiceEndpointsResponse
// @Success 200 {object} getServiceHandlersResponse
// @Failure 400 {object} string
// @Failure 401 {object} string
// @Failure 500 {object} string
// @Router /api/registry/service/endpoints [get]
func (s *service) GetServiceEndpoints(ctx *gin.Context) {
// @Router /api/registry/service/handlers [get]
func (s *service) GetServiceHandlers(ctx *gin.Context) {
name := ctx.Query("name")
if len(name) == 0 {
ctx.Render(400, render.String{Format: "service name required"})
@@ -137,25 +146,76 @@ func (s *service) GetServiceEndpoints(ctx *gin.Context) {
return
}
version := ctx.Query("version")
resp := getServiceEndpointsResponse{}
resp := getServiceHandlersResponse{}
for _, s := range services {
if s.Version != version {
continue
}
endpoints := make([]registryEndpoint, 0, len(s.Endpoints))
handlers := make([]registryEndpoint, 0, len(s.Endpoints))
for _, e := range s.Endpoints {
if e.Name == "Func" {
if isSubscriber(e) {
continue
}
endpoints = append(endpoints, registryEndpoint{
Name: e.Name,
Request: convertRegistryValue(e.Request),
Response: convertRegistryValue(e.Response),
Metadata: e.Metadata,
handlers = append(handlers, registryEndpoint{
Name: e.Name,
Request: convertRegistryValue(e.Request),
})
}
resp.Endpoints = endpoints
resp.Handlers = handlers
break
}
ctx.JSON(200, resp)
}
// @Security ApiKeyAuth
// @Tags Registry
// @ID registry_getServiceSubscribers
// @Param name query string true "service name"
// @Param version query string false "service version"
// @Success 200 {object} getServiceSubscribersResponse
// @Failure 400 {object} string
// @Failure 401 {object} string
// @Failure 500 {object} string
// @Router /api/registry/service/subscribers [get]
func (s *service) GetServiceSubscribers(ctx *gin.Context) {
name := ctx.Query("name")
if len(name) == 0 {
ctx.Render(400, render.String{Format: "service name required"})
return
}
services, err := s.registry.GetService(name)
if err != nil {
ctx.Render(500, render.String{Format: err.Error()})
return
}
version := ctx.Query("version")
resp := getServiceSubscribersResponse{}
for _, s := range services {
if s.Version != version {
continue
}
subscribers := make([]registryEndpoint, 0, len(s.Endpoints))
for _, e := range s.Endpoints {
if !isSubscriber(e) {
continue
}
subscribers = append(subscribers, registryEndpoint{
Name: e.Metadata["topic"],
Request: convertRegistryValue(e.Request),
})
}
resp.Subscribers = subscribers
break
}
ctx.JSON(200, resp)
}
func isSubscriber(ep *registry.Endpoint) bool {
if ep == nil || len(ep.Metadata) == 0 {
return false
}
if s, ok := ep.Metadata["subscriber"]; ok && s == "true" {
return true
}
return false
}

View File

@@ -0,0 +1,51 @@
package route
import (
"net/http"
"strings"
"github.com/asim/go-micro/cmd/dashboard/v4/config"
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
)
func AuthRequired() gin.HandlerFunc {
return func(ctx *gin.Context) {
if ctx.Request.Method == "OPTIONS" {
ctx.Next()
return
}
tokenString := ctx.GetHeader("Authorization")
if len(tokenString) == 0 || !strings.HasPrefix(tokenString, "Bearer ") {
ctx.AbortWithStatusJSON(http.StatusUnauthorized, "")
return
}
tokenString = tokenString[7:]
claims := jwt.StandardClaims{}
token, err := jwt.ParseWithClaims(tokenString, &claims, func(t *jwt.Token) (interface{}, error) {
return []byte(config.GetAuthConfig().TokenSecret), nil
})
if err != nil {
ctx.AbortWithError(http.StatusUnauthorized, err)
}
if !token.Valid {
ctx.AbortWithStatus(http.StatusUnauthorized)
}
ctx.Set("username", claims.Subject)
ctx.Next()
}
}
func CorsHandler(allowOrigin string) gin.HandlerFunc {
return func(ctx *gin.Context) {
ctx.Header("Access-Control-Allow-Origin", allowOrigin)
ctx.Header("Access-Control-Allow-Headers", "Content-Type, Authorization, token")
ctx.Header("Access-Control-Allow-Methods", "POST, GET, DELETE, PUT, OPTIONS")
ctx.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type")
ctx.Header("Access-Control-Allow-Credentials", "true")
if ctx.Request.Method == "OPTIONS" {
ctx.AbortWithStatus(http.StatusNoContent)
}
ctx.Next()
}
}

View File

@@ -3,6 +3,5 @@ package route
import "github.com/gin-gonic/gin"
type Registrar interface {
RegisterAuthRoute(gin.IRoutes)
RegisterNonAuthRoute(gin.IRoutes)
RegisterRoute(gin.IRoutes)
}

View File

@@ -1,6 +1,7 @@
package statistics
import (
"github.com/asim/go-micro/cmd/dashboard/v4/config"
"github.com/asim/go-micro/cmd/dashboard/v4/handler/route"
"github.com/gin-gonic/gin"
"go-micro.dev/v4/registry"
@@ -14,11 +15,9 @@ func NewRouteRegistrar(registry registry.Registry) route.Registrar {
return service{registry: registry}
}
func (s service) RegisterAuthRoute(router gin.IRoutes) {
router.GET("/api/summary", s.GetSummary)
}
func (s service) RegisterNonAuthRoute(router gin.IRoutes) {
func (s service) RegisterRoute(router gin.IRoutes) {
router.GET("/version", s.GetVersion)
router.Use(route.AuthRequired()).GET("/api/summary", s.GetSummary)
}
// @Security ApiKeyAuth
@@ -54,3 +53,10 @@ func (s *service) GetSummary(ctx *gin.Context) {
}
ctx.JSON(200, resp)
}
// @ID getVersion
// @Success 200 {object} object
// @Router /version [get]
func (s *service) GetVersion(ctx *gin.Context) {
ctx.JSON(200, gin.H{"version": config.Version})
}

View File

@@ -9,19 +9,15 @@ import (
"go-micro.dev/v4/logger"
)
const (
Name = "go.micro.dashboard"
Version = "1.0.0"
)
func main() {
if err := config.Load(); err != nil {
logger.Fatal(err)
}
srv := micro.NewService(micro.Server(mhttp.NewServer()))
opts := []micro.Option{
micro.Name(Name),
micro.Version(Version),
micro.Name(config.Name),
micro.Address(config.GetServerConfig().Address),
micro.Version(config.Version),
}
srv.Init(opts...)
gin.SetMode(gin.ReleaseMode)

View File

@@ -1,6 +1,12 @@
package main
import (
_ "github.com/asim/go-micro/plugins/broker/kafka/v4"
_ "github.com/asim/go-micro/plugins/broker/mqtt/v4"
_ "github.com/asim/go-micro/plugins/broker/nats/v4"
_ "github.com/asim/go-micro/plugins/broker/rabbitmq/v4"
_ "github.com/asim/go-micro/plugins/broker/redis/v4"
_ "github.com/asim/go-micro/plugins/registry/consul/v4"
_ "github.com/asim/go-micro/plugins/registry/etcd/v4"
_ "github.com/asim/go-micro/plugins/registry/eureka/v4"

View File

@@ -1,5 +1,5 @@
// Code generated by fileb0x at "2021-11-22 18:03:08.6921519 +0800 CST m=+0.057344801" from config file "b0x.yaml" DO NOT EDIT.
// modification hash(781cbd1c3197446ff0f2b64f4796afe6.8be3f833d63e3c844663716446e13a42)
// Code generated by fileb0x at "2021-12-02 10:03:04.6115997 +0800 CST m=+0.057062001" from config file "b0x.yaml" DO NOT EDIT.
// modification hash(c71255f8c39564687acdced2f2c06267.8be3f833d63e3c844663716446e13a42)
package web

View File

@@ -1,5 +1,5 @@
// Code generaTed by fileb0x at "2021-11-22 18:03:08.8641807 +0800 CST m=+0.229373601" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-11-22 18:02:53.9145863 +0800 CST)
// Code generaTed by fileb0x at "2021-12-02 10:03:04.6170147 +0800 CST m=+0.062477001" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-02 09:58:47.9180366 +0800 CST)
// original path: frontend\dist\449.ea3505f8c3a78bc5ec51.js
package web

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
// Code generaTed by fileb0x at "2021-11-22 18:03:08.6961831 +0800 CST m=+0.061376001" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-11-22 18:02:53.9135874 +0800 CST)
// Code generaTed by fileb0x at "2021-12-02 10:03:04.7626995 +0800 CST m=+0.208161801" from config file "b0x.yaml" DO NOT EDIT.
// modified(2021-12-02 09:58:47.9180366 +0800 CST)
// original path: frontend\dist\polyfills.d3127c390f57a23419e1.js
package web

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long