mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
refactor network
This commit is contained in:
parent
f8f84b42ac
commit
35c59042bf
@ -3,15 +3,12 @@ package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"sort"
|
||||
"sync"
|
||||
|
||||
"github.com/micro/go-micro/v2/client"
|
||||
"github.com/micro/go-micro/v2/client/selector"
|
||||
"github.com/micro/go-micro/v2/registry"
|
||||
"github.com/micro/go-micro/v2/router"
|
||||
pb "github.com/micro/go-micro/v2/router/service/proto"
|
||||
)
|
||||
|
||||
type routerSelector struct {
|
||||
@ -19,105 +16,10 @@ type routerSelector struct {
|
||||
|
||||
// the router
|
||||
r router.Router
|
||||
|
||||
// the client we have
|
||||
c client.Client
|
||||
|
||||
// the client for the remote router
|
||||
rs pb.RouterService
|
||||
|
||||
// name of the router
|
||||
name string
|
||||
|
||||
// address of the remote router
|
||||
addr string
|
||||
|
||||
// whether to use the remote router
|
||||
remote bool
|
||||
}
|
||||
|
||||
type clientKey struct{}
|
||||
type routerKey struct{}
|
||||
|
||||
// getRoutes returns the routes whether they are remote or local
|
||||
func (r *routerSelector) getRoutes(service string) ([]router.Route, error) {
|
||||
if !r.remote {
|
||||
// lookup router for routes for the service
|
||||
return r.r.Lookup(
|
||||
router.QueryService(service),
|
||||
)
|
||||
}
|
||||
|
||||
// lookup the remote router
|
||||
|
||||
var addrs []string
|
||||
|
||||
// set the remote address if specified
|
||||
if len(r.addr) > 0 {
|
||||
addrs = append(addrs, r.addr)
|
||||
} else {
|
||||
// we have a name so we need to check the registry
|
||||
services, err := r.c.Options().Registry.GetService(r.name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, service := range services {
|
||||
for _, node := range service.Nodes {
|
||||
addrs = append(addrs, node.Address)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// no router addresses available
|
||||
if len(addrs) == 0 {
|
||||
return nil, selector.ErrNoneAvailable
|
||||
}
|
||||
|
||||
var pbRoutes *pb.LookupResponse
|
||||
var err error
|
||||
|
||||
// TODO: implement backoff and retries
|
||||
for _, addr := range addrs {
|
||||
// call the router
|
||||
pbRoutes, err = r.rs.Lookup(context.Background(), &pb.LookupRequest{
|
||||
Query: &pb.Query{
|
||||
Service: service,
|
||||
},
|
||||
}, client.WithAddress(addr))
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
// errored out
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// no routes
|
||||
if pbRoutes == nil {
|
||||
return nil, selector.ErrNoneAvailable
|
||||
}
|
||||
|
||||
routes := make([]router.Route, 0, len(pbRoutes.Routes))
|
||||
|
||||
// convert from pb to []*router.Route
|
||||
for _, r := range pbRoutes.Routes {
|
||||
routes = append(routes, router.Route{
|
||||
Service: r.Service,
|
||||
Address: r.Address,
|
||||
Gateway: r.Gateway,
|
||||
Network: r.Network,
|
||||
Link: r.Link,
|
||||
Metric: r.Metric,
|
||||
})
|
||||
}
|
||||
|
||||
return routes, nil
|
||||
}
|
||||
|
||||
func (r *routerSelector) Init(opts ...selector.Option) error {
|
||||
// no op
|
||||
return nil
|
||||
@ -129,7 +31,9 @@ func (r *routerSelector) Options() selector.Options {
|
||||
|
||||
func (r *routerSelector) Select(service string, opts ...selector.SelectOption) (selector.Next, error) {
|
||||
// TODO: pull routes asynchronously and cache
|
||||
routes, err := r.getRoutes(service)
|
||||
routes, err := r.r.Lookup(
|
||||
router.QueryService(service),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -215,47 +119,12 @@ func NewSelector(opts ...selector.Option) selector.Selector {
|
||||
)
|
||||
}
|
||||
|
||||
// try get client from the context
|
||||
c, ok := options.Context.Value(clientKey{}).(client.Client)
|
||||
if !ok {
|
||||
c = client.DefaultClient
|
||||
}
|
||||
|
||||
// get the router from env vars if its a remote service
|
||||
remote := true
|
||||
routerName := os.Getenv("MICRO_ROUTER")
|
||||
routerAddress := os.Getenv("MICRO_ROUTER_ADDRESS")
|
||||
|
||||
// start the router advertisements if we're running it locally
|
||||
if len(routerName) == 0 && len(routerAddress) == 0 {
|
||||
go r.Advertise()
|
||||
remote = false
|
||||
}
|
||||
|
||||
return &routerSelector{
|
||||
opts: options,
|
||||
// set the internal router
|
||||
r: r,
|
||||
// set the client
|
||||
c: c,
|
||||
// set the router client
|
||||
rs: pb.NewRouterService(routerName, c),
|
||||
// name of the router
|
||||
name: routerName,
|
||||
// address of router
|
||||
addr: routerAddress,
|
||||
// let ourselves know to use the remote router
|
||||
remote: remote,
|
||||
}
|
||||
}
|
||||
|
||||
// WithClient sets the client for the request
|
||||
func WithClient(c client.Client) selector.Option {
|
||||
return func(o *selector.Options) {
|
||||
if o.Context == nil {
|
||||
o.Context = context.Background()
|
||||
}
|
||||
o.Context = context.WithValue(o.Context, clientKey{}, c)
|
||||
}
|
||||
}
|
||||
|
||||
|
11
go.mod
11
go.mod
@ -19,7 +19,7 @@ require (
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible
|
||||
github.com/ef-ds/deque v1.0.4-0.20190904040645-54cb57c252a1
|
||||
github.com/evanphx/json-patch/v5 v5.0.0
|
||||
github.com/fsnotify/fsnotify v1.4.7
|
||||
github.com/fsnotify/fsnotify v1.4.9
|
||||
github.com/fsouza/go-dockerclient v1.6.0
|
||||
github.com/ghodss/yaml v1.0.0
|
||||
github.com/go-acme/lego/v3 v3.4.0
|
||||
@ -28,7 +28,7 @@ require (
|
||||
github.com/gobwas/pool v0.2.0 // indirect
|
||||
github.com/gobwas/ws v1.0.3
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
|
||||
github.com/golang/protobuf v1.4.0
|
||||
github.com/golang/protobuf v1.4.2
|
||||
github.com/google/uuid v1.1.1
|
||||
github.com/gorilla/handlers v1.4.2
|
||||
github.com/gorilla/websocket v1.4.1 // indirect
|
||||
@ -42,7 +42,7 @@ require (
|
||||
github.com/json-iterator/go v1.1.9 // indirect
|
||||
github.com/kr/pretty v0.1.0
|
||||
github.com/lib/pq v1.3.0
|
||||
github.com/lucas-clemente/quic-go v0.14.1
|
||||
github.com/lucas-clemente/quic-go v0.19.3
|
||||
github.com/micro/cli/v2 v2.1.2
|
||||
github.com/miekg/dns v1.1.27
|
||||
github.com/mitchellh/hashstructure v1.0.0
|
||||
@ -57,12 +57,11 @@ require (
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
|
||||
go.etcd.io/bbolt v1.3.4
|
||||
go.uber.org/zap v1.13.0
|
||||
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
|
||||
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381
|
||||
golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
|
||||
google.golang.org/grpc v1.26.0
|
||||
google.golang.org/protobuf v1.22.0 // indirect
|
||||
sigs.k8s.io/yaml v1.1.0 // indirect
|
||||
)
|
||||
|
150
go.sum
150
go.sum
@ -1,5 +1,7 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||
@ -11,7 +13,12 @@ cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7
|
||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||
contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA=
|
||||
dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU=
|
||||
dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4=
|
||||
dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
|
||||
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
|
||||
github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
|
||||
@ -38,8 +45,6 @@ github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:i
|
||||
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
|
||||
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
|
||||
github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.0/go.mod h1:zpDJeKyp9ScW4NNrbdr+Eyxvry3ilGPewKoXw3XGN1k=
|
||||
github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75 h1:3ILjVyslFbc4jl1w5TWuvvslFD/nDfR2H8tVaMVLrEY=
|
||||
github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75/go.mod h1:uAXEEpARkRhCZfEvy/y0Jcc888f9tHCc1W7/UeEtreE=
|
||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
|
||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
@ -62,6 +67,8 @@ github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngE
|
||||
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
|
||||
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
|
||||
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
|
||||
github.com/caddyserver/certmagic v0.10.6 h1:sCya6FmfaN74oZE46kqfaFOVoROD/mF36rTQfjN7TZc=
|
||||
github.com/caddyserver/certmagic v0.10.6/go.mod h1:Y8jcUBctgk/IhpAzlHKfimZNyXCkfGgRTC0orl8gROQ=
|
||||
github.com/cenkalti/backoff/v4 v4.0.0 h1:6VeaLF9aI+MAUQ95106HwWzYZgJJpZ4stumjj6RFYAU=
|
||||
@ -90,6 +97,7 @@ github.com/coreos/etcd v3.3.18+incompatible h1:Zz1aXgDrFFi1nadh58tA9ktt06cmPTwNN
|
||||
github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
|
||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c=
|
||||
@ -117,6 +125,7 @@ github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKoh
|
||||
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
|
||||
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
|
||||
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-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
|
||||
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
|
||||
@ -132,12 +141,16 @@ github.com/exoscale/egoscale v0.18.1/go.mod h1:Z7OOdzzTOz1Q1PjQXumlz9Wn/CddH0zSY
|
||||
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
||||
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
|
||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
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=
|
||||
github.com/fsouza/go-dockerclient v1.6.0 h1:f7j+AX94143JL1H3TiqSMkM4EcLDI0De1qD4GGn3Hig=
|
||||
github.com/fsouza/go-dockerclient v1.6.0/go.mod h1:YWwtNPuL4XTX1SKJQk86cWPmmqwx+4np9qfPbb+znGc=
|
||||
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
||||
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/v3 v3.4.0 h1:deB9NkelA+TfjGHVw8J7iKl/rMtffcGMWSMmptvMv0A=
|
||||
@ -173,14 +186,19 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV
|
||||
github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s=
|
||||
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=
|
||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
@ -192,6 +210,8 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
|
||||
@ -201,6 +221,7 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
@ -209,6 +230,8 @@ github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OI
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
|
||||
github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
|
||||
@ -220,10 +243,12 @@ github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z
|
||||
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
|
||||
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
@ -242,6 +267,7 @@ github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ=
|
||||
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
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/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
|
||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
|
||||
@ -268,6 +294,7 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
@ -278,13 +305,15 @@ github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU=
|
||||
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/linode/linodego v0.10.0/go.mod h1:cziNP7pbvE3mXIPneHj0oRY8L1WtGEIKlZ8LANE4eXA=
|
||||
github.com/liquidweb/liquidweb-go v1.6.0/go.mod h1:UDcVnAMDkZxpw4Y7NOHkqoeiGacVLEIG/i5J9cyixzQ=
|
||||
github.com/lucas-clemente/quic-go v0.14.1 h1:c1aKoBZKOPA+49q96B1wGkibyPP0AxYh45WuAoq+87E=
|
||||
github.com/lucas-clemente/quic-go v0.14.1/go.mod h1:Vn3/Fb0/77b02SGhQk36KzOUmXgVpFfizUfW5WMaqyU=
|
||||
github.com/marten-seemann/chacha20 v0.2.0 h1:f40vqzzx+3GdOmzQoItkLX5WLvHgPgyYqFFIO5Gh4hQ=
|
||||
github.com/marten-seemann/chacha20 v0.2.0/go.mod h1:HSdjFau7GzYRj+ahFNwsO3ouVJr1HFkWoEwNDb4TMtE=
|
||||
github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI=
|
||||
github.com/marten-seemann/qtls v0.4.1 h1:YlT8QP3WCCvvok7MGEZkMldXbyqgr8oFg5/n8Gtbkks=
|
||||
github.com/marten-seemann/qtls v0.4.1/go.mod h1:pxVXcHHw1pNIt8Qo0pwSYQEoZ8yYOOPXTCZLQQunvRc=
|
||||
github.com/lucas-clemente/quic-go v0.19.3 h1:eCDQqvGBB+kCTkA0XrAFtNe81FMa0/fn4QSoeAbmiF4=
|
||||
github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8=
|
||||
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
|
||||
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc=
|
||||
github.com/marten-seemann/qtls v0.10.0 h1:ECsuYUKalRL240rRD4Ri33ISb7kAQ3qGDlrrl55b2pc=
|
||||
github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs=
|
||||
github.com/marten-seemann/qtls-go1-15 v0.1.1 h1:LIH6K34bPVttyXnUWixk0bzH6/N07VxbSabxn5A5gZQ=
|
||||
github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
@ -293,6 +322,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/micro/cli/v2 v2.1.2 h1:43J1lChg/rZCC1rvdqZNFSQDrGT7qfMrtp6/ztpIkEM=
|
||||
github.com/micro/cli/v2 v2.1.2/go.mod h1:EguNh6DAoWKm9nmk+k/Rg0H3lQnDxqzu5x5srOtGtYg=
|
||||
github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4=
|
||||
github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/miekg/dns v1.1.27 h1:aEH/kqUzUxGJ/UHcEKdJY+ugH6WEzsEBBSPa8zuy1aM=
|
||||
github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
|
||||
@ -324,18 +354,28 @@ github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1t
|
||||
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=
|
||||
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
|
||||
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/nrdcg/auroradns v1.0.0/go.mod h1:6JPXKzIRzZzMqtTDgueIhTi6rFf1QvYE/HzqidhOhjw=
|
||||
github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ=
|
||||
github.com/nrdcg/goinwx v0.6.1/go.mod h1:XPiut7enlbEdntAqalBIqcYcTEVhpv/dKWgDCX2SwKQ=
|
||||
github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw=
|
||||
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||
github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
|
||||
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
|
||||
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ=
|
||||
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
@ -347,6 +387,7 @@ github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59P
|
||||
github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||
github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
|
||||
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
|
||||
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
|
||||
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
|
||||
github.com/oracle/oci-go-sdk v7.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
|
||||
github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014/go.mod h1:joRatxRJaZBsY3JAOEMcoOp05CnZzsx4scTxi95DHyQ=
|
||||
@ -361,6 +402,7 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
|
||||
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||
@ -371,10 +413,12 @@ github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.6.0 h1:kRhiuYSXR3+uv2IbVbZhUxK5zVD/2pp3Gd2PpvPkpEo=
|
||||
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
|
||||
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
@ -385,14 +429,39 @@ github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKc
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
|
||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/sacloud/libsacloud v1.26.1/go.mod h1:79ZwATmHLIFZIMd7sxA3LwzVy/B77uj3LDoToVTxDoQ=
|
||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
||||
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||
github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY=
|
||||
github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM=
|
||||
github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0=
|
||||
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
|
||||
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=
|
||||
github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw=
|
||||
github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI=
|
||||
github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU=
|
||||
github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag=
|
||||
github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg=
|
||||
github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw=
|
||||
github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y=
|
||||
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
|
||||
github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q=
|
||||
github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ=
|
||||
github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I=
|
||||
github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0=
|
||||
github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ=
|
||||
github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk=
|
||||
github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4=
|
||||
github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
||||
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
|
||||
@ -402,6 +471,8 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1
|
||||
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=
|
||||
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
||||
github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE=
|
||||
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA=
|
||||
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/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
@ -409,6 +480,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
|
||||
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
|
||||
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
|
||||
github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7/go.mod h1:imsgLplxEC/etjIhdr3dNzV3JeT27LbVu5pYWm0JCBY=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc h1:yUaosFVTJwnltaHbSNC3i82I92quFs+OFPRl8kNMVwo=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
@ -416,6 +488,8 @@ github.com/transip/gotransip v0.0.0-20190812104329-6d8d9179b66f/go.mod h1:i0f4R4
|
||||
github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g=
|
||||
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU=
|
||||
github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM=
|
||||
github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA=
|
||||
github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70=
|
||||
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
|
||||
@ -427,10 +501,12 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg=
|
||||
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
|
||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY=
|
||||
@ -444,23 +520,27 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU=
|
||||
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
|
||||
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
|
||||
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw=
|
||||
golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 h1:3zb4D3T4G8jdExgVU/95+vQXfpEPiMdCaZgmGVxjNHM=
|
||||
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw=
|
||||
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@ -468,6 +548,7 @@ golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm0
|
||||
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
@ -486,13 +567,15 @@ golang.org/x/net v0.0.0-20180611182652-db08ff08e862/go.mod h1:mL1N/T3taQHkDXs73r
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
@ -505,11 +588,15 @@ golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20191027093000-83d349e8ac1a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0=
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 h1:eDrdRpKgkcCqKZQwyZRyeFZgfqt37SL7Kv3tok06cKE=
|
||||
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU=
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/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=
|
||||
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@ -521,6 +608,7 @@ golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/go.mod h1:STP8DvDyc/dI5b8T5h
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
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=
|
||||
@ -528,6 +616,7 @@ golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5h
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@ -542,17 +631,23 @@ golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe h1:6fAMxZRR6sl1Uq8U61gxU+kPTs2tR8uOySCbBP7BN/M=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
|
||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o=
|
||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
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-20190921001708-c4c64cad1fd0 h1:xQwXv67TxFo9nC1GJFyab5eq/5B590r6RlnL/G8Sz7w=
|
||||
@ -562,6 +657,7 @@ golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxb
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
@ -587,6 +683,9 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
||||
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
||||
google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y=
|
||||
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
@ -594,11 +693,16 @@ google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEn
|
||||
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
|
||||
google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
@ -608,6 +712,8 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98
|
||||
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc=
|
||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
||||
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
|
||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
@ -622,8 +728,8 @@ google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.22.0 h1:cJv5/xdbk1NnMPR1VP9+HU6gupuG9MLBoH1r6RHZ2MY=
|
||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
@ -635,6 +741,7 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.44.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ns1/ns1-go.v2 v2.0.0-20190730140822-b51389932cbc/go.mod h1:VV+3haRsgDiVLxyifmMBrBIuCWFBPYKbRssXB9z67Hw=
|
||||
@ -652,8 +759,11 @@ gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
|
||||
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
|
||||
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
|
||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
@ -663,5 +773,9 @@ honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXe
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck=
|
||||
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
|
||||
|
@ -16,19 +16,17 @@ import (
|
||||
cmucp "github.com/micro/go-micro/v2/client/mucp"
|
||||
rtr "github.com/micro/go-micro/v2/client/selector/router"
|
||||
"github.com/micro/go-micro/v2/logger"
|
||||
pbNet "github.com/micro/go-micro/v2/network/proto"
|
||||
"github.com/micro/go-micro/v2/network/resolver/dns"
|
||||
pbNet "github.com/micro/go-micro/v2/network/service/proto"
|
||||
"github.com/micro/go-micro/v2/proxy"
|
||||
"github.com/micro/go-micro/v2/router"
|
||||
pbRtr "github.com/micro/go-micro/v2/router/service/proto"
|
||||
"github.com/micro/go-micro/v2/server"
|
||||
smucp "github.com/micro/go-micro/v2/server/mucp"
|
||||
"github.com/micro/go-micro/v2/transport"
|
||||
"github.com/micro/go-micro/v2/network/tunnel"
|
||||
bun "github.com/micro/go-micro/v2/network/tunnel/broker"
|
||||
tun "github.com/micro/go-micro/v2/network/tunnel/transport"
|
||||
"github.com/micro/go-micro/v2/proxy"
|
||||
"github.com/micro/go-micro/v2/router"
|
||||
"github.com/micro/go-micro/v2/server"
|
||||
smucp "github.com/micro/go-micro/v2/server/mucp"
|
||||
"github.com/micro/go-micro/v2/transport"
|
||||
"github.com/micro/go-micro/v2/util/backoff"
|
||||
pbUtil "github.com/micro/go-micro/v2/util/proto"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -274,7 +272,7 @@ func (n *network) acceptCtrlConn(l tunnel.Listener, recv chan *message) {
|
||||
}
|
||||
|
||||
// maskRoute will mask the route so that we apply the right values
|
||||
func (n *network) maskRoute(r *pbRtr.Route) {
|
||||
func (n *network) maskRoute(r *pbNet.Route) {
|
||||
hasher := fnv.New64()
|
||||
// the routes service address
|
||||
address := r.Address
|
||||
@ -309,11 +307,11 @@ func (n *network) advertise(advertChan <-chan *router.Advert) {
|
||||
// process local adverts and randomly fire them at other nodes
|
||||
case advert := <-advertChan:
|
||||
// create a proto advert
|
||||
var events []*pbRtr.Event
|
||||
var events []*pbNet.Event
|
||||
|
||||
for _, event := range advert.Events {
|
||||
// make a copy of the route
|
||||
route := &pbRtr.Route{
|
||||
route := &pbNet.Route{
|
||||
Service: event.Route.Service,
|
||||
Address: event.Route.Address,
|
||||
Gateway: event.Route.Gateway,
|
||||
@ -326,8 +324,8 @@ func (n *network) advertise(advertChan <-chan *router.Advert) {
|
||||
// override the various values
|
||||
n.maskRoute(route)
|
||||
|
||||
e := &pbRtr.Event{
|
||||
Type: pbRtr.EventType(event.Type),
|
||||
e := &pbNet.Event{
|
||||
Type: pbNet.EventType(event.Type),
|
||||
Timestamp: event.Timestamp.UnixNano(),
|
||||
Route: route,
|
||||
}
|
||||
@ -335,9 +333,9 @@ func (n *network) advertise(advertChan <-chan *router.Advert) {
|
||||
events = append(events, e)
|
||||
}
|
||||
|
||||
msg := &pbRtr.Advert{
|
||||
msg := &pbNet.Advert{
|
||||
Id: advert.Id,
|
||||
Type: pbRtr.AdvertType(advert.Type),
|
||||
Type: pbNet.AdvertType(advert.Type),
|
||||
Timestamp: advert.Timestamp.UnixNano(),
|
||||
Events: events,
|
||||
}
|
||||
@ -648,9 +646,9 @@ func (n *network) processCtrlChan(listener tunnel.Listener) {
|
||||
// switch on type of message and take action
|
||||
switch m.msg.Header["Micro-Method"] {
|
||||
case "advert":
|
||||
pbRtrAdvert := &pbRtr.Advert{}
|
||||
pbNetAdvert := &pbNet.Advert{}
|
||||
|
||||
if err := proto.Unmarshal(m.msg.Body, pbRtrAdvert); err != nil {
|
||||
if err := proto.Unmarshal(m.msg.Body, pbNetAdvert); err != nil {
|
||||
if logger.V(logger.DebugLevel, logger.DefaultLogger) {
|
||||
logger.Debugf("Network fail to unmarshal advert message: %v", err)
|
||||
}
|
||||
@ -658,38 +656,38 @@ func (n *network) processCtrlChan(listener tunnel.Listener) {
|
||||
}
|
||||
|
||||
// don't process your own messages
|
||||
if pbRtrAdvert.Id == n.options.Id {
|
||||
if pbNetAdvert.Id == n.options.Id {
|
||||
continue
|
||||
}
|
||||
if logger.V(logger.DebugLevel, logger.DefaultLogger) {
|
||||
logger.Debugf("Network received advert message from: %s", pbRtrAdvert.Id)
|
||||
logger.Debugf("Network received advert message from: %s", pbNetAdvert.Id)
|
||||
}
|
||||
|
||||
// loookup advertising node in our peer topology
|
||||
advertNode := n.node.GetPeerNode(pbRtrAdvert.Id)
|
||||
advertNode := n.node.GetPeerNode(pbNetAdvert.Id)
|
||||
if advertNode == nil {
|
||||
// if we can't find the node in our topology (MaxDepth) we skipp prcessing adverts
|
||||
if logger.V(logger.DebugLevel, logger.DefaultLogger) {
|
||||
logger.Debugf("Network skipping advert message from unknown peer: %s", pbRtrAdvert.Id)
|
||||
logger.Debugf("Network skipping advert message from unknown peer: %s", pbNetAdvert.Id)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
var events []*router.Event
|
||||
|
||||
for _, event := range pbRtrAdvert.Events {
|
||||
for _, event := range pbNetAdvert.Events {
|
||||
// for backwards compatibility reasons
|
||||
if event == nil || event.Route == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
// we know the advertising node is not the origin of the route
|
||||
if pbRtrAdvert.Id != event.Route.Router {
|
||||
if pbNetAdvert.Id != event.Route.Router {
|
||||
// if the origin router is not the advertising node peer
|
||||
// we can't rule out potential routing loops so we bail here
|
||||
if peer := advertNode.GetPeerNode(event.Route.Router); peer == nil {
|
||||
if logger.V(logger.DebugLevel, logger.DefaultLogger) {
|
||||
logger.Debugf("Network skipping advert message from peer: %s", pbRtrAdvert.Id)
|
||||
logger.Debugf("Network skipping advert message from peer: %s", pbNetAdvert.Id)
|
||||
}
|
||||
continue
|
||||
}
|
||||
@ -724,7 +722,7 @@ func (n *network) processCtrlChan(listener tunnel.Listener) {
|
||||
// create router event
|
||||
e := &router.Event{
|
||||
Type: router.EventType(event.Type),
|
||||
Timestamp: time.Unix(0, pbRtrAdvert.Timestamp),
|
||||
Timestamp: time.Unix(0, pbNetAdvert.Timestamp),
|
||||
Route: route,
|
||||
}
|
||||
events = append(events, e)
|
||||
@ -740,10 +738,10 @@ func (n *network) processCtrlChan(listener tunnel.Listener) {
|
||||
|
||||
// create an advert and process it
|
||||
advert := &router.Advert{
|
||||
Id: pbRtrAdvert.Id,
|
||||
Type: router.AdvertType(pbRtrAdvert.Type),
|
||||
Timestamp: time.Unix(0, pbRtrAdvert.Timestamp),
|
||||
TTL: time.Duration(pbRtrAdvert.Ttl),
|
||||
Id: pbNetAdvert.Id,
|
||||
Type: router.AdvertType(pbNetAdvert.Type),
|
||||
Timestamp: time.Unix(0, pbNetAdvert.Timestamp),
|
||||
TTL: time.Duration(pbNetAdvert.Ttl),
|
||||
Events: events,
|
||||
}
|
||||
|
||||
@ -990,7 +988,7 @@ func (n *network) processNetChan(listener tunnel.Listener) {
|
||||
// add all the routes we have received in the sync message
|
||||
for _, pbRoute := range pbNetSync.Routes {
|
||||
// unmarshal the routes received from remote peer
|
||||
route := pbUtil.ProtoToRoute(pbRoute)
|
||||
route := protoToRoute(pbRoute)
|
||||
// continue if we are the originator of the route
|
||||
if route.Router == n.router.Options().Id {
|
||||
if logger.V(logger.DebugLevel, logger.DefaultLogger) {
|
||||
@ -1395,7 +1393,7 @@ func (n *network) manage() {
|
||||
// getAdvertProtoRoutes returns a list of routes to advertise to remote peer
|
||||
// based on the advertisement strategy encoded in protobuf
|
||||
// It returns error if the routes failed to be retrieved from the routing table
|
||||
func (n *network) getProtoRoutes() ([]*pbRtr.Route, error) {
|
||||
func (n *network) getProtoRoutes() ([]*pbNet.Route, error) {
|
||||
// get a list of the best routes for each service in our routing table
|
||||
q := []router.QueryOption{
|
||||
router.QueryStrategy(n.router.Options().Advertise),
|
||||
@ -1407,10 +1405,10 @@ func (n *network) getProtoRoutes() ([]*pbRtr.Route, error) {
|
||||
}
|
||||
|
||||
// encode the routes to protobuf
|
||||
pbRoutes := make([]*pbRtr.Route, 0, len(routes))
|
||||
pbRoutes := make([]*pbNet.Route, 0, len(routes))
|
||||
for _, route := range routes {
|
||||
// generate new route proto
|
||||
pbRoute := pbUtil.RouteToProto(route)
|
||||
pbRoute := routeToProto(route)
|
||||
// mask the route before outbounding
|
||||
n.maskRoute(pbRoute)
|
||||
// add to list of routes
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
pb "github.com/micro/go-micro/v2/network/service/proto"
|
||||
pb "github.com/micro/go-micro/v2/network/proto"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
pb "github.com/micro/go-micro/v2/network/service/proto"
|
||||
pb "github.com/micro/go-micro/v2/network/proto"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -4,10 +4,10 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/micro/go-micro/v2/network/resolver"
|
||||
"github.com/micro/go-micro/v2/network/resolver/registry"
|
||||
"github.com/micro/go-micro/v2/network/tunnel"
|
||||
"github.com/micro/go-micro/v2/proxy"
|
||||
"github.com/micro/go-micro/v2/proxy/mucp"
|
||||
"github.com/micro/go-micro/v2/router"
|
||||
"github.com/micro/go-micro/v2/network/tunnel"
|
||||
)
|
||||
|
||||
type Option func(*Options)
|
||||
|
@ -1,16 +1,11 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: network/service/proto/network.proto
|
||||
// source: proto/network.proto
|
||||
|
||||
package go_micro_network
|
||||
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
proto1 "github.com/micro/go-micro/v2/router/service/proto"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
math "math"
|
||||
)
|
||||
|
||||
@ -25,6 +20,301 @@ var _ = math.Inf
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// AdvertType defines the type of advert
|
||||
type AdvertType int32
|
||||
|
||||
const (
|
||||
AdvertType_AdvertAnnounce AdvertType = 0
|
||||
AdvertType_AdvertUpdate AdvertType = 1
|
||||
)
|
||||
|
||||
var AdvertType_name = map[int32]string{
|
||||
0: "AdvertAnnounce",
|
||||
1: "AdvertUpdate",
|
||||
}
|
||||
|
||||
var AdvertType_value = map[string]int32{
|
||||
"AdvertAnnounce": 0,
|
||||
"AdvertUpdate": 1,
|
||||
}
|
||||
|
||||
func (x AdvertType) String() string {
|
||||
return proto.EnumName(AdvertType_name, int32(x))
|
||||
}
|
||||
|
||||
func (AdvertType) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{0}
|
||||
}
|
||||
|
||||
// EventType defines the type of event
|
||||
type EventType int32
|
||||
|
||||
const (
|
||||
EventType_Create EventType = 0
|
||||
EventType_Delete EventType = 1
|
||||
EventType_Update EventType = 2
|
||||
)
|
||||
|
||||
var EventType_name = map[int32]string{
|
||||
0: "Create",
|
||||
1: "Delete",
|
||||
2: "Update",
|
||||
}
|
||||
|
||||
var EventType_value = map[string]int32{
|
||||
"Create": 0,
|
||||
"Delete": 1,
|
||||
"Update": 2,
|
||||
}
|
||||
|
||||
func (x EventType) String() string {
|
||||
return proto.EnumName(EventType_name, int32(x))
|
||||
}
|
||||
|
||||
func (EventType) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{1}
|
||||
}
|
||||
|
||||
// Route is a service route
|
||||
type Route struct {
|
||||
// service for the route
|
||||
Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
|
||||
// the address that advertise this route
|
||||
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
|
||||
// gateway as the next hop
|
||||
Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"`
|
||||
// the network for this destination
|
||||
Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"`
|
||||
// router if the router id
|
||||
Router string `protobuf:"bytes,5,opt,name=router,proto3" json:"router,omitempty"`
|
||||
// the network link
|
||||
Link string `protobuf:"bytes,6,opt,name=link,proto3" json:"link,omitempty"`
|
||||
// the metric / score of this route
|
||||
Metric int64 `protobuf:"varint,7,opt,name=metric,proto3" json:"metric,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Route) Reset() { *m = Route{} }
|
||||
func (m *Route) String() string { return proto.CompactTextString(m) }
|
||||
func (*Route) ProtoMessage() {}
|
||||
func (*Route) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{0}
|
||||
}
|
||||
|
||||
func (m *Route) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Route.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Route.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Route) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Route.Merge(m, src)
|
||||
}
|
||||
func (m *Route) XXX_Size() int {
|
||||
return xxx_messageInfo_Route.Size(m)
|
||||
}
|
||||
func (m *Route) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Route.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Route proto.InternalMessageInfo
|
||||
|
||||
func (m *Route) GetService() string {
|
||||
if m != nil {
|
||||
return m.Service
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Route) GetAddress() string {
|
||||
if m != nil {
|
||||
return m.Address
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Route) GetGateway() string {
|
||||
if m != nil {
|
||||
return m.Gateway
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Route) GetNetwork() string {
|
||||
if m != nil {
|
||||
return m.Network
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Route) GetRouter() string {
|
||||
if m != nil {
|
||||
return m.Router
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Route) GetLink() string {
|
||||
if m != nil {
|
||||
return m.Link
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Route) GetMetric() int64 {
|
||||
if m != nil {
|
||||
return m.Metric
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Advert is router advertsement streamed by Watch
|
||||
type Advert struct {
|
||||
// id of the advertising router
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
// type of advertisement
|
||||
Type AdvertType `protobuf:"varint,2,opt,name=type,proto3,enum=go.micro.network.AdvertType" json:"type,omitempty"`
|
||||
// unix timestamp of the advertisement
|
||||
Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
|
||||
// TTL of the Advert
|
||||
Ttl int64 `protobuf:"varint,4,opt,name=ttl,proto3" json:"ttl,omitempty"`
|
||||
// events is a list of advertised events
|
||||
Events []*Event `protobuf:"bytes,5,rep,name=events,proto3" json:"events,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Advert) Reset() { *m = Advert{} }
|
||||
func (m *Advert) String() string { return proto.CompactTextString(m) }
|
||||
func (*Advert) ProtoMessage() {}
|
||||
func (*Advert) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{1}
|
||||
}
|
||||
|
||||
func (m *Advert) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Advert.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Advert) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Advert.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Advert) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Advert.Merge(m, src)
|
||||
}
|
||||
func (m *Advert) XXX_Size() int {
|
||||
return xxx_messageInfo_Advert.Size(m)
|
||||
}
|
||||
func (m *Advert) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Advert.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Advert proto.InternalMessageInfo
|
||||
|
||||
func (m *Advert) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Advert) GetType() AdvertType {
|
||||
if m != nil {
|
||||
return m.Type
|
||||
}
|
||||
return AdvertType_AdvertAnnounce
|
||||
}
|
||||
|
||||
func (m *Advert) GetTimestamp() int64 {
|
||||
if m != nil {
|
||||
return m.Timestamp
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Advert) GetTtl() int64 {
|
||||
if m != nil {
|
||||
return m.Ttl
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Advert) GetEvents() []*Event {
|
||||
if m != nil {
|
||||
return m.Events
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Event is routing table event
|
||||
type Event struct {
|
||||
// the unique event id
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
// type of event
|
||||
Type EventType `protobuf:"varint,2,opt,name=type,proto3,enum=go.micro.network.EventType" json:"type,omitempty"`
|
||||
// unix timestamp of event
|
||||
Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
|
||||
// service route
|
||||
Route *Route `protobuf:"bytes,4,opt,name=route,proto3" json:"route,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Event) Reset() { *m = Event{} }
|
||||
func (m *Event) String() string { return proto.CompactTextString(m) }
|
||||
func (*Event) ProtoMessage() {}
|
||||
func (*Event) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{2}
|
||||
}
|
||||
|
||||
func (m *Event) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Event.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Event.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Event) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Event.Merge(m, src)
|
||||
}
|
||||
func (m *Event) XXX_Size() int {
|
||||
return xxx_messageInfo_Event.Size(m)
|
||||
}
|
||||
func (m *Event) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Event.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Event proto.InternalMessageInfo
|
||||
|
||||
func (m *Event) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Event) GetType() EventType {
|
||||
if m != nil {
|
||||
return m.Type
|
||||
}
|
||||
return EventType_Create
|
||||
}
|
||||
|
||||
func (m *Event) GetTimestamp() int64 {
|
||||
if m != nil {
|
||||
return m.Timestamp
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Event) GetRoute() *Route {
|
||||
if m != nil {
|
||||
return m.Route
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Query is passed in a LookupRequest
|
||||
type Query struct {
|
||||
Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
|
||||
@ -41,7 +331,7 @@ func (m *Query) Reset() { *m = Query{} }
|
||||
func (m *Query) String() string { return proto.CompactTextString(m) }
|
||||
func (*Query) ProtoMessage() {}
|
||||
func (*Query) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{0}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{3}
|
||||
}
|
||||
|
||||
func (m *Query) XXX_Unmarshal(b []byte) error {
|
||||
@ -108,7 +398,7 @@ func (m *ConnectRequest) Reset() { *m = ConnectRequest{} }
|
||||
func (m *ConnectRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ConnectRequest) ProtoMessage() {}
|
||||
func (*ConnectRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{1}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{4}
|
||||
}
|
||||
|
||||
func (m *ConnectRequest) XXX_Unmarshal(b []byte) error {
|
||||
@ -146,7 +436,7 @@ func (m *ConnectResponse) Reset() { *m = ConnectResponse{} }
|
||||
func (m *ConnectResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ConnectResponse) ProtoMessage() {}
|
||||
func (*ConnectResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{2}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{5}
|
||||
}
|
||||
|
||||
func (m *ConnectResponse) XXX_Unmarshal(b []byte) error {
|
||||
@ -180,7 +470,7 @@ func (m *NodesRequest) Reset() { *m = NodesRequest{} }
|
||||
func (m *NodesRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*NodesRequest) ProtoMessage() {}
|
||||
func (*NodesRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{3}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{6}
|
||||
}
|
||||
|
||||
func (m *NodesRequest) XXX_Unmarshal(b []byte) error {
|
||||
@ -221,7 +511,7 @@ func (m *NodesResponse) Reset() { *m = NodesResponse{} }
|
||||
func (m *NodesResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*NodesResponse) ProtoMessage() {}
|
||||
func (*NodesResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{4}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{7}
|
||||
}
|
||||
|
||||
func (m *NodesResponse) XXX_Unmarshal(b []byte) error {
|
||||
@ -261,7 +551,7 @@ func (m *GraphRequest) Reset() { *m = GraphRequest{} }
|
||||
func (m *GraphRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GraphRequest) ProtoMessage() {}
|
||||
func (*GraphRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{5}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{8}
|
||||
}
|
||||
|
||||
func (m *GraphRequest) XXX_Unmarshal(b []byte) error {
|
||||
@ -300,7 +590,7 @@ func (m *GraphResponse) Reset() { *m = GraphResponse{} }
|
||||
func (m *GraphResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*GraphResponse) ProtoMessage() {}
|
||||
func (*GraphResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{6}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{9}
|
||||
}
|
||||
|
||||
func (m *GraphResponse) XXX_Unmarshal(b []byte) error {
|
||||
@ -340,7 +630,7 @@ func (m *RoutesRequest) Reset() { *m = RoutesRequest{} }
|
||||
func (m *RoutesRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*RoutesRequest) ProtoMessage() {}
|
||||
func (*RoutesRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{7}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{10}
|
||||
}
|
||||
|
||||
func (m *RoutesRequest) XXX_Unmarshal(b []byte) error {
|
||||
@ -369,7 +659,7 @@ func (m *RoutesRequest) GetQuery() *Query {
|
||||
}
|
||||
|
||||
type RoutesResponse struct {
|
||||
Routes []*proto1.Route `protobuf:"bytes,1,rep,name=routes,proto3" json:"routes,omitempty"`
|
||||
Routes []*Route `protobuf:"bytes,1,rep,name=routes,proto3" json:"routes,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
@ -379,7 +669,7 @@ func (m *RoutesResponse) Reset() { *m = RoutesResponse{} }
|
||||
func (m *RoutesResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*RoutesResponse) ProtoMessage() {}
|
||||
func (*RoutesResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{8}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{11}
|
||||
}
|
||||
|
||||
func (m *RoutesResponse) XXX_Unmarshal(b []byte) error {
|
||||
@ -400,7 +690,7 @@ func (m *RoutesResponse) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_RoutesResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *RoutesResponse) GetRoutes() []*proto1.Route {
|
||||
func (m *RoutesResponse) GetRoutes() []*Route {
|
||||
if m != nil {
|
||||
return m.Routes
|
||||
}
|
||||
@ -417,7 +707,7 @@ func (m *ServicesRequest) Reset() { *m = ServicesRequest{} }
|
||||
func (m *ServicesRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ServicesRequest) ProtoMessage() {}
|
||||
func (*ServicesRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{9}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{12}
|
||||
}
|
||||
|
||||
func (m *ServicesRequest) XXX_Unmarshal(b []byte) error {
|
||||
@ -449,7 +739,7 @@ func (m *ServicesResponse) Reset() { *m = ServicesResponse{} }
|
||||
func (m *ServicesResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ServicesResponse) ProtoMessage() {}
|
||||
func (*ServicesResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{10}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{13}
|
||||
}
|
||||
|
||||
func (m *ServicesResponse) XXX_Unmarshal(b []byte) error {
|
||||
@ -487,7 +777,7 @@ func (m *StatusRequest) Reset() { *m = StatusRequest{} }
|
||||
func (m *StatusRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*StatusRequest) ProtoMessage() {}
|
||||
func (*StatusRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{11}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{14}
|
||||
}
|
||||
|
||||
func (m *StatusRequest) XXX_Unmarshal(b []byte) error {
|
||||
@ -519,7 +809,7 @@ func (m *StatusResponse) Reset() { *m = StatusResponse{} }
|
||||
func (m *StatusResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*StatusResponse) ProtoMessage() {}
|
||||
func (*StatusResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{12}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{15}
|
||||
}
|
||||
|
||||
func (m *StatusResponse) XXX_Unmarshal(b []byte) error {
|
||||
@ -560,7 +850,7 @@ func (m *Error) Reset() { *m = Error{} }
|
||||
func (m *Error) String() string { return proto.CompactTextString(m) }
|
||||
func (*Error) ProtoMessage() {}
|
||||
func (*Error) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{13}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{16}
|
||||
}
|
||||
|
||||
func (m *Error) XXX_Unmarshal(b []byte) error {
|
||||
@ -607,7 +897,7 @@ func (m *Status) Reset() { *m = Status{} }
|
||||
func (m *Status) String() string { return proto.CompactTextString(m) }
|
||||
func (*Status) ProtoMessage() {}
|
||||
func (*Status) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{14}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{17}
|
||||
}
|
||||
|
||||
func (m *Status) XXX_Unmarshal(b []byte) error {
|
||||
@ -656,7 +946,7 @@ func (m *Node) Reset() { *m = Node{} }
|
||||
func (m *Node) String() string { return proto.CompactTextString(m) }
|
||||
func (*Node) ProtoMessage() {}
|
||||
func (*Node) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{15}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{18}
|
||||
}
|
||||
|
||||
func (m *Node) XXX_Unmarshal(b []byte) error {
|
||||
@ -725,7 +1015,7 @@ func (m *Connect) Reset() { *m = Connect{} }
|
||||
func (m *Connect) String() string { return proto.CompactTextString(m) }
|
||||
func (*Connect) ProtoMessage() {}
|
||||
func (*Connect) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{16}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{19}
|
||||
}
|
||||
|
||||
func (m *Connect) XXX_Unmarshal(b []byte) error {
|
||||
@ -766,7 +1056,7 @@ func (m *Close) Reset() { *m = Close{} }
|
||||
func (m *Close) String() string { return proto.CompactTextString(m) }
|
||||
func (*Close) ProtoMessage() {}
|
||||
func (*Close) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{17}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{20}
|
||||
}
|
||||
|
||||
func (m *Close) XXX_Unmarshal(b []byte) error {
|
||||
@ -809,7 +1099,7 @@ func (m *Peer) Reset() { *m = Peer{} }
|
||||
func (m *Peer) String() string { return proto.CompactTextString(m) }
|
||||
func (*Peer) ProtoMessage() {}
|
||||
func (*Peer) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{18}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{21}
|
||||
}
|
||||
|
||||
func (m *Peer) XXX_Unmarshal(b []byte) error {
|
||||
@ -849,7 +1139,7 @@ type Sync struct {
|
||||
// peer origin
|
||||
Peer *Peer `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"`
|
||||
// node routes
|
||||
Routes []*proto1.Route `protobuf:"bytes,2,rep,name=routes,proto3" json:"routes,omitempty"`
|
||||
Routes []*Route `protobuf:"bytes,2,rep,name=routes,proto3" json:"routes,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
@ -859,7 +1149,7 @@ func (m *Sync) Reset() { *m = Sync{} }
|
||||
func (m *Sync) String() string { return proto.CompactTextString(m) }
|
||||
func (*Sync) ProtoMessage() {}
|
||||
func (*Sync) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1aab434177f140e0, []int{19}
|
||||
return fileDescriptor_3fa77ddec0d08062, []int{22}
|
||||
}
|
||||
|
||||
func (m *Sync) XXX_Unmarshal(b []byte) error {
|
||||
@ -887,7 +1177,7 @@ func (m *Sync) GetPeer() *Peer {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Sync) GetRoutes() []*proto1.Route {
|
||||
func (m *Sync) GetRoutes() []*Route {
|
||||
if m != nil {
|
||||
return m.Routes
|
||||
}
|
||||
@ -895,6 +1185,11 @@ func (m *Sync) GetRoutes() []*proto1.Route {
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterEnum("go.micro.network.AdvertType", AdvertType_name, AdvertType_value)
|
||||
proto.RegisterEnum("go.micro.network.EventType", EventType_name, EventType_value)
|
||||
proto.RegisterType((*Route)(nil), "go.micro.network.Route")
|
||||
proto.RegisterType((*Advert)(nil), "go.micro.network.Advert")
|
||||
proto.RegisterType((*Event)(nil), "go.micro.network.Event")
|
||||
proto.RegisterType((*Query)(nil), "go.micro.network.Query")
|
||||
proto.RegisterType((*ConnectRequest)(nil), "go.micro.network.ConnectRequest")
|
||||
proto.RegisterType((*ConnectResponse)(nil), "go.micro.network.ConnectResponse")
|
||||
@ -918,324 +1213,62 @@ func init() {
|
||||
proto.RegisterType((*Sync)(nil), "go.micro.network.Sync")
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("network/service/proto/network.proto", fileDescriptor_1aab434177f140e0)
|
||||
}
|
||||
func init() { proto.RegisterFile("proto/network.proto", fileDescriptor_3fa77ddec0d08062) }
|
||||
|
||||
var fileDescriptor_1aab434177f140e0 = []byte{
|
||||
// 667 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xdd, 0x4e, 0xdb, 0x4c,
|
||||
0x10, 0xc5, 0xb1, 0x1d, 0x60, 0x3e, 0x1c, 0xf8, 0x56, 0x15, 0xb5, 0x7c, 0x51, 0xc2, 0x96, 0x0b,
|
||||
0x54, 0xb5, 0x4e, 0x05, 0xaa, 0x5a, 0x15, 0x15, 0xa1, 0x22, 0x54, 0xa9, 0x12, 0x88, 0x3a, 0x2f,
|
||||
0x50, 0x13, 0xaf, 0x20, 0x02, 0xbc, 0x61, 0xbd, 0x06, 0xe5, 0x09, 0xfa, 0xa6, 0x7d, 0x89, 0xde,
|
||||
0x54, 0xbb, 0x3b, 0x36, 0x36, 0xb1, 0xd3, 0x70, 0x97, 0x99, 0x3d, 0x67, 0xc6, 0xf3, 0x77, 0x02,
|
||||
0xaf, 0x53, 0x26, 0x1f, 0xb8, 0xb8, 0x1e, 0x64, 0x4c, 0xdc, 0x8f, 0x47, 0x6c, 0x30, 0x11, 0x5c,
|
||||
0xf2, 0x01, 0x7a, 0x43, 0x6d, 0x91, 0x8d, 0x4b, 0x1e, 0xde, 0x8e, 0x47, 0x82, 0x87, 0xe8, 0x0f,
|
||||
0xb6, 0x05, 0xcf, 0x25, 0x13, 0x4f, 0x58, 0xc6, 0x69, 0x48, 0xf4, 0x97, 0x05, 0xee, 0x8f, 0x9c,
|
||||
0x89, 0x29, 0xf1, 0x61, 0x19, 0x71, 0xbe, 0xd5, 0xb7, 0x76, 0x57, 0xa3, 0xc2, 0x54, 0x2f, 0x71,
|
||||
0x92, 0x08, 0x96, 0x65, 0x7e, 0xc7, 0xbc, 0xa0, 0xa9, 0x5e, 0x2e, 0x63, 0xc9, 0x1e, 0xe2, 0xa9,
|
||||
0x6f, 0x9b, 0x17, 0x34, 0xc9, 0x26, 0x74, 0x4d, 0x1e, 0xdf, 0xd1, 0x0f, 0x68, 0x29, 0x06, 0x7e,
|
||||
0x9d, 0xef, 0x1a, 0x06, 0x9a, 0xf4, 0x10, 0x7a, 0xc7, 0x3c, 0x4d, 0xd9, 0x48, 0x46, 0xec, 0x2e,
|
||||
0x67, 0x99, 0x24, 0x6f, 0xc1, 0x4d, 0x79, 0xc2, 0x32, 0xdf, 0xea, 0xdb, 0xbb, 0xff, 0xed, 0x6d,
|
||||
0x86, 0x4f, 0x0b, 0x0c, 0xcf, 0x78, 0xc2, 0x22, 0x03, 0xa2, 0xff, 0xc3, 0x7a, 0xc9, 0xcf, 0x26,
|
||||
0x3c, 0xcd, 0x18, 0xdd, 0x81, 0x35, 0x85, 0xc8, 0x8a, 0x80, 0x2f, 0xc0, 0x4d, 0xd8, 0x44, 0x5e,
|
||||
0xe9, 0x02, 0xbd, 0xc8, 0x18, 0xf4, 0x0b, 0x78, 0x88, 0x32, 0xb4, 0x67, 0xe6, 0xdd, 0x81, 0xb5,
|
||||
0x6f, 0x22, 0x9e, 0x5c, 0xcd, 0x4f, 0x72, 0x00, 0x1e, 0xa2, 0x30, 0xc9, 0x1b, 0x70, 0x04, 0xe7,
|
||||
0x52, 0xa3, 0x1a, 0x73, 0x9c, 0x33, 0x26, 0x22, 0x8d, 0xa1, 0x87, 0xe0, 0x45, 0xaa, 0x7d, 0x65,
|
||||
0x21, 0xef, 0xc0, 0xbd, 0x53, 0x43, 0x43, 0xf6, 0xcb, 0x59, 0xb6, 0x9e, 0x69, 0x64, 0x50, 0xf4,
|
||||
0x08, 0x7a, 0x05, 0x1f, 0xb3, 0x87, 0x38, 0x9e, 0x86, 0x1a, 0x71, 0x3d, 0x34, 0x01, 0xc7, 0xa6,
|
||||
0x9b, 0x3b, 0x34, 0xdb, 0x50, 0x7c, 0x03, 0x0d, 0x61, 0xe3, 0xd1, 0x85, 0x61, 0x03, 0x58, 0xc1,
|
||||
0xa5, 0x31, 0x81, 0x57, 0xa3, 0xd2, 0xa6, 0xeb, 0xe0, 0x0d, 0x65, 0x2c, 0xf3, 0x32, 0xc0, 0x57,
|
||||
0xe8, 0x15, 0x0e, 0xa4, 0xbf, 0x87, 0x6e, 0xa6, 0x3d, 0x58, 0x97, 0x3f, 0x5b, 0x17, 0x32, 0x10,
|
||||
0x47, 0x07, 0xe0, 0x9e, 0x08, 0xc1, 0x85, 0xea, 0xfa, 0x88, 0xe7, 0xa9, 0x2c, 0xba, 0xae, 0x0d,
|
||||
0xb2, 0x01, 0xf6, 0x6d, 0x76, 0x89, 0x5b, 0xab, 0x7e, 0xd2, 0x8f, 0xd0, 0x35, 0x21, 0x54, 0x0f,
|
||||
0x99, 0xa2, 0xb6, 0xf7, 0x50, 0x47, 0x8e, 0x0c, 0x8a, 0xfe, 0xb1, 0xc0, 0x51, 0x63, 0x27, 0x3d,
|
||||
0xe8, 0x8c, 0x13, 0x3c, 0x91, 0xce, 0x38, 0x99, 0x7f, 0x1d, 0xc5, 0xae, 0xdb, 0xb5, 0x5d, 0x27,
|
||||
0x47, 0xb0, 0x72, 0xcb, 0x64, 0x9c, 0xc4, 0x32, 0xf6, 0x1d, 0x3d, 0x80, 0x9d, 0xe6, 0x25, 0x0b,
|
||||
0x4f, 0x11, 0x76, 0x92, 0x4a, 0x31, 0x8d, 0x4a, 0x56, 0xa5, 0x55, 0xee, 0x62, 0xad, 0x0a, 0x0e,
|
||||
0xc0, 0xab, 0x05, 0x53, 0xcd, 0xb9, 0x66, 0x53, 0xac, 0x44, 0xfd, 0x54, 0x4d, 0xbc, 0x8f, 0x6f,
|
||||
0x72, 0x86, 0x85, 0x18, 0xe3, 0x73, 0xe7, 0x93, 0x45, 0x3f, 0xc0, 0x32, 0x1e, 0x97, 0x5a, 0x5c,
|
||||
0xb5, 0xf8, 0xed, 0x8b, 0xab, 0x8f, 0x43, 0x63, 0xe8, 0x3e, 0xb8, 0xc7, 0x37, 0xdc, 0x6c, 0xfb,
|
||||
0xc2, 0xa4, 0x9f, 0xe0, 0xa8, 0xdd, 0x7f, 0x0e, 0x47, 0x9d, 0xec, 0x84, 0x31, 0xa1, 0x46, 0x60,
|
||||
0xcf, 0x39, 0x27, 0x03, 0xa2, 0x17, 0xe0, 0x0c, 0xa7, 0xe9, 0x48, 0x65, 0x50, 0x8e, 0x7f, 0xdd,
|
||||
0xa0, 0xc2, 0x54, 0x2e, 0xa6, 0xb3, 0xc8, 0xc5, 0xec, 0xfd, 0xb6, 0x61, 0xf9, 0x0c, 0xc7, 0x7d,
|
||||
0xfe, 0xd8, 0xbd, 0xfe, 0x6c, 0x92, 0xba, 0xea, 0x05, 0xdb, 0x73, 0x10, 0xa8, 0x6b, 0x4b, 0xe4,
|
||||
0x3b, 0xb8, 0x5a, 0x4e, 0xc8, 0xab, 0x59, 0x74, 0x55, 0x8d, 0x82, 0xad, 0xd6, 0xf7, 0x6a, 0x2c,
|
||||
0xad, 0x7f, 0x4d, 0xb1, 0xaa, 0xf2, 0xd9, 0x14, 0xab, 0x26, 0x9c, 0x74, 0x89, 0x9c, 0x42, 0xd7,
|
||||
0x28, 0x0d, 0x69, 0x00, 0xd7, 0x34, 0x2c, 0xe8, 0xb7, 0x03, 0xca, 0x70, 0x43, 0x58, 0x29, 0x34,
|
||||
0x86, 0x34, 0xf4, 0xe5, 0x89, 0x24, 0x05, 0x74, 0x1e, 0xa4, 0xfa, 0x8d, 0x28, 0x01, 0x5b, 0xad,
|
||||
0x47, 0xd3, 0xfe, 0x8d, 0x75, 0xc9, 0xa2, 0x4b, 0x17, 0x5d, 0xfd, 0x47, 0xba, 0xff, 0x37, 0x00,
|
||||
0x00, 0xff, 0xff, 0x13, 0x9f, 0x0c, 0xc2, 0xa4, 0x07, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConn
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// NetworkClient is the client API for Network service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type NetworkClient interface {
|
||||
// Connect to the network
|
||||
Connect(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (*ConnectResponse, error)
|
||||
// Returns the entire network graph
|
||||
Graph(ctx context.Context, in *GraphRequest, opts ...grpc.CallOption) (*GraphResponse, error)
|
||||
// Returns a list of known nodes in the network
|
||||
Nodes(ctx context.Context, in *NodesRequest, opts ...grpc.CallOption) (*NodesResponse, error)
|
||||
// Returns a list of known routes in the network
|
||||
Routes(ctx context.Context, in *RoutesRequest, opts ...grpc.CallOption) (*RoutesResponse, error)
|
||||
// Returns a list of known services based on routes
|
||||
Services(ctx context.Context, in *ServicesRequest, opts ...grpc.CallOption) (*ServicesResponse, error)
|
||||
// Status returns network status
|
||||
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
|
||||
}
|
||||
|
||||
type networkClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewNetworkClient(cc *grpc.ClientConn) NetworkClient {
|
||||
return &networkClient{cc}
|
||||
}
|
||||
|
||||
func (c *networkClient) Connect(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (*ConnectResponse, error) {
|
||||
out := new(ConnectResponse)
|
||||
err := c.cc.Invoke(ctx, "/go.micro.network.Network/Connect", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *networkClient) Graph(ctx context.Context, in *GraphRequest, opts ...grpc.CallOption) (*GraphResponse, error) {
|
||||
out := new(GraphResponse)
|
||||
err := c.cc.Invoke(ctx, "/go.micro.network.Network/Graph", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *networkClient) Nodes(ctx context.Context, in *NodesRequest, opts ...grpc.CallOption) (*NodesResponse, error) {
|
||||
out := new(NodesResponse)
|
||||
err := c.cc.Invoke(ctx, "/go.micro.network.Network/Nodes", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *networkClient) Routes(ctx context.Context, in *RoutesRequest, opts ...grpc.CallOption) (*RoutesResponse, error) {
|
||||
out := new(RoutesResponse)
|
||||
err := c.cc.Invoke(ctx, "/go.micro.network.Network/Routes", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *networkClient) Services(ctx context.Context, in *ServicesRequest, opts ...grpc.CallOption) (*ServicesResponse, error) {
|
||||
out := new(ServicesResponse)
|
||||
err := c.cc.Invoke(ctx, "/go.micro.network.Network/Services", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *networkClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
|
||||
out := new(StatusResponse)
|
||||
err := c.cc.Invoke(ctx, "/go.micro.network.Network/Status", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// NetworkServer is the server API for Network service.
|
||||
type NetworkServer interface {
|
||||
// Connect to the network
|
||||
Connect(context.Context, *ConnectRequest) (*ConnectResponse, error)
|
||||
// Returns the entire network graph
|
||||
Graph(context.Context, *GraphRequest) (*GraphResponse, error)
|
||||
// Returns a list of known nodes in the network
|
||||
Nodes(context.Context, *NodesRequest) (*NodesResponse, error)
|
||||
// Returns a list of known routes in the network
|
||||
Routes(context.Context, *RoutesRequest) (*RoutesResponse, error)
|
||||
// Returns a list of known services based on routes
|
||||
Services(context.Context, *ServicesRequest) (*ServicesResponse, error)
|
||||
// Status returns network status
|
||||
Status(context.Context, *StatusRequest) (*StatusResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedNetworkServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedNetworkServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedNetworkServer) Connect(ctx context.Context, req *ConnectRequest) (*ConnectResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Connect not implemented")
|
||||
}
|
||||
func (*UnimplementedNetworkServer) Graph(ctx context.Context, req *GraphRequest) (*GraphResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Graph not implemented")
|
||||
}
|
||||
func (*UnimplementedNetworkServer) Nodes(ctx context.Context, req *NodesRequest) (*NodesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Nodes not implemented")
|
||||
}
|
||||
func (*UnimplementedNetworkServer) Routes(ctx context.Context, req *RoutesRequest) (*RoutesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Routes not implemented")
|
||||
}
|
||||
func (*UnimplementedNetworkServer) Services(ctx context.Context, req *ServicesRequest) (*ServicesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Services not implemented")
|
||||
}
|
||||
func (*UnimplementedNetworkServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
|
||||
}
|
||||
|
||||
func RegisterNetworkServer(s *grpc.Server, srv NetworkServer) {
|
||||
s.RegisterService(&_Network_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Network_Connect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ConnectRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NetworkServer).Connect(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/go.micro.network.Network/Connect",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NetworkServer).Connect(ctx, req.(*ConnectRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Network_Graph_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GraphRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NetworkServer).Graph(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/go.micro.network.Network/Graph",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NetworkServer).Graph(ctx, req.(*GraphRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Network_Nodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(NodesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NetworkServer).Nodes(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/go.micro.network.Network/Nodes",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NetworkServer).Nodes(ctx, req.(*NodesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Network_Routes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RoutesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NetworkServer).Routes(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/go.micro.network.Network/Routes",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NetworkServer).Routes(ctx, req.(*RoutesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Network_Services_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ServicesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NetworkServer).Services(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/go.micro.network.Network/Services",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NetworkServer).Services(ctx, req.(*ServicesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Network_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StatusRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NetworkServer).Status(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/go.micro.network.Network/Status",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NetworkServer).Status(ctx, req.(*StatusRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Network_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "go.micro.network.Network",
|
||||
HandlerType: (*NetworkServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Connect",
|
||||
Handler: _Network_Connect_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Graph",
|
||||
Handler: _Network_Graph_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Nodes",
|
||||
Handler: _Network_Nodes_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Routes",
|
||||
Handler: _Network_Routes_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Services",
|
||||
Handler: _Network_Services_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Status",
|
||||
Handler: _Network_Status_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "network/service/proto/network.proto",
|
||||
var fileDescriptor_3fa77ddec0d08062 = []byte{
|
||||
// 859 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6e, 0xe3, 0x44,
|
||||
0x14, 0x8e, 0xe3, 0x9f, 0x34, 0x87, 0x26, 0x1b, 0x06, 0xb4, 0x58, 0x61, 0x45, 0xc3, 0xa8, 0x17,
|
||||
0x55, 0xc5, 0x26, 0xab, 0xac, 0x10, 0x88, 0x15, 0x2b, 0x4a, 0xa9, 0x90, 0x90, 0x76, 0xb5, 0x4c,
|
||||
0xe0, 0x1e, 0x63, 0x1f, 0xb5, 0x51, 0x13, 0x8f, 0x3b, 0x9e, 0xa4, 0xca, 0x13, 0xf0, 0x04, 0x3c,
|
||||
0x05, 0x97, 0xbc, 0x13, 0x2f, 0xc1, 0x0d, 0x9a, 0x1f, 0x3b, 0x71, 0x13, 0x87, 0x54, 0xda, 0xbb,
|
||||
0x39, 0xe7, 0x7c, 0xe7, 0xff, 0xc7, 0x86, 0x8f, 0x32, 0xc1, 0x25, 0x1f, 0xa5, 0x28, 0xef, 0xb9,
|
||||
0xb8, 0x1d, 0x6a, 0x8a, 0xf4, 0xae, 0xf9, 0x70, 0x3e, 0x8d, 0x05, 0x1f, 0x5a, 0x3e, 0xfd, 0xdb,
|
||||
0x01, 0x9f, 0xf1, 0x85, 0x44, 0x12, 0x42, 0x2b, 0x47, 0xb1, 0x9c, 0xc6, 0x18, 0x3a, 0x03, 0xe7,
|
||||
0xac, 0xcd, 0x0a, 0x52, 0x49, 0xa2, 0x24, 0x11, 0x98, 0xe7, 0x61, 0xd3, 0x48, 0x2c, 0xa9, 0x24,
|
||||
0xd7, 0x91, 0xc4, 0xfb, 0x68, 0x15, 0xba, 0x46, 0x62, 0x49, 0x25, 0xb1, 0x2e, 0x42, 0xcf, 0x48,
|
||||
0x2c, 0x49, 0x9e, 0x42, 0x20, 0x94, 0x43, 0x11, 0xfa, 0x5a, 0x60, 0x29, 0x42, 0xc0, 0x9b, 0x4d,
|
||||
0xd3, 0xdb, 0x30, 0xd0, 0x5c, 0xfd, 0x56, 0xd8, 0x39, 0x4a, 0x31, 0x8d, 0xc3, 0xd6, 0xc0, 0x39,
|
||||
0x73, 0x99, 0xa5, 0xe8, 0x5f, 0x0e, 0x04, 0x17, 0xc9, 0x12, 0x85, 0x24, 0x5d, 0x68, 0x4e, 0x13,
|
||||
0x1b, 0x71, 0x73, 0x9a, 0x90, 0x17, 0xe0, 0xc9, 0x55, 0x86, 0x3a, 0xd2, 0xee, 0xf8, 0xd9, 0xf0,
|
||||
0x61, 0xc6, 0x43, 0xa3, 0xf7, 0xcb, 0x2a, 0x43, 0xa6, 0x91, 0xe4, 0x19, 0xb4, 0xe5, 0x74, 0x8e,
|
||||
0xb9, 0x8c, 0xe6, 0x99, 0x4e, 0xc3, 0x65, 0x6b, 0x06, 0xe9, 0x81, 0x2b, 0xe5, 0x4c, 0x27, 0xe1,
|
||||
0x32, 0xf5, 0x24, 0x23, 0x08, 0x70, 0x89, 0xa9, 0xcc, 0x43, 0x7f, 0xe0, 0x9e, 0x7d, 0x30, 0xfe,
|
||||
0x64, 0xdb, 0xc7, 0x95, 0x92, 0x33, 0x0b, 0xa3, 0x7f, 0x3a, 0xe0, 0x6b, 0xce, 0x56, 0xb0, 0xa3,
|
||||
0x4a, 0xb0, 0x9f, 0xd6, 0x18, 0x3a, 0x38, 0xd6, 0xe7, 0xe0, 0xeb, 0x62, 0xea, 0x68, 0x77, 0x06,
|
||||
0xa6, 0x5b, 0xcd, 0x0c, 0x8a, 0xfe, 0xe1, 0x80, 0xff, 0xf3, 0x02, 0xc5, 0xea, 0x3d, 0xf7, 0x7e,
|
||||
0xdd, 0x61, 0xaf, 0xd2, 0xe1, 0x8d, 0x99, 0xf0, 0x2b, 0x33, 0x41, 0x5f, 0x43, 0xf7, 0x92, 0xa7,
|
||||
0x29, 0xc6, 0x92, 0xe1, 0xdd, 0x02, 0x73, 0x49, 0xbe, 0x00, 0x3f, 0xe5, 0x09, 0xe6, 0xa1, 0xa3,
|
||||
0x6b, 0xfc, 0x74, 0x3b, 0x95, 0xb7, 0x3c, 0x41, 0x66, 0x40, 0xf4, 0x43, 0x78, 0x52, 0xea, 0xe7,
|
||||
0x19, 0x4f, 0x73, 0xa4, 0xa7, 0x70, 0xac, 0x10, 0x79, 0x61, 0xf0, 0x63, 0xf0, 0x13, 0xcc, 0xe4,
|
||||
0x8d, 0x4e, 0xb0, 0xc3, 0x0c, 0x41, 0xbf, 0x85, 0x8e, 0x45, 0x19, 0xb5, 0x47, 0xfa, 0x3d, 0x85,
|
||||
0xe3, 0x1f, 0x45, 0x94, 0xdd, 0xec, 0x77, 0xf2, 0x0a, 0x3a, 0x16, 0x65, 0x9d, 0x9c, 0x83, 0x27,
|
||||
0x38, 0x97, 0x1a, 0xb5, 0xd3, 0xc7, 0x3b, 0x44, 0xc1, 0x34, 0x86, 0xbe, 0x86, 0x8e, 0x6e, 0x5a,
|
||||
0x99, 0xc8, 0x73, 0xf0, 0xef, 0x54, 0xd3, 0xac, 0xf6, 0x8e, 0x26, 0xeb, 0x9e, 0x32, 0x83, 0xa2,
|
||||
0x17, 0xd0, 0x2d, 0xf4, 0xad, 0xf7, 0x91, 0x6d, 0x4f, 0x91, 0x63, 0xed, 0x98, 0x58, 0x98, 0xaa,
|
||||
0xee, 0xc4, 0x8c, 0x43, 0x11, 0x04, 0x1d, 0x42, 0x6f, 0xcd, 0xb2, 0x76, 0xfb, 0x70, 0x64, 0xa7,
|
||||
0xc6, 0x58, 0x6e, 0xb3, 0x92, 0xa6, 0x4f, 0xa0, 0x33, 0x91, 0x91, 0x5c, 0x94, 0x06, 0xbe, 0x87,
|
||||
0x6e, 0xc1, 0xb0, 0xea, 0x2f, 0x20, 0xc8, 0x35, 0xc7, 0x26, 0x16, 0x6e, 0x87, 0x65, 0x35, 0x2c,
|
||||
0x8e, 0x8e, 0xc0, 0xbf, 0x12, 0x82, 0x0b, 0x55, 0xf6, 0x98, 0x2f, 0x52, 0x59, 0x94, 0x5d, 0x13,
|
||||
0x6a, 0x73, 0xe7, 0xf9, 0xb5, 0x1d, 0x5b, 0xf5, 0xa4, 0x5f, 0x41, 0x60, 0x4c, 0xa8, 0x22, 0xa2,
|
||||
0x52, 0xad, 0x2f, 0xa2, 0xb6, 0xcc, 0x0c, 0x8a, 0xfe, 0xeb, 0x80, 0xa7, 0xfa, 0xbe, 0xb5, 0xc0,
|
||||
0x7b, 0xd7, 0xa3, 0x18, 0x76, 0xb7, 0x7a, 0x00, 0xbf, 0x83, 0xa3, 0x39, 0xca, 0x28, 0x89, 0x64,
|
||||
0x14, 0x7a, 0xba, 0x03, 0xa7, 0xbb, 0xa7, 0x6c, 0xf8, 0xc6, 0xc2, 0xae, 0x52, 0x29, 0x56, 0xac,
|
||||
0xd4, 0xda, 0x28, 0x95, 0x7f, 0x58, 0xa9, 0xfa, 0xaf, 0xa0, 0x53, 0x31, 0xa6, 0x8a, 0x73, 0x8b,
|
||||
0x2b, 0x9b, 0x89, 0x7a, 0xaa, 0x22, 0x2e, 0xa3, 0xd9, 0x02, 0x6d, 0x22, 0x86, 0xf8, 0xa6, 0xf9,
|
||||
0xb5, 0x43, 0xbf, 0x84, 0x96, 0xdd, 0x2e, 0x35, 0xb9, 0x6a, 0xf2, 0xeb, 0x27, 0x57, 0x6f, 0x87,
|
||||
0xc6, 0xd0, 0x97, 0xe0, 0x5f, 0xce, 0xb8, 0x19, 0xf7, 0x83, 0x95, 0x7e, 0x03, 0x4f, 0x0d, 0xff,
|
||||
0x63, 0x74, 0xd4, 0xce, 0x66, 0x88, 0x42, 0xb5, 0xc0, 0xdd, 0xb3, 0x4f, 0x06, 0x44, 0x63, 0xf0,
|
||||
0x26, 0xab, 0x34, 0x56, 0x1e, 0x14, 0xe3, 0xff, 0x96, 0x50, 0x61, 0x36, 0x56, 0xa6, 0x79, 0xd0,
|
||||
0xca, 0x9c, 0x8f, 0x01, 0xd6, 0xdf, 0x19, 0x42, 0xa0, 0x6b, 0xa8, 0x8b, 0x34, 0xe5, 0x8b, 0x34,
|
||||
0xc6, 0x5e, 0x83, 0xf4, 0xe0, 0xd8, 0xf0, 0x7e, 0xcd, 0x92, 0x48, 0x62, 0xcf, 0x39, 0x1f, 0x41,
|
||||
0xbb, 0x3c, 0xf7, 0x04, 0x20, 0xb8, 0x14, 0xa8, 0x04, 0x0d, 0xf5, 0xfe, 0x01, 0x67, 0xa8, 0x40,
|
||||
0xea, 0x6d, 0x15, 0x9a, 0xe3, 0x7f, 0x5c, 0x68, 0xbd, 0xb5, 0x43, 0xf5, 0x6e, 0xdd, 0xa3, 0xc1,
|
||||
0x76, 0x70, 0xd5, 0xe3, 0xda, 0xff, 0x7c, 0x0f, 0xc2, 0x9e, 0xcf, 0x06, 0xf9, 0x09, 0x7c, 0x7d,
|
||||
0xb5, 0xc8, 0x67, 0xdb, 0xe8, 0xcd, 0xa3, 0xd7, 0x3f, 0xa9, 0x95, 0x6f, 0xda, 0xd2, 0x67, 0x76,
|
||||
0x97, 0xad, 0xcd, 0x2b, 0xbd, 0xcb, 0x56, 0xe5, 0x3e, 0xd3, 0x06, 0x79, 0x03, 0x81, 0x39, 0x68,
|
||||
0xe4, 0xa4, 0xa6, 0x0b, 0xa5, 0xb5, 0x41, 0x3d, 0xa0, 0x34, 0x37, 0x81, 0xa3, 0xe2, 0x92, 0x91,
|
||||
0x1d, 0x75, 0x79, 0x70, 0xf8, 0xfa, 0x74, 0x1f, 0x64, 0x33, 0x46, 0x7b, 0x68, 0x4e, 0x6a, 0x57,
|
||||
0xb3, 0x3e, 0xc6, 0xea, 0x61, 0xa4, 0x8d, 0xdf, 0x03, 0xfd, 0xf7, 0xf6, 0xf2, 0xbf, 0x00, 0x00,
|
||||
0x00, 0xff, 0xff, 0x19, 0x72, 0x8e, 0xbd, 0xd4, 0x09, 0x00, 0x00,
|
||||
}
|
@ -1,12 +1,11 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: network/service/proto/network.proto
|
||||
// source: proto/network.proto
|
||||
|
||||
package go_micro_network
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "github.com/micro/go-micro/v2/router/service/proto"
|
||||
math "math"
|
||||
)
|
||||
|
@ -2,8 +2,6 @@ syntax = "proto3";
|
||||
|
||||
package go.micro.network;
|
||||
|
||||
import "router/service/proto/router.proto";
|
||||
|
||||
// Network service is usesd to gain visibility into networks
|
||||
service Network {
|
||||
// Connect to the network
|
||||
@ -20,6 +18,63 @@ service Network {
|
||||
rpc Status(StatusRequest) returns (StatusResponse) {};
|
||||
}
|
||||
|
||||
// Route is a service route
|
||||
message Route {
|
||||
// service for the route
|
||||
string service = 1;
|
||||
// the address that advertise this route
|
||||
string address = 2;
|
||||
// gateway as the next hop
|
||||
string gateway = 3;
|
||||
// the network for this destination
|
||||
string network = 4;
|
||||
// router if the router id
|
||||
string router = 5;
|
||||
// the network link
|
||||
string link = 6;
|
||||
// the metric / score of this route
|
||||
int64 metric = 7;
|
||||
}
|
||||
|
||||
// AdvertType defines the type of advert
|
||||
enum AdvertType {
|
||||
AdvertAnnounce = 0;
|
||||
AdvertUpdate = 1;
|
||||
}
|
||||
|
||||
// Advert is router advertsement streamed by Watch
|
||||
message Advert {
|
||||
// id of the advertising router
|
||||
string id = 1;
|
||||
// type of advertisement
|
||||
AdvertType type = 2;
|
||||
// unix timestamp of the advertisement
|
||||
int64 timestamp = 3;
|
||||
// TTL of the Advert
|
||||
int64 ttl = 4;
|
||||
// events is a list of advertised events
|
||||
repeated Event events = 5;
|
||||
}
|
||||
|
||||
// EventType defines the type of event
|
||||
enum EventType {
|
||||
Create = 0;
|
||||
Delete = 1;
|
||||
Update = 2;
|
||||
}
|
||||
|
||||
// Event is routing table event
|
||||
message Event {
|
||||
// the unique event id
|
||||
string id = 1;
|
||||
// type of event
|
||||
EventType type = 2;
|
||||
// unix timestamp of event
|
||||
int64 timestamp = 3;
|
||||
// service route
|
||||
Route route = 4;
|
||||
}
|
||||
|
||||
// Query is passed in a LookupRequest
|
||||
message Query {
|
||||
string service = 1;
|
||||
@ -62,7 +117,7 @@ message RoutesRequest {
|
||||
}
|
||||
|
||||
message RoutesResponse {
|
||||
repeated go.micro.router.Route routes = 1;
|
||||
repeated Route routes = 1;
|
||||
}
|
||||
|
||||
message ServicesRequest {}
|
||||
@ -127,5 +182,5 @@ message Sync {
|
||||
// peer origin
|
||||
Peer peer = 1;
|
||||
// node routes
|
||||
repeated go.micro.router.Route routes = 2;
|
||||
repeated Route routes = 2;
|
||||
}
|
@ -5,8 +5,8 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/micro/go-micro/v2/broker"
|
||||
"github.com/micro/go-micro/v2/transport"
|
||||
"github.com/micro/go-micro/v2/network/tunnel"
|
||||
"github.com/micro/go-micro/v2/transport"
|
||||
)
|
||||
|
||||
type tunBroker struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package transport
|
||||
|
||||
import (
|
||||
"github.com/micro/go-micro/v2/transport"
|
||||
"github.com/micro/go-micro/v2/network/tunnel"
|
||||
"github.com/micro/go-micro/v2/transport"
|
||||
)
|
||||
|
||||
type tunListener struct {
|
||||
|
@ -4,8 +4,8 @@ package transport
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/micro/go-micro/v2/transport"
|
||||
"github.com/micro/go-micro/v2/network/tunnel"
|
||||
"github.com/micro/go-micro/v2/transport"
|
||||
)
|
||||
|
||||
type tunTransport struct {
|
||||
|
@ -1,14 +1,13 @@
|
||||
// Package proto contains utility functions for working with protobufs
|
||||
package proto
|
||||
package network
|
||||
|
||||
import (
|
||||
pbNet "github.com/micro/go-micro/v2/network/proto"
|
||||
"github.com/micro/go-micro/v2/router"
|
||||
pbRtr "github.com/micro/go-micro/v2/router/service/proto"
|
||||
)
|
||||
|
||||
// RouteToProto encodes route into protobuf and returns it
|
||||
func RouteToProto(route router.Route) *pbRtr.Route {
|
||||
return &pbRtr.Route{
|
||||
// routeToProto encodes route into protobuf and returns it
|
||||
func routeToProto(route router.Route) *pbNet.Route {
|
||||
return &pbNet.Route{
|
||||
Service: route.Service,
|
||||
Address: route.Address,
|
||||
Gateway: route.Gateway,
|
||||
@ -19,8 +18,8 @@ func RouteToProto(route router.Route) *pbRtr.Route {
|
||||
}
|
||||
}
|
||||
|
||||
// ProtoToRoute decodes protobuf route into router route and returns it
|
||||
func ProtoToRoute(route *pbRtr.Route) router.Route {
|
||||
// protoToRoute decodes protobuf route into router route and returns it
|
||||
func protoToRoute(route *pbNet.Route) router.Route {
|
||||
return router.Route{
|
||||
Service: route.Service,
|
||||
Address: route.Address,
|
File diff suppressed because it is too large
Load Diff
@ -1,421 +0,0 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: router/service/proto/router.proto
|
||||
|
||||
package router
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
import (
|
||||
context "context"
|
||||
api "github.com/micro/go-micro/v2/api"
|
||||
client "github.com/micro/go-micro/v2/client"
|
||||
server "github.com/micro/go-micro/v2/server"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ api.Endpoint
|
||||
var _ context.Context
|
||||
var _ client.Option
|
||||
var _ server.Option
|
||||
|
||||
// Api Endpoints for Router service
|
||||
|
||||
func NewRouterEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{}
|
||||
}
|
||||
|
||||
// Client API for Router service
|
||||
|
||||
type RouterService interface {
|
||||
Lookup(ctx context.Context, in *LookupRequest, opts ...client.CallOption) (*LookupResponse, error)
|
||||
Watch(ctx context.Context, in *WatchRequest, opts ...client.CallOption) (Router_WatchService, error)
|
||||
Advertise(ctx context.Context, in *Request, opts ...client.CallOption) (Router_AdvertiseService, error)
|
||||
Process(ctx context.Context, in *Advert, opts ...client.CallOption) (*ProcessResponse, error)
|
||||
}
|
||||
|
||||
type routerService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewRouterService(name string, c client.Client) RouterService {
|
||||
return &routerService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *routerService) Lookup(ctx context.Context, in *LookupRequest, opts ...client.CallOption) (*LookupResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Router.Lookup", in)
|
||||
out := new(LookupResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *routerService) Watch(ctx context.Context, in *WatchRequest, opts ...client.CallOption) (Router_WatchService, error) {
|
||||
req := c.c.NewRequest(c.name, "Router.Watch", &WatchRequest{})
|
||||
stream, err := c.c.Stream(ctx, req, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := stream.Send(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &routerServiceWatch{stream}, nil
|
||||
}
|
||||
|
||||
type Router_WatchService interface {
|
||||
Context() context.Context
|
||||
SendMsg(interface{}) error
|
||||
RecvMsg(interface{}) error
|
||||
Close() error
|
||||
Recv() (*Event, error)
|
||||
}
|
||||
|
||||
type routerServiceWatch struct {
|
||||
stream client.Stream
|
||||
}
|
||||
|
||||
func (x *routerServiceWatch) Close() error {
|
||||
return x.stream.Close()
|
||||
}
|
||||
|
||||
func (x *routerServiceWatch) Context() context.Context {
|
||||
return x.stream.Context()
|
||||
}
|
||||
|
||||
func (x *routerServiceWatch) SendMsg(m interface{}) error {
|
||||
return x.stream.Send(m)
|
||||
}
|
||||
|
||||
func (x *routerServiceWatch) RecvMsg(m interface{}) error {
|
||||
return x.stream.Recv(m)
|
||||
}
|
||||
|
||||
func (x *routerServiceWatch) Recv() (*Event, error) {
|
||||
m := new(Event)
|
||||
err := x.stream.Recv(m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *routerService) Advertise(ctx context.Context, in *Request, opts ...client.CallOption) (Router_AdvertiseService, error) {
|
||||
req := c.c.NewRequest(c.name, "Router.Advertise", &Request{})
|
||||
stream, err := c.c.Stream(ctx, req, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := stream.Send(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &routerServiceAdvertise{stream}, nil
|
||||
}
|
||||
|
||||
type Router_AdvertiseService interface {
|
||||
Context() context.Context
|
||||
SendMsg(interface{}) error
|
||||
RecvMsg(interface{}) error
|
||||
Close() error
|
||||
Recv() (*Advert, error)
|
||||
}
|
||||
|
||||
type routerServiceAdvertise struct {
|
||||
stream client.Stream
|
||||
}
|
||||
|
||||
func (x *routerServiceAdvertise) Close() error {
|
||||
return x.stream.Close()
|
||||
}
|
||||
|
||||
func (x *routerServiceAdvertise) Context() context.Context {
|
||||
return x.stream.Context()
|
||||
}
|
||||
|
||||
func (x *routerServiceAdvertise) SendMsg(m interface{}) error {
|
||||
return x.stream.Send(m)
|
||||
}
|
||||
|
||||
func (x *routerServiceAdvertise) RecvMsg(m interface{}) error {
|
||||
return x.stream.Recv(m)
|
||||
}
|
||||
|
||||
func (x *routerServiceAdvertise) Recv() (*Advert, error) {
|
||||
m := new(Advert)
|
||||
err := x.stream.Recv(m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *routerService) Process(ctx context.Context, in *Advert, opts ...client.CallOption) (*ProcessResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Router.Process", in)
|
||||
out := new(ProcessResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Router service
|
||||
|
||||
type RouterHandler interface {
|
||||
Lookup(context.Context, *LookupRequest, *LookupResponse) error
|
||||
Watch(context.Context, *WatchRequest, Router_WatchStream) error
|
||||
Advertise(context.Context, *Request, Router_AdvertiseStream) error
|
||||
Process(context.Context, *Advert, *ProcessResponse) error
|
||||
}
|
||||
|
||||
func RegisterRouterHandler(s server.Server, hdlr RouterHandler, opts ...server.HandlerOption) error {
|
||||
type router interface {
|
||||
Lookup(ctx context.Context, in *LookupRequest, out *LookupResponse) error
|
||||
Watch(ctx context.Context, stream server.Stream) error
|
||||
Advertise(ctx context.Context, stream server.Stream) error
|
||||
Process(ctx context.Context, in *Advert, out *ProcessResponse) error
|
||||
}
|
||||
type Router struct {
|
||||
router
|
||||
}
|
||||
h := &routerHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&Router{h}, opts...))
|
||||
}
|
||||
|
||||
type routerHandler struct {
|
||||
RouterHandler
|
||||
}
|
||||
|
||||
func (h *routerHandler) Lookup(ctx context.Context, in *LookupRequest, out *LookupResponse) error {
|
||||
return h.RouterHandler.Lookup(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *routerHandler) Watch(ctx context.Context, stream server.Stream) error {
|
||||
m := new(WatchRequest)
|
||||
if err := stream.Recv(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return h.RouterHandler.Watch(ctx, m, &routerWatchStream{stream})
|
||||
}
|
||||
|
||||
type Router_WatchStream interface {
|
||||
Context() context.Context
|
||||
SendMsg(interface{}) error
|
||||
RecvMsg(interface{}) error
|
||||
Close() error
|
||||
Send(*Event) error
|
||||
}
|
||||
|
||||
type routerWatchStream struct {
|
||||
stream server.Stream
|
||||
}
|
||||
|
||||
func (x *routerWatchStream) Close() error {
|
||||
return x.stream.Close()
|
||||
}
|
||||
|
||||
func (x *routerWatchStream) Context() context.Context {
|
||||
return x.stream.Context()
|
||||
}
|
||||
|
||||
func (x *routerWatchStream) SendMsg(m interface{}) error {
|
||||
return x.stream.Send(m)
|
||||
}
|
||||
|
||||
func (x *routerWatchStream) RecvMsg(m interface{}) error {
|
||||
return x.stream.Recv(m)
|
||||
}
|
||||
|
||||
func (x *routerWatchStream) Send(m *Event) error {
|
||||
return x.stream.Send(m)
|
||||
}
|
||||
|
||||
func (h *routerHandler) Advertise(ctx context.Context, stream server.Stream) error {
|
||||
m := new(Request)
|
||||
if err := stream.Recv(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return h.RouterHandler.Advertise(ctx, m, &routerAdvertiseStream{stream})
|
||||
}
|
||||
|
||||
type Router_AdvertiseStream interface {
|
||||
Context() context.Context
|
||||
SendMsg(interface{}) error
|
||||
RecvMsg(interface{}) error
|
||||
Close() error
|
||||
Send(*Advert) error
|
||||
}
|
||||
|
||||
type routerAdvertiseStream struct {
|
||||
stream server.Stream
|
||||
}
|
||||
|
||||
func (x *routerAdvertiseStream) Close() error {
|
||||
return x.stream.Close()
|
||||
}
|
||||
|
||||
func (x *routerAdvertiseStream) Context() context.Context {
|
||||
return x.stream.Context()
|
||||
}
|
||||
|
||||
func (x *routerAdvertiseStream) SendMsg(m interface{}) error {
|
||||
return x.stream.Send(m)
|
||||
}
|
||||
|
||||
func (x *routerAdvertiseStream) RecvMsg(m interface{}) error {
|
||||
return x.stream.Recv(m)
|
||||
}
|
||||
|
||||
func (x *routerAdvertiseStream) Send(m *Advert) error {
|
||||
return x.stream.Send(m)
|
||||
}
|
||||
|
||||
func (h *routerHandler) Process(ctx context.Context, in *Advert, out *ProcessResponse) error {
|
||||
return h.RouterHandler.Process(ctx, in, out)
|
||||
}
|
||||
|
||||
// Api Endpoints for Table service
|
||||
|
||||
func NewTableEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{}
|
||||
}
|
||||
|
||||
// Client API for Table service
|
||||
|
||||
type TableService interface {
|
||||
Create(ctx context.Context, in *Route, opts ...client.CallOption) (*CreateResponse, error)
|
||||
Delete(ctx context.Context, in *Route, opts ...client.CallOption) (*DeleteResponse, error)
|
||||
Update(ctx context.Context, in *Route, opts ...client.CallOption) (*UpdateResponse, error)
|
||||
List(ctx context.Context, in *Request, opts ...client.CallOption) (*ListResponse, error)
|
||||
Query(ctx context.Context, in *QueryRequest, opts ...client.CallOption) (*QueryResponse, error)
|
||||
}
|
||||
|
||||
type tableService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewTableService(name string, c client.Client) TableService {
|
||||
return &tableService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *tableService) Create(ctx context.Context, in *Route, opts ...client.CallOption) (*CreateResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Table.Create", in)
|
||||
out := new(CreateResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *tableService) Delete(ctx context.Context, in *Route, opts ...client.CallOption) (*DeleteResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Table.Delete", in)
|
||||
out := new(DeleteResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *tableService) Update(ctx context.Context, in *Route, opts ...client.CallOption) (*UpdateResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Table.Update", in)
|
||||
out := new(UpdateResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *tableService) List(ctx context.Context, in *Request, opts ...client.CallOption) (*ListResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Table.List", in)
|
||||
out := new(ListResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *tableService) Query(ctx context.Context, in *QueryRequest, opts ...client.CallOption) (*QueryResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "Table.Query", in)
|
||||
out := new(QueryResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for Table service
|
||||
|
||||
type TableHandler interface {
|
||||
Create(context.Context, *Route, *CreateResponse) error
|
||||
Delete(context.Context, *Route, *DeleteResponse) error
|
||||
Update(context.Context, *Route, *UpdateResponse) error
|
||||
List(context.Context, *Request, *ListResponse) error
|
||||
Query(context.Context, *QueryRequest, *QueryResponse) error
|
||||
}
|
||||
|
||||
func RegisterTableHandler(s server.Server, hdlr TableHandler, opts ...server.HandlerOption) error {
|
||||
type table interface {
|
||||
Create(ctx context.Context, in *Route, out *CreateResponse) error
|
||||
Delete(ctx context.Context, in *Route, out *DeleteResponse) error
|
||||
Update(ctx context.Context, in *Route, out *UpdateResponse) error
|
||||
List(ctx context.Context, in *Request, out *ListResponse) error
|
||||
Query(ctx context.Context, in *QueryRequest, out *QueryResponse) error
|
||||
}
|
||||
type Table struct {
|
||||
table
|
||||
}
|
||||
h := &tableHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&Table{h}, opts...))
|
||||
}
|
||||
|
||||
type tableHandler struct {
|
||||
TableHandler
|
||||
}
|
||||
|
||||
func (h *tableHandler) Create(ctx context.Context, in *Route, out *CreateResponse) error {
|
||||
return h.TableHandler.Create(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *tableHandler) Delete(ctx context.Context, in *Route, out *DeleteResponse) error {
|
||||
return h.TableHandler.Delete(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *tableHandler) Update(ctx context.Context, in *Route, out *UpdateResponse) error {
|
||||
return h.TableHandler.Update(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *tableHandler) List(ctx context.Context, in *Request, out *ListResponse) error {
|
||||
return h.TableHandler.List(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *tableHandler) Query(ctx context.Context, in *QueryRequest, out *QueryResponse) error {
|
||||
return h.TableHandler.Query(ctx, in, out)
|
||||
}
|
@ -1,133 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package go.micro.router;
|
||||
|
||||
option go_package = "github.com/micro/go-micro/v2/router/service/proto;router";
|
||||
// Router service is used by the proxy to lookup routes
|
||||
service Router {
|
||||
rpc Lookup(LookupRequest) returns (LookupResponse) {};
|
||||
rpc Watch(WatchRequest) returns (stream Event) {};
|
||||
rpc Advertise(Request) returns (stream Advert) {};
|
||||
rpc Process(Advert) returns (ProcessResponse) {};
|
||||
}
|
||||
|
||||
service Table {
|
||||
rpc Create(Route) returns (CreateResponse) {};
|
||||
rpc Delete(Route) returns (DeleteResponse) {};
|
||||
rpc Update(Route) returns (UpdateResponse) {};
|
||||
rpc List(Request) returns (ListResponse) {};
|
||||
rpc Query(QueryRequest) returns (QueryResponse) {};
|
||||
}
|
||||
|
||||
// Empty request
|
||||
message Request {}
|
||||
|
||||
// Empty response
|
||||
message Response {}
|
||||
|
||||
// ListResponse is returned by List
|
||||
message ListResponse {
|
||||
repeated Route routes = 1;
|
||||
}
|
||||
|
||||
// LookupRequest is made to Lookup
|
||||
message LookupRequest {
|
||||
Query query = 1;
|
||||
}
|
||||
|
||||
// LookupResponse is returned by Lookup
|
||||
message LookupResponse {
|
||||
repeated Route routes = 1;
|
||||
}
|
||||
|
||||
// QueryRequest queries Table for Routes
|
||||
message QueryRequest{
|
||||
Query query = 1;
|
||||
}
|
||||
|
||||
// QueryResponse is returned by Query
|
||||
message QueryResponse {
|
||||
repeated Route routes = 1;
|
||||
}
|
||||
|
||||
// WatchRequest is made to Watch Router
|
||||
message WatchRequest {}
|
||||
|
||||
// AdvertType defines the type of advert
|
||||
enum AdvertType {
|
||||
AdvertAnnounce = 0;
|
||||
AdvertUpdate = 1;
|
||||
}
|
||||
|
||||
// Advert is router advertsement streamed by Watch
|
||||
message Advert {
|
||||
// id of the advertising router
|
||||
string id = 1;
|
||||
// type of advertisement
|
||||
AdvertType type = 2;
|
||||
// unix timestamp of the advertisement
|
||||
int64 timestamp = 3;
|
||||
// TTL of the Advert
|
||||
int64 ttl = 4;
|
||||
// events is a list of advertised events
|
||||
repeated Event events = 5;
|
||||
}
|
||||
|
||||
// ProcessResponse is returned by Process
|
||||
message ProcessResponse {}
|
||||
|
||||
// CreateResponse is returned by Create
|
||||
message CreateResponse {}
|
||||
|
||||
// DeleteResponse is returned by Delete
|
||||
message DeleteResponse {}
|
||||
|
||||
// UpdateResponse is returned by Update
|
||||
message UpdateResponse {}
|
||||
|
||||
// EventType defines the type of event
|
||||
enum EventType {
|
||||
Create = 0;
|
||||
Delete = 1;
|
||||
Update = 2;
|
||||
}
|
||||
|
||||
// Event is routing table event
|
||||
message Event {
|
||||
// the unique event id
|
||||
string id = 1;
|
||||
// type of event
|
||||
EventType type = 2;
|
||||
// unix timestamp of event
|
||||
int64 timestamp = 3;
|
||||
// service route
|
||||
Route route = 4;
|
||||
}
|
||||
|
||||
// Query is passed in a LookupRequest
|
||||
message Query {
|
||||
// service to lookup
|
||||
string service = 1;
|
||||
// gateway to lookup
|
||||
string gateway = 2;
|
||||
// network to lookup
|
||||
string network = 3;
|
||||
}
|
||||
|
||||
// Route is a service route
|
||||
message Route {
|
||||
// service for the route
|
||||
string service = 1;
|
||||
// the address that advertise this route
|
||||
string address = 2;
|
||||
// gateway as the next hop
|
||||
string gateway = 3;
|
||||
// the network for this destination
|
||||
string network = 4;
|
||||
// router if the router id
|
||||
string router = 5;
|
||||
// the network link
|
||||
string link = 6;
|
||||
// the metric / score of this route
|
||||
int64 metric = 7;
|
||||
}
|
@ -1,271 +0,0 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/micro/go-micro/v2/client"
|
||||
"github.com/micro/go-micro/v2/router"
|
||||
pb "github.com/micro/go-micro/v2/router/service/proto"
|
||||
)
|
||||
|
||||
type svc struct {
|
||||
sync.RWMutex
|
||||
opts router.Options
|
||||
callOpts []client.CallOption
|
||||
router pb.RouterService
|
||||
table *table
|
||||
exit chan bool
|
||||
errChan chan error
|
||||
advertChan chan *router.Advert
|
||||
}
|
||||
|
||||
// NewRouter creates new service router and returns it
|
||||
func NewRouter(opts ...router.Option) router.Router {
|
||||
// get default options
|
||||
options := router.DefaultOptions()
|
||||
|
||||
// apply requested options
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
}
|
||||
|
||||
// NOTE: might need some client opts here
|
||||
cli := client.DefaultClient
|
||||
|
||||
// set options client
|
||||
if options.Client != nil {
|
||||
cli = options.Client
|
||||
}
|
||||
|
||||
// NOTE: should we have Client/Service option in router.Options?
|
||||
s := &svc{
|
||||
opts: options,
|
||||
router: pb.NewRouterService(router.DefaultName, cli),
|
||||
}
|
||||
|
||||
// set the router address to call
|
||||
if len(options.Address) > 0 {
|
||||
s.callOpts = []client.CallOption{
|
||||
client.WithAddress(options.Address),
|
||||
}
|
||||
}
|
||||
// set the table
|
||||
s.table = &table{pb.NewTableService(router.DefaultName, cli), s.callOpts}
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
// Init initializes router with given options
|
||||
func (s *svc) Init(opts ...router.Option) error {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
|
||||
for _, o := range opts {
|
||||
o(&s.opts)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Options returns router options
|
||||
func (s *svc) Options() router.Options {
|
||||
s.Lock()
|
||||
opts := s.opts
|
||||
s.Unlock()
|
||||
|
||||
return opts
|
||||
}
|
||||
|
||||
// Table returns routing table
|
||||
func (s *svc) Table() router.Table {
|
||||
return s.table
|
||||
}
|
||||
|
||||
// Start starts the service
|
||||
func (s *svc) Start() error {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *svc) advertiseEvents(advertChan chan *router.Advert, stream pb.Router_AdvertiseService) error {
|
||||
go func() {
|
||||
<-s.exit
|
||||
stream.Close()
|
||||
}()
|
||||
|
||||
var advErr error
|
||||
|
||||
for {
|
||||
resp, err := stream.Recv()
|
||||
if err != nil {
|
||||
if err != io.EOF {
|
||||
advErr = err
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
events := make([]*router.Event, len(resp.Events))
|
||||
for i, event := range resp.Events {
|
||||
route := router.Route{
|
||||
Service: event.Route.Service,
|
||||
Address: event.Route.Address,
|
||||
Gateway: event.Route.Gateway,
|
||||
Network: event.Route.Network,
|
||||
Link: event.Route.Link,
|
||||
Metric: event.Route.Metric,
|
||||
}
|
||||
|
||||
events[i] = &router.Event{
|
||||
Id: event.Id,
|
||||
Type: router.EventType(event.Type),
|
||||
Timestamp: time.Unix(0, event.Timestamp),
|
||||
Route: route,
|
||||
}
|
||||
}
|
||||
|
||||
advert := &router.Advert{
|
||||
Id: resp.Id,
|
||||
Type: router.AdvertType(resp.Type),
|
||||
Timestamp: time.Unix(0, resp.Timestamp),
|
||||
TTL: time.Duration(resp.Ttl),
|
||||
Events: events,
|
||||
}
|
||||
|
||||
select {
|
||||
case advertChan <- advert:
|
||||
case <-s.exit:
|
||||
close(advertChan)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// close the channel on exit
|
||||
close(advertChan)
|
||||
|
||||
return advErr
|
||||
}
|
||||
|
||||
// Advertise advertises routes to the network
|
||||
func (s *svc) Advertise() (<-chan *router.Advert, error) {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
|
||||
stream, err := s.router.Advertise(context.Background(), &pb.Request{}, s.callOpts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed getting advert stream: %s", err)
|
||||
}
|
||||
|
||||
// create advertise and event channels
|
||||
advertChan := make(chan *router.Advert)
|
||||
go s.advertiseEvents(advertChan, stream)
|
||||
|
||||
return advertChan, nil
|
||||
}
|
||||
|
||||
// Process processes incoming adverts
|
||||
func (s *svc) Process(advert *router.Advert) error {
|
||||
events := make([]*pb.Event, 0, len(advert.Events))
|
||||
for _, event := range advert.Events {
|
||||
route := &pb.Route{
|
||||
Service: event.Route.Service,
|
||||
Address: event.Route.Address,
|
||||
Gateway: event.Route.Gateway,
|
||||
Network: event.Route.Network,
|
||||
Link: event.Route.Link,
|
||||
Metric: event.Route.Metric,
|
||||
}
|
||||
e := &pb.Event{
|
||||
Id: event.Id,
|
||||
Type: pb.EventType(event.Type),
|
||||
Timestamp: event.Timestamp.UnixNano(),
|
||||
Route: route,
|
||||
}
|
||||
events = append(events, e)
|
||||
}
|
||||
|
||||
advertReq := &pb.Advert{
|
||||
Id: s.Options().Id,
|
||||
Type: pb.AdvertType(advert.Type),
|
||||
Timestamp: advert.Timestamp.UnixNano(),
|
||||
Events: events,
|
||||
}
|
||||
|
||||
if _, err := s.router.Process(context.Background(), advertReq, s.callOpts...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Remote router cannot be stopped
|
||||
func (s *svc) Stop() error {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
|
||||
select {
|
||||
case <-s.exit:
|
||||
return nil
|
||||
default:
|
||||
close(s.exit)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Lookup looks up routes in the routing table and returns them
|
||||
func (s *svc) Lookup(q ...router.QueryOption) ([]router.Route, error) {
|
||||
// call the router
|
||||
query := router.NewQuery(q...)
|
||||
|
||||
resp, err := s.router.Lookup(context.Background(), &pb.LookupRequest{
|
||||
Query: &pb.Query{
|
||||
Service: query.Service,
|
||||
Gateway: query.Gateway,
|
||||
Network: query.Network,
|
||||
},
|
||||
}, s.callOpts...)
|
||||
|
||||
// errored out
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
routes := make([]router.Route, len(resp.Routes))
|
||||
for i, route := range resp.Routes {
|
||||
routes[i] = router.Route{
|
||||
Service: route.Service,
|
||||
Address: route.Address,
|
||||
Gateway: route.Gateway,
|
||||
Network: route.Network,
|
||||
Link: route.Link,
|
||||
Metric: route.Metric,
|
||||
}
|
||||
}
|
||||
|
||||
return routes, nil
|
||||
}
|
||||
|
||||
// Watch returns a watcher which allows to track updates to the routing table
|
||||
func (s *svc) Watch(opts ...router.WatchOption) (router.Watcher, error) {
|
||||
rsp, err := s.router.Watch(context.Background(), &pb.WatchRequest{}, s.callOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
options := router.WatchOptions{
|
||||
Service: "*",
|
||||
}
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
}
|
||||
return newWatcher(rsp, options)
|
||||
}
|
||||
|
||||
// Returns the router implementation
|
||||
func (s *svc) String() string {
|
||||
return "service"
|
||||
}
|
@ -1,123 +0,0 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/micro/go-micro/v2/client"
|
||||
"github.com/micro/go-micro/v2/router"
|
||||
pb "github.com/micro/go-micro/v2/router/service/proto"
|
||||
)
|
||||
|
||||
type table struct {
|
||||
table pb.TableService
|
||||
callOpts []client.CallOption
|
||||
}
|
||||
|
||||
// Create new route in the routing table
|
||||
func (t *table) Create(r router.Route) error {
|
||||
route := &pb.Route{
|
||||
Service: r.Service,
|
||||
Address: r.Address,
|
||||
Gateway: r.Gateway,
|
||||
Network: r.Network,
|
||||
Link: r.Link,
|
||||
Metric: r.Metric,
|
||||
}
|
||||
|
||||
if _, err := t.table.Create(context.Background(), route, t.callOpts...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Delete deletes existing route from the routing table
|
||||
func (t *table) Delete(r router.Route) error {
|
||||
route := &pb.Route{
|
||||
Service: r.Service,
|
||||
Address: r.Address,
|
||||
Gateway: r.Gateway,
|
||||
Network: r.Network,
|
||||
Link: r.Link,
|
||||
Metric: r.Metric,
|
||||
}
|
||||
|
||||
if _, err := t.table.Delete(context.Background(), route, t.callOpts...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Update updates route in the routing table
|
||||
func (t *table) Update(r router.Route) error {
|
||||
route := &pb.Route{
|
||||
Service: r.Service,
|
||||
Address: r.Address,
|
||||
Gateway: r.Gateway,
|
||||
Network: r.Network,
|
||||
Link: r.Link,
|
||||
Metric: r.Metric,
|
||||
}
|
||||
|
||||
if _, err := t.table.Update(context.Background(), route, t.callOpts...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// List returns the list of all routes in the table
|
||||
func (t *table) List() ([]router.Route, error) {
|
||||
resp, err := t.table.List(context.Background(), &pb.Request{}, t.callOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
routes := make([]router.Route, len(resp.Routes))
|
||||
for i, route := range resp.Routes {
|
||||
routes[i] = router.Route{
|
||||
Service: route.Service,
|
||||
Address: route.Address,
|
||||
Gateway: route.Gateway,
|
||||
Network: route.Network,
|
||||
Link: route.Link,
|
||||
Metric: route.Metric,
|
||||
}
|
||||
}
|
||||
|
||||
return routes, nil
|
||||
}
|
||||
|
||||
// Lookup looks up routes in the routing table and returns them
|
||||
func (t *table) Query(q ...router.QueryOption) ([]router.Route, error) {
|
||||
query := router.NewQuery(q...)
|
||||
|
||||
// call the router
|
||||
resp, err := t.table.Query(context.Background(), &pb.QueryRequest{
|
||||
Query: &pb.Query{
|
||||
Service: query.Service,
|
||||
Gateway: query.Gateway,
|
||||
Network: query.Network,
|
||||
},
|
||||
}, t.callOpts...)
|
||||
|
||||
// errored out
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
routes := make([]router.Route, len(resp.Routes))
|
||||
for i, route := range resp.Routes {
|
||||
routes[i] = router.Route{
|
||||
Service: route.Service,
|
||||
Address: route.Address,
|
||||
Gateway: route.Gateway,
|
||||
Network: route.Network,
|
||||
Link: route.Link,
|
||||
Metric: route.Metric,
|
||||
}
|
||||
}
|
||||
|
||||
return routes, nil
|
||||
}
|
@ -1,117 +0,0 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"io"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/micro/go-micro/v2/router"
|
||||
pb "github.com/micro/go-micro/v2/router/service/proto"
|
||||
)
|
||||
|
||||
type watcher struct {
|
||||
sync.RWMutex
|
||||
opts router.WatchOptions
|
||||
resChan chan *router.Event
|
||||
done chan struct{}
|
||||
stream pb.Router_WatchService
|
||||
}
|
||||
|
||||
func newWatcher(rsp pb.Router_WatchService, opts router.WatchOptions) (*watcher, error) {
|
||||
w := &watcher{
|
||||
opts: opts,
|
||||
resChan: make(chan *router.Event),
|
||||
done: make(chan struct{}),
|
||||
stream: rsp,
|
||||
}
|
||||
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-w.done:
|
||||
return
|
||||
default:
|
||||
if err := w.watch(rsp); err != nil {
|
||||
w.Stop()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
return w, nil
|
||||
}
|
||||
|
||||
// watchRouter watches router and send events to all registered watchers
|
||||
func (w *watcher) watch(stream pb.Router_WatchService) error {
|
||||
var watchErr error
|
||||
|
||||
for {
|
||||
resp, err := stream.Recv()
|
||||
if err != nil {
|
||||
if err != io.EOF {
|
||||
watchErr = err
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
route := router.Route{
|
||||
Service: resp.Route.Service,
|
||||
Address: resp.Route.Address,
|
||||
Gateway: resp.Route.Gateway,
|
||||
Network: resp.Route.Network,
|
||||
Link: resp.Route.Link,
|
||||
Metric: resp.Route.Metric,
|
||||
}
|
||||
|
||||
event := &router.Event{
|
||||
Id: resp.Id,
|
||||
Type: router.EventType(resp.Type),
|
||||
Timestamp: time.Unix(0, resp.Timestamp),
|
||||
Route: route,
|
||||
}
|
||||
|
||||
select {
|
||||
case w.resChan <- event:
|
||||
case <-w.done:
|
||||
}
|
||||
}
|
||||
|
||||
return watchErr
|
||||
}
|
||||
|
||||
// Next is a blocking call that returns watch result
|
||||
func (w *watcher) Next() (*router.Event, error) {
|
||||
for {
|
||||
select {
|
||||
case res := <-w.resChan:
|
||||
switch w.opts.Service {
|
||||
case res.Route.Service, "*":
|
||||
return res, nil
|
||||
default:
|
||||
continue
|
||||
}
|
||||
case <-w.done:
|
||||
return nil, router.ErrWatcherStopped
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Chan returns event channel
|
||||
func (w *watcher) Chan() (<-chan *router.Event, error) {
|
||||
return w.resChan, nil
|
||||
}
|
||||
|
||||
// Stop stops watcher
|
||||
func (w *watcher) Stop() {
|
||||
w.Lock()
|
||||
defer w.Unlock()
|
||||
|
||||
select {
|
||||
case <-w.done:
|
||||
return
|
||||
default:
|
||||
w.stream.Close()
|
||||
close(w.done)
|
||||
}
|
||||
}
|
@ -5,7 +5,6 @@ import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
|
||||
"github.com/micro/go-micro/v2/auth"
|
||||
"github.com/micro/go-micro/v2/broker"
|
||||
"github.com/micro/go-micro/v2/codec"
|
||||
"github.com/micro/go-micro/v2/registry"
|
||||
@ -67,7 +66,6 @@ func MaxMsgSize(s int) server.Option {
|
||||
|
||||
func newOptions(opt ...server.Option) server.Options {
|
||||
opts := server.Options{
|
||||
Auth: auth.DefaultAuth,
|
||||
Codecs: make(map[string]codec.NewCodec),
|
||||
Metadata: map[string]string{},
|
||||
Broker: broker.DefaultBroker,
|
||||
|
@ -6,7 +6,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/micro/go-micro/v2/auth"
|
||||
"github.com/micro/go-micro/v2/broker"
|
||||
"github.com/micro/go-micro/v2/codec"
|
||||
"github.com/micro/go-micro/v2/debug/trace"
|
||||
@ -19,7 +18,6 @@ type Options struct {
|
||||
Broker broker.Broker
|
||||
Registry registry.Registry
|
||||
Tracer trace.Tracer
|
||||
Auth auth.Auth
|
||||
Transport transport.Transport
|
||||
Metadata map[string]string
|
||||
Name string
|
||||
@ -60,10 +58,6 @@ func newOptions(opt ...Option) Options {
|
||||
o(&opts)
|
||||
}
|
||||
|
||||
if opts.Auth == nil {
|
||||
opts.Auth = auth.DefaultAuth
|
||||
}
|
||||
|
||||
if opts.Broker == nil {
|
||||
opts.Broker = broker.DefaultBroker
|
||||
}
|
||||
@ -171,13 +165,6 @@ func Tracer(t trace.Tracer) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Auth mechanism for role based access control
|
||||
func Auth(a auth.Auth) Option {
|
||||
return func(o *Options) {
|
||||
o.Auth = a
|
||||
}
|
||||
}
|
||||
|
||||
// Transport mechanism for communication e.g http, rabbitmq, etc
|
||||
func Transport(t transport.Transport) Option {
|
||||
return func(o *Options) {
|
||||
|
@ -51,7 +51,7 @@ func (q *quicSocket) Send(m *transport.Message) error {
|
||||
}
|
||||
|
||||
func (q *quicSocket) Close() error {
|
||||
return q.s.Close()
|
||||
return q.s.CloseWithError(0, "EOF")
|
||||
}
|
||||
|
||||
func (q *quicSocket) Local() string {
|
||||
@ -118,7 +118,7 @@ func (q *quicTransport) Dial(addr string, opts ...transport.DialOption) (transpo
|
||||
}
|
||||
}
|
||||
s, err := quic.DialAddr(addr, config, &quic.Config{
|
||||
IdleTimeout: time.Minute * 2,
|
||||
MaxIdleTimeout: time.Minute * 2,
|
||||
KeepAlive: true,
|
||||
})
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user