diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 56519f04893..cba3cbcca0a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,10 +1,9 @@ ## Pull Request template Please, go through these steps before clicking submit on this PR. -1. Make sure this PR targets the `develop` branch. We follow the git-flow branching model. -2. Give a descriptive title to your PR. -3. Provide a description of your changes. -4. Make sure you have some relevant tests. -5. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if applicable). +1. Give a descriptive title to your PR. +2. Provide a description of your changes. +3. Make sure you have some relevant tests. +4. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if applicable). **PLEASE REMOVE THIS TEMPLATE BEFORE SUBMITTING** diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c6e04da5589..05f3ffefbeb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,6 +4,8 @@ on: push: branches: - master + # We want custom per developer branches to be pushed + - crufter tags: - v2.* - v3.* @@ -19,7 +21,7 @@ jobs: run: git fetch --prune --unshallow - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@master + uses: elgohr/Publish-Docker-Github-Action@v5 with: name: micro/micro username: ${{ secrets.DOCKER_USERNAME }} diff --git a/.github/workflows/integration-k8s.yml b/.github/workflows/integration-k8s.yml index c62974f40f0..7458f46d0bc 100644 --- a/.github/workflows/integration-k8s.yml +++ b/.github/workflows/integration-k8s.yml @@ -20,7 +20,7 @@ jobs: uses: engineerd/setup-kind@v0.3.0 - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@master + uses: elgohr/Publish-Docker-Github-Action@v5 with: name: micro/micro username: ${{ secrets.DOCKER_USERNAME }} diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index c185b91e9fd..8fe622e5f44 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -16,7 +16,7 @@ jobs: run: git fetch --prune --unshallow - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@master + uses: elgohr/Publish-Docker-Github-Action@v5 with: name: micro/micro username: ${{ secrets.DOCKER_USERNAME }} diff --git a/client/api/api.go b/client/api/api.go index 7c4bafbc299..c61e8804d22 100644 --- a/client/api/api.go +++ b/client/api/api.go @@ -199,7 +199,7 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { // resolver options ropts := []resolver.Option{ - resolver.WithNamespace(nsResolver.ResolveWithType), + resolver.WithServicePrefix(Namespace + "." + Type), resolver.WithHandler(Handler), } diff --git a/client/api/auth/wrapper.go b/client/api/auth/wrapper.go index e2f137c706c..2384b210198 100644 --- a/client/api/auth/wrapper.go +++ b/client/api/auth/wrapper.go @@ -40,8 +40,12 @@ func (a authWrapper) ServeHTTP(w http.ResponseWriter, req *http.Request) { ns := req.Header.Get(namespace.NamespaceKey) if len(ns) == 0 { ns = a.nsResolver.Resolve(req) - req.Header.Set(namespace.NamespaceKey, ns) } + // todo: replace this once the namespace resolver has been depricated + if ns == "go.micro" { + ns = "micro" + } + req.Header.Set(namespace.NamespaceKey, ns) // Set the metadata so we can access it in micro api / web req = req.WithContext(ctx.FromRequest(req)) diff --git a/client/cli/new/new.go b/client/cli/new/new.go index 8cf66575b11..dd1d7f02621 100644 --- a/client/cli/new/new.go +++ b/client/cli/new/new.go @@ -123,11 +123,14 @@ func create(c config) error { } } - dst, err := copyAPIProto(c) - if err != nil { - return err + if c.Type == "api" { + dst, err := copyAPIProto(c) + if err != nil { + return err + } + addFileToTree(t, dst) + } - addFileToTree(t, dst) // print tree fmt.Println(t.String()) diff --git a/client/cli/util/util.go b/client/cli/util/util.go index 4bdeb9f277d..0ded1b58fd7 100644 --- a/client/cli/util/util.go +++ b/client/cli/util/util.go @@ -37,25 +37,21 @@ const ( ) var defaultEnvs = map[string]Env{ - EnvLocal: Env{ + EnvLocal: { Name: EnvLocal, ProxyAddress: localProxyAddress, }, - EnvServer: Env{ + EnvServer: { Name: EnvServer, ProxyAddress: serverProxyAddress, }, - EnvPlatform: Env{ + EnvPlatform: { Name: EnvPlatform, ProxyAddress: platformProxyAddress, }, } func isBuiltinService(command string) bool { - switch command { - case "server", "help": - return true - } for _, service := range platform.Services { if command == service { return true @@ -66,6 +62,16 @@ func isBuiltinService(command string) bool { // SetupCommand includes things that should run for each command. func SetupCommand(ctx *ccli.Context) { + // This makes `micro [command name] --help` work without a server + for _, arg := range os.Args { + if arg == "--help" || arg == "-h" { + return + } + } + switch ctx.Args().First() { + case "new", "server", "help": + return + } if ctx.Args().Len() == 1 && isBuiltinService(ctx.Args().First()) { return } @@ -73,6 +79,11 @@ func SetupCommand(ctx *ccli.Context) { return } + if ctx.App.Command(ctx.Args().First()) == nil { + // unrecognised command + return + } + toFlag := func(s string) string { return strings.ToLower(strings.ReplaceAll(s, "MICRO_", "")) } diff --git a/client/proxy/proxy.go b/client/proxy/proxy.go index e61b8fbeca2..a2a2482938c 100644 --- a/client/proxy/proxy.go +++ b/client/proxy/proxy.go @@ -13,7 +13,6 @@ import ( "github.com/micro/go-micro/v2/api/server/acme/certmagic" "github.com/micro/go-micro/v2/auth" bmem "github.com/micro/go-micro/v2/broker/memory" - "github.com/micro/go-micro/v2/client" mucli "github.com/micro/go-micro/v2/client" "github.com/micro/go-micro/v2/config/cmd" log "github.com/micro/go-micro/v2/logger" @@ -22,10 +21,7 @@ import ( //"github.com/micro/go-micro/v2/proxy/grpc" "github.com/micro/go-micro/v2/proxy/http" "github.com/micro/go-micro/v2/proxy/mucp" - "github.com/micro/go-micro/v2/registry" rmem "github.com/micro/go-micro/v2/registry/memory" - "github.com/micro/go-micro/v2/router" - rs "github.com/micro/go-micro/v2/router/service" "github.com/micro/go-micro/v2/server" sgrpc "github.com/micro/go-micro/v2/server/grpc" "github.com/micro/go-micro/v2/sync/memory" @@ -84,42 +80,10 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { service := micro.NewService(srvOpts...) // set the context - var popts []proxy.Option - - // create new router - var r router.Router - - routerName := ctx.String("router") - routerAddr := ctx.String("router_address") - - ropts := []router.Option{ - router.Id(server.DefaultId), - router.Client(client.DefaultClient), - router.Address(routerAddr), - router.Registry(registry.DefaultRegistry), + popts := []proxy.Option{ + proxy.WithRouter(service.Options().Router), } - // check if we need to use the router service - switch { - case routerName == "go.micro.router": - r = rs.NewRouter(ropts...) - case routerName == "service": - r = rs.NewRouter(ropts...) - case len(routerAddr) > 0: - r = rs.NewRouter(ropts...) - default: - r = router.NewRouter(ropts...) - } - - // start the router - if err := r.Start(); err != nil { - log.Errorf("Proxy error starting router: %s", err) - os.Exit(1) - } - - // append router to proxy opts - popts = append(popts, proxy.WithRouter(r)) - // new proxy var p proxy.Proxy // setup the default server @@ -280,16 +244,6 @@ func Commands(options ...micro.Option) []*cli.Command { Name: "proxy", Usage: "Run the service proxy", Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "router", - Usage: "Set the router to use e.g default, go.micro.router", - EnvVars: []string{"MICRO_ROUTER"}, - }, - &cli.StringFlag{ - Name: "router_address", - Usage: "Set the router address", - EnvVars: []string{"MICRO_ROUTER_ADDRESS"}, - }, &cli.StringFlag{ Name: "address", Usage: "Set the proxy http address e.g 0.0.0.0:8081", diff --git a/client/web/web.go b/client/web/web.go index 5b705ca9f36..8022a51fa44 100644 --- a/client/web/web.go +++ b/client/web/web.go @@ -156,7 +156,7 @@ func (s *srv) ServeHTTP(w http.ResponseWriter, r *http.Request) { } // check if its a web request - if _, _, isWeb := s.resolver.Info(r); isWeb { + if _, isWeb := s.resolver.Info(r); isWeb { s.Router.ServeHTTP(w, r) return } @@ -259,7 +259,7 @@ func (s *srv) indexHandler(w http.ResponseWriter, r *http.Request) { return } - services, err := s.registry.ListServices(registry.ListContext(r.Context())) + services, err := s.registry.ListServices(registry.ListDomain(registry.WildcardDomain)) if err != nil { log.Errorf("Error listing services: %v", err) } @@ -311,7 +311,7 @@ func (s *srv) registryHandler(w http.ResponseWriter, r *http.Request) { svc := vars["name"] if len(svc) > 0 { - sv, err := s.registry.GetService(svc, registry.GetContext(r.Context())) + sv, err := s.registry.GetService(svc, registry.GetDomain(registry.WildcardDomain)) if err != nil { http.Error(w, "Error occurred:"+err.Error(), 500) return @@ -339,7 +339,7 @@ func (s *srv) registryHandler(w http.ResponseWriter, r *http.Request) { return } - services, err := s.registry.ListServices(registry.ListContext(r.Context())) + services, err := s.registry.ListServices(registry.ListDomain(registry.WildcardDomain)) if err != nil { log.Errorf("Error listing services: %v", err) } @@ -363,7 +363,7 @@ func (s *srv) registryHandler(w http.ResponseWriter, r *http.Request) { } func (s *srv) callHandler(w http.ResponseWriter, r *http.Request) { - services, err := s.registry.ListServices(registry.ListContext(r.Context())) + services, err := s.registry.ListServices(registry.ListDomain(registry.WildcardDomain)) if err != nil { log.Errorf("Error listing services: %v", err) } @@ -377,7 +377,7 @@ func (s *srv) callHandler(w http.ResponseWriter, r *http.Request) { continue } // lookup the endpoints otherwise - s, err := s.registry.GetService(service.Name, registry.GetContext(r.Context())) + s, err := s.registry.GetService(service.Name, registry.GetDomain(registry.WildcardDomain)) if err != nil { continue } @@ -487,10 +487,11 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { // our internal resolver resolver: &web.Resolver{ // Default to type path - Type: Resolver, - Namespace: namespace.NewResolver(Type, Namespace).ResolveWithType, + Type: Resolver, + ServicePrefix: Namespace + "." + Type, Selector: selector.NewSelector( selector.Registry(reg), + selector.Domain(registry.WildcardDomain), ), }, auth: *cmd.DefaultOptions().Auth, diff --git a/cmd/cmd.go b/cmd/cmd.go index c13032a18a7..6caf87cfef8 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -135,11 +135,6 @@ func setup(app *ccli.App) { Usage: "Set the micro network address e.g. :9093", EnvVars: []string{"MICRO_NETWORK_ADDRESS"}, }, - &ccli.StringFlag{ - Name: "router_address", - Usage: "Set the micro router address e.g. :8084", - EnvVars: []string{"MICRO_ROUTER_ADDRESS"}, - }, &ccli.StringFlag{ Name: "gateway_address", Usage: "Set the micro default gateway address e.g. :9094", @@ -231,9 +226,6 @@ func setup(app *ccli.App) { if len(ctx.String("network_address")) > 0 { network.Address = ctx.String("network_address") } - if len(ctx.String("router_address")) > 0 { - router.Address = ctx.String("router_address") - } if len(ctx.String("tunnel_address")) > 0 { tunnel.Address = ctx.String("tunnel_address") } diff --git a/go.mod b/go.mod index c315b542c06..6c8a7c721ef 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/gorilla/handlers v1.4.2 github.com/gorilla/mux v1.7.3 github.com/micro/cli/v2 v2.1.2 - github.com/micro/go-micro/v2 v2.9.0 + github.com/micro/go-micro/v2 v2.9.1-0.20200626132818-104b7d8f8dd7 github.com/miekg/dns v1.1.27 github.com/netdata/go-orchestrator v0.0.0-20190905093727-c793edba0e8f github.com/olekukonko/tablewriter v0.0.4 diff --git a/go.sum b/go.sum index 6dcc6918b10..66f745dd693 100644 --- a/go.sum +++ b/go.sum @@ -103,12 +103,14 @@ github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 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-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= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMElOWxok= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -235,6 +237,7 @@ github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= 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= @@ -322,20 +325,8 @@ 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/micro/go-micro/v2 v2.8.0 h1:WKogg6xqJmk3CjTFscrzSKN1fSGtince4sWfaqx9844= -github.com/micro/go-micro/v2 v2.8.0/go.mod h1:hSdOM6jb6aGswjBpCeB9wJ0yVH+CugevRm/CX7NlSrQ= -github.com/micro/go-micro/v2 v2.8.1-0.20200603084508-7b379bf1f16e h1:WIRnyfUjlUfJV82OtG18er0F90svTwzmZGKGOMJyPmw= -github.com/micro/go-micro/v2 v2.8.1-0.20200603084508-7b379bf1f16e/go.mod h1:hSdOM6jb6aGswjBpCeB9wJ0yVH+CugevRm/CX7NlSrQ= -github.com/micro/go-micro/v2 v2.8.1-0.20200608094725-47bdd5c99383/go.mod h1:x55ZM3Puy0FyvvkR3e0ha0xsE9DFwfPSUMWAIbFY0SY= -github.com/micro/go-micro/v2 v2.8.1-0.20200609104731-cdd8f9fd82c5 h1:IUUXIV3yqMcJi3vOKrKKdRa3IILfS5n1ov7ywPvRqRc= -github.com/micro/go-micro/v2 v2.8.1-0.20200609104731-cdd8f9fd82c5/go.mod h1:x55ZM3Puy0FyvvkR3e0ha0xsE9DFwfPSUMWAIbFY0SY= -github.com/micro/go-micro/v2 v2.9.0-rc1 h1:JzuwVr6gcP7yRT/ftkZ7bn6jbv+8iAJPL1VWNSaBceM= -github.com/micro/go-micro/v2 v2.9.0-rc1/go.mod h1:x55ZM3Puy0FyvvkR3e0ha0xsE9DFwfPSUMWAIbFY0SY= -github.com/micro/go-micro/v2 v2.9.0 h1:SeQ3ba02jqcl51mtkGPcZjxpIRrBXxUel8PFG4Z9QSU= -github.com/micro/go-micro/v2 v2.9.0/go.mod h1:x55ZM3Puy0FyvvkR3e0ha0xsE9DFwfPSUMWAIbFY0SY= -github.com/micro/mdns v0.3.0/go.mod h1:KJ0dW7KmicXU2BV++qkLlmHYcVv7/hHnbtguSWt9Aoc= -github.com/micro/protoc-gen-micro v1.0.0/go.mod h1:C8ij4DJhapBmypcT00AXdb0cZ675/3PqUO02buWWqbE= -github.com/miekg/dns v1.1.3/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/micro/go-micro/v2 v2.9.1-0.20200626132818-104b7d8f8dd7 h1:llsSvLaZgS3F7eEzwM2krRnPXvG2V5J2yruDz1n0UQk= +github.com/micro/go-micro/v2 v2.9.1-0.20200626132818-104b7d8f8dd7/go.mod h1:hSdOM6jb6aGswjBpCeB9wJ0yVH+CugevRm/CX7NlSrQ= 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= @@ -479,7 +470,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= diff --git a/internal/client/client.go b/internal/client/client.go index 483d88c21c0..4a3d602d3c5 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -2,12 +2,14 @@ package client import ( "context" + "strings" ccli "github.com/micro/cli/v2" "github.com/micro/go-micro/v2/auth" "github.com/micro/go-micro/v2/client" "github.com/micro/go-micro/v2/client/grpc" "github.com/micro/go-micro/v2/metadata" + "github.com/micro/go-micro/v2/router" "github.com/micro/micro/v2/client/cli/util" cliutil "github.com/micro/micro/v2/client/cli/util" "github.com/micro/micro/v2/internal/config" @@ -32,16 +34,15 @@ func (a *wrapper) Call(ctx context.Context, req client.Request, rsp interface{}, if len(a.token) > 0 { ctx = metadata.Set(ctx, "Authorization", auth.BearerScheme+a.token) } - if len(a.env) > 0 && !util.IsLocal(a.ctx) && !util.IsServer(a.ctx) { - // @todo this is temporarily removed because multi tenancy is not there yet - // and the moment core and non core services run in different environments, we - // get issues. To test after `micro env add mine 127.0.0.1:8081` do, - // `micro run github.com/crufter/micro-services/logspammer` works but - // `micro -env=mine run github.com/crufter/micro-services/logspammer` is broken. - // Related ticket https://github.com/micro/development/issues/193 - // - // env := strings.ReplaceAll(a.env, "/", "-") - // ctx = metadata.Set(ctx, "Micro-Namespace", env) + + // network will be used by the router to filter available routes + var network string + if util.IsLocal(a.ctx) || util.IsServer(a.ctx) { + network = router.DefaultNetwork + } else { + network = strings.ReplaceAll(a.env, "/", "-") } + + ctx = metadata.Set(ctx, "Micro-Network", network) return a.Client.Call(ctx, req, rsp, opts...) } diff --git a/internal/command/cli/command.go b/internal/command/cli/command.go index aa5d21648de..346bb65788a 100644 --- a/internal/command/cli/command.go +++ b/internal/command/cli/command.go @@ -232,7 +232,7 @@ func GetService(c *cli.Context, args []string) ([]byte, error) { reg := *cmd.DefaultOptions().Registry reg.Init(service.WithClient(inclient.New(c))) - srv, err = reg.GetService(args[0]) + srv, err = reg.GetService(args[0], registry.GetDomain(registry.WildcardDomain)) if err != nil { return nil, err } @@ -635,7 +635,7 @@ func ListServices(c *cli.Context) ([]byte, error) { reg := *cmd.DefaultOptions().Registry reg.Init(service.WithClient(inclient.New(c))) - rsp, err = reg.ListServices() + rsp, err = reg.ListServices(registry.ListDomain(registry.WildcardDomain)) if err != nil { return nil, err } @@ -708,7 +708,9 @@ func CallService(c *cli.Context, args []string) ([]byte, error) { } ctx := callContext(c) - creq := (*cmd.DefaultOptions().Client).NewRequest(service, endpoint, request, client.WithContentType("application/json")) + cli := inclient.New(c) + + creq := cli.NewRequest(service, endpoint, request, client.WithContentType("application/json")) var opts []client.CallOption @@ -719,12 +721,12 @@ func CallService(c *cli.Context, args []string) ([]byte, error) { var err error if output := c.String("output"); output == "raw" { rsp := cbytes.Frame{} - err = (*cmd.DefaultOptions().Client).Call(ctx, creq, &rsp, opts...) + err = cli.Call(ctx, creq, &rsp, opts...) // set the raw output response = rsp.Data } else { var rsp json.RawMessage - err = (*cmd.DefaultOptions().Client).Call(ctx, creq, &rsp, opts...) + err = cli.Call(ctx, creq, &rsp, opts...) // set the response if err == nil { var out bytes.Buffer @@ -768,7 +770,7 @@ func QueryHealth(c *cli.Context, args []string) ([]byte, error) { // otherwise get the service and call each instance individually reg := *cmd.DefaultOptions().Registry reg.Init(service.WithClient(inclient.New(c))) - service, err := reg.GetService(args[0]) + service, err := reg.GetService(args[0], registry.GetDomain(registry.WildcardDomain)) if err != nil { return nil, err } @@ -822,7 +824,7 @@ func QueryStats(c *cli.Context, args []string) ([]byte, error) { reg := *cmd.DefaultOptions().Registry reg.Init(service.WithClient(inclient.New(c))) - service, err := reg.GetService(args[0]) + service, err := reg.GetService(args[0], registry.GetDomain(registry.WildcardDomain)) if err != nil { return nil, err } diff --git a/internal/helper/helper.go b/internal/helper/helper.go index 5bc18159fbb..03892888da8 100644 --- a/internal/helper/helper.go +++ b/internal/helper/helper.go @@ -74,7 +74,7 @@ func TLSConfig(ctx *cli.Context) (*tls.Config, error) { func UnexpectedSubcommand(ctx *cli.Context) error { if first := ctx.Args().First(); first != "" { // received something that isn't a subcommand - return fmt.Errorf("Unrecognized subcommand for %s: %s. Please refer to '%s help'", ctx.App.Name, first, ctx.App.Name) + return fmt.Errorf("Unrecognized subcommand for %s: %s. Please refer to '%s --help'", ctx.App.Name, first, ctx.App.Name) } return nil } @@ -88,9 +88,9 @@ func UnexpectedCommand(ctx *cli.Context) error { commandName = arg } } - return fmt.Errorf("Unrecognized micro command: %s. Please refer to 'micro help'", commandName) + return fmt.Errorf("Unrecognized micro command: %s. Please refer to 'micro --help'", commandName) } func MissingCommand(ctx *cli.Context) error { - return fmt.Errorf("No command provided to micro. Please refer to 'micro help'") + return fmt.Errorf("No command provided to micro. Please refer to 'micro --help'") } diff --git a/internal/resolver/api/api.go b/internal/resolver/api/api.go index e71855e395a..5bf034afefc 100644 --- a/internal/resolver/api/api.go +++ b/internal/resolver/api/api.go @@ -12,13 +12,13 @@ import ( // /foo becomes namespace.foo // /v1/foo becomes namespace.v1.foo type Resolver struct { - Options resolver.Options + opts resolver.Options } func (r *Resolver) Resolve(req *http.Request) (*resolver.Endpoint, error) { var name, method string - switch r.Options.Handler { + switch r.opts.Handler { // internal handlers case "meta", "api", "rpc", "micro": name, method = apiRoute(req.URL.Path) @@ -27,9 +27,8 @@ func (r *Resolver) Resolve(req *http.Request) (*resolver.Endpoint, error) { name = proxyRoute(req.URL.Path) } - ns := r.Options.Namespace(req) return &resolver.Endpoint{ - Name: ns + "." + name, + Name: r.opts.ServicePrefix + "." + name, Method: method, }, nil } @@ -41,6 +40,6 @@ func (r *Resolver) String() string { // NewResolver creates a new micro resolver func NewResolver(opts ...resolver.Option) resolver.Resolver { return &Resolver{ - Options: resolver.NewOptions(opts...), + opts: resolver.NewOptions(opts...), } } diff --git a/internal/resolver/web/resolver.go b/internal/resolver/web/resolver.go index 339157267cf..df47ac70c15 100644 --- a/internal/resolver/web/resolver.go +++ b/internal/resolver/web/resolver.go @@ -9,20 +9,18 @@ import ( res "github.com/micro/go-micro/v2/api/resolver" "github.com/micro/go-micro/v2/client/selector" - "github.com/micro/micro/v2/internal/namespace" "golang.org/x/net/publicsuffix" ) var ( - re = regexp.MustCompile("^[a-zA-Z0-9]+([a-zA-Z0-9-]*[a-zA-Z0-9]*)?$") - defaultNamespace = namespace.DefaultNamespace + ".web" + re = regexp.MustCompile("^[a-zA-Z0-9]+([a-zA-Z0-9-]*[a-zA-Z0-9]*)?$") ) type Resolver struct { // Type of resolver e.g path, domain Type string - // a function which returns the namespace of the request - Namespace func(*http.Request) string + // ServicePrefix, e.g. "go.micro.web" + ServicePrefix string // selector to find services Selector selector.Selector } @@ -39,7 +37,7 @@ func (r *Resolver) String() string { // Info checks whether this is a web request. // It returns host, namespace and whether its internal -func (r *Resolver) Info(req *http.Request) (string, string, bool) { +func (r *Resolver) Info(req *http.Request) (string, bool) { // set to host host := req.URL.Hostname() @@ -53,9 +51,6 @@ func (r *Resolver) Info(req *http.Request) (string, string, bool) { host = h } - // determine the namespace of the request - namespace := r.Namespace(req) - // overide host if the namespace is go.micro.web, since // this will also catch localhost & 127.0.0.1, resulting // in a more consistent dev experience @@ -65,38 +60,32 @@ func (r *Resolver) Info(req *http.Request) (string, string, bool) { // if the type is path, always resolve using the path if r.Type == "path" { - return host, namespace, true - } - - // if the namespace is not the default (go.micro.web), - // we always resolve using path - if namespace != defaultNamespace { - return host, namespace, true + return host, true } // check for micro subdomains, we want to do subdomain routing // on these if the subdomoain routing has been specified if r.Type == "subdomain" && host != "web.micro.mu" && strings.HasSuffix(host, ".micro.mu") { - return host, namespace, false + return host, false } // Check for services info path, also handled by micro web but // not a top level path. TODO: Find a better way of detecting and // handling the non-proxied paths. if strings.HasPrefix(req.URL.Path, "/service/") { - return host, namespace, true + return host, true } // Check if the request is a top level path isWeb := strings.Count(req.URL.Path, "/") == 1 - return host, namespace, isWeb + return host, isWeb } // Resolve replaces the values of Host, Path, Scheme to calla backend service // It accounts for subdomains for service names based on namespace func (r *Resolver) Resolve(req *http.Request) (*res.Endpoint, error) { // get host, namespace and if its an internal request - host, _, _ := r.Info(req) + host, _ := r.Info(req) // check for micro web if r.Type == "path" || host == "web.micro.mu" { @@ -123,7 +112,7 @@ func (r *Resolver) Resolve(req *http.Request) (*res.Endpoint, error) { if strings.HasSuffix(host, ".micro.mu") { // for micro.mu subdomains, we route foo.micro.mu/bar to // go.micro.web.bar - name = defaultNamespace + "." + alias + name = r.ServicePrefix + "." + alias } else if comps := strings.Split(req.URL.Path, "/"); len(comps) > 0 { // for non micro.mu subdomains, we route foo.m3o.app/bar to // foo.web.bar @@ -164,8 +153,7 @@ func (r *Resolver) resolveWithPath(req *http.Request) (*res.Endpoint, error) { return nil, res.ErrInvalidPath } - _, namespace, _ := r.Info(req) - next, err := r.Selector.Select(namespace + "." + parts[1]) + next, err := r.Selector.Select(r.ServicePrefix + "." + parts[1]) if err == selector.ErrNotFound { return nil, res.ErrNotFound } else if err != nil { diff --git a/internal/resolver/web/resolver_test.go b/internal/resolver/web/resolver_test.go index 4bdf4a79cc5..edf3686ac5d 100644 --- a/internal/resolver/web/resolver_test.go +++ b/internal/resolver/web/resolver_test.go @@ -5,7 +5,6 @@ import ( "net/url" "testing" - "github.com/micro/go-micro/v2/api/resolver" "github.com/micro/go-micro/v2/client/selector" "github.com/micro/go-micro/v2/registry" "github.com/micro/go-micro/v2/registry/memory" @@ -19,8 +18,8 @@ func TestWebResolver(t *testing.T) { ) res := &Resolver{ - Namespace: resolver.StaticNamespace("go.micro.web"), - Selector: selector, + ServicePrefix: "go.micro.web", + Selector: selector, } testCases := []struct { diff --git a/server/server.go b/server/server.go index cb976773afa..b22f4c03f74 100644 --- a/server/server.go +++ b/server/server.go @@ -90,18 +90,20 @@ func Run(context *cli.Context) error { cli.ShowSubcommandHelp(context) os.Exit(1) } - // set default profile - if len(context.String("profile")) == 0 { - context.Set("profile", "server") - } // get the network flag peer := context.Bool("peer") // pass through the environment - // TODO: perhaps don't do this + // By default we want a file store when we run micro server. + // This will get overridden if user has set their own MICRO_STORE env var or passed in --store env := []string{"MICRO_STORE=file"} - env = append(env, "MICRO_RUNTIME_PROFILE="+context.String("profile")) + profile := context.String("profile") + if len(profile) == 0 { + profile = "server" + } + + env = append(env, "MICRO_RUNTIME_PROFILE="+profile) env = append(env, os.Environ()...) // connect to the network if specified @@ -151,12 +153,23 @@ func Run(context *cli.Context) error { switch service { case "proxy", "web", "api": envs = append(envs, "MICRO_AUTH=service") + envs = append(envs, "MICRO_ROUTER=service") + } + + cmdArgs := []string{} + // we want to pass through the global args so go up one level in the context lineage + if len(context.Lineage()) > 1 { + globCtx := context.Lineage()[1] + for _, f := range globCtx.FlagNames() { + cmdArgs = append(cmdArgs, "--"+f, context.String(f)) + } } + cmdArgs = append(cmdArgs, service) // runtime based on environment we run the service in args := []gorun.CreateOption{ gorun.WithCommand(os.Args[0]), - gorun.WithArgs(service), + gorun.WithArgs(cmdArgs...), gorun.WithEnv(envs), gorun.WithOutput(os.Stdout), gorun.WithRetries(10), diff --git a/service/registry/handler/handler.go b/service/registry/handler/handler.go index c62392a32cd..cb9b31190d7 100644 --- a/service/registry/handler/handler.go +++ b/service/registry/handler/handler.go @@ -2,7 +2,6 @@ package handler import ( "context" - "strings" "time" "github.com/micro/go-micro/v2" @@ -12,18 +11,15 @@ import ( "github.com/micro/go-micro/v2/registry" "github.com/micro/go-micro/v2/registry/service" pb "github.com/micro/go-micro/v2/registry/service/proto" - "github.com/micro/micro/v2/internal/namespace" ) type Registry struct { // service id - Id string + ID string // the publisher Publisher micro.Publisher // internal registry Registry registry.Registry - // auth to verify clients - Auth auth.Auth } func ActionToEventType(action string) registry.EventType { @@ -41,7 +37,7 @@ func (r *Registry) publishEvent(action string, service *pb.Service) error { // TODO: timestamp should be read from received event // Right now registry.Result does not contain timestamp event := &pb.Event{ - Id: r.Id, + Id: r.ID, Type: pb.EventType(ActionToEventType(action)), Timestamp: time.Now().UnixNano(), Service: service, @@ -57,41 +53,60 @@ func (r *Registry) publishEvent(action string, service *pb.Service) error { // GetService from the registry with the name requested func (r *Registry) GetService(ctx context.Context, req *pb.GetRequest, rsp *pb.GetResponse) error { - // get the services in the default namespace - services, err := r.Registry.GetService(req.Service) + // parse the options + var options registry.GetOptions + if req.Options != nil && len(req.Options.Domain) > 0 { + options.Domain = req.Options.Domain + } else { + options.Domain = registry.DefaultDomain + } + + // authorize the request + if err := authorizeDomainAccess(ctx, options.Domain); err != nil { + return err + } + + // get the services in the namespace + services, err := r.Registry.GetService(req.Service, registry.GetDomain(options.Domain)) if err == registry.ErrNotFound { return errors.NotFound("go.micro.registry", err.Error()) } else if err != nil { return errors.InternalServerError("go.micro.registry", err.Error()) } - // get the services in the requested namespace, e.g. the "foo" namespace. name - // includes the namespace as the prefix, e.g. 'foo/go.micro.service.bar' - if namespace.FromContext(ctx) != namespace.DefaultNamespace { - name := namespace.FromContext(ctx) + nameSeperator + req.Service - srvs, err := r.Registry.GetService(name) - if err != nil { - return errors.InternalServerError("go.micro.registry", err.Error()) - } - services = append(services, srvs...) + // serialize the response + rsp.Services = make([]*pb.Service, len(services)) + for i, srv := range services { + rsp.Services[i] = service.ToProto(srv) } - for _, srv := range services { - rsp.Services = append(rsp.Services, service.ToProto(withoutNamespace(*srv))) - } return nil } // Register a service func (r *Registry) Register(ctx context.Context, req *pb.Service, rsp *pb.EmptyResponse) error { - var regOpts []registry.RegisterOption - if req.Options != nil { + var opts []registry.RegisterOption + var domain string + + // parse the options + if req.Options != nil && req.Options.Ttl > 0 { ttl := time.Duration(req.Options.Ttl) * time.Second - regOpts = append(regOpts, registry.RegisterTTL(ttl)) + opts = append(opts, registry.RegisterTTL(ttl)) + } + if req.Options != nil && len(req.Options.Domain) > 0 { + domain = req.Options.Domain + } else { + domain = registry.DefaultDomain + } + opts = append(opts, registry.RegisterDomain(req.Options.Domain)) + + // authorize the request + if err := authorizeDomainAccess(ctx, domain); err != nil { + return err } - service := service.ToService(withNamespace(*req, namespace.FromContext(ctx))) - if err := r.Registry.Register(service, regOpts...); err != nil { + // register the service + if err := r.Registry.Register(service.ToService(req), opts...); err != nil { return errors.InternalServerError("go.micro.registry", err.Error()) } @@ -103,8 +118,21 @@ func (r *Registry) Register(ctx context.Context, req *pb.Service, rsp *pb.EmptyR // Deregister a service func (r *Registry) Deregister(ctx context.Context, req *pb.Service, rsp *pb.EmptyResponse) error { - service := service.ToService(withNamespace(*req, namespace.FromContext(ctx))) - if err := r.Registry.Deregister(service); err != nil { + // parse the options + var domain string + if req.Options != nil && len(req.Options.Domain) > 0 { + domain = req.Options.Domain + } else { + domain = registry.DefaultDomain + } + + // authorize the request + if err := authorizeDomainAccess(ctx, domain); err != nil { + return err + } + + // deregister the service + if err := r.Registry.Deregister(service.ToService(req), registry.DeregisterDomain(domain)); err != nil { return errors.InternalServerError("go.micro.registry", err.Error()) } @@ -116,20 +144,29 @@ func (r *Registry) Deregister(ctx context.Context, req *pb.Service, rsp *pb.Empt // ListServices returns all the services func (r *Registry) ListServices(ctx context.Context, req *pb.ListRequest, rsp *pb.ListResponse) error { - services, err := r.Registry.ListServices() + // parse the options + var domain string + if req.Options != nil && len(req.Options.Domain) > 0 { + domain = req.Options.Domain + } else { + domain = registry.DefaultDomain + } + + // authorize the request + if err := authorizeDomainAccess(ctx, domain); err != nil { + return err + } + + // list the services from the registry + services, err := r.Registry.ListServices(registry.ListDomain(domain)) if err != nil { return errors.InternalServerError("go.micro.registry", err.Error()) } - for _, srv := range services { - // check to see if the service belongs to the defaut namespace - // or the contexts namespace. TODO: think about adding a prefix - //argument to ListServices - if !canReadService(ctx, srv) { - continue - } - - rsp.Services = append(rsp.Services, service.ToProto(withoutNamespace(*srv))) + // serialize the response + rsp.Services = make([]*pb.Service, len(services)) + for i, srv := range services { + rsp.Services[i] = service.ToProto(srv) } return nil @@ -137,7 +174,21 @@ func (r *Registry) ListServices(ctx context.Context, req *pb.ListRequest, rsp *p // Watch a service for changes func (r *Registry) Watch(ctx context.Context, req *pb.WatchRequest, rsp pb.Registry_WatchStream) error { - watcher, err := r.Registry.Watch(registry.WatchService(req.Service)) + // parse the options + var domain string + if req.Options != nil && len(req.Options.Domain) > 0 { + domain = req.Options.Domain + } else { + domain = registry.DefaultDomain + } + + // authorize the request + if err := authorizeDomainAccess(ctx, domain); err != nil { + return err + } + + // setup the watcher + watcher, err := r.Registry.Watch(registry.WatchService(req.Service), registry.WatchDomain(domain)) if err != nil { return errors.InternalServerError("go.micro.registry", err.Error()) } @@ -147,13 +198,10 @@ func (r *Registry) Watch(ctx context.Context, req *pb.WatchRequest, rsp pb.Regis if err != nil { return errors.InternalServerError("go.micro.registry", err.Error()) } - if !canReadService(ctx, next.Service) { - continue - } err = rsp.Send(&pb.Result{ Action: next.Action, - Service: service.ToProto(withoutNamespace(*next.Service)), + Service: service.ToProto(next.Service), }) if err != nil { return errors.InternalServerError("go.micro.registry", err.Error()) @@ -161,45 +209,31 @@ func (r *Registry) Watch(ctx context.Context, req *pb.WatchRequest, rsp pb.Regis } } -// canReadService is a helper function which returns a boolean indicating -// if a context can read a service. -func canReadService(ctx context.Context, srv *registry.Service) bool { - // check if the service has no prefix which means it was written - // directly to the store and is therefore assumed to be part of - // the default namespace - if len(strings.Split(srv.Name, nameSeperator)) == 1 { - return true - } +// authorizeDomainAccess will return a go-micro error if the context cannot access the given domain +func authorizeDomainAccess(ctx context.Context, domain string) error { + acc, ok := auth.AccountFromContext(ctx) - // the service belongs to the contexts namespace - if strings.HasPrefix(srv.Name, namespace.FromContext(ctx)+nameSeperator) { - return true + // accounts are always required so we can identify the caller. If auth is not configured, the noop + // auth implementation will return a blank account with the default domain set, allowing the caller + // access to all resources + if !ok { + return errors.Unauthorized("go.micro.registry", "An account is required") } - return false -} - -// nameSeperator is the string which is used as a seperator when joining -// namespace to the service name -const nameSeperator = "/" + // anyone can access the default domain + if domain == registry.DefaultDomain { + return nil + } -// withoutNamespace returns the service with the namespace stripped from -// the name, e.g. 'bar/go.micro.service.foo' => 'go.micro.service.foo'. -func withoutNamespace(srv registry.Service) *registry.Service { - comps := strings.Split(srv.Name, nameSeperator) - srv.Name = comps[len(comps)-1] - return &srv -} + // the server can access all domains + if acc.Issuer == registry.DefaultDomain { + return nil + } -// withNamespace returns the service with the namespace prefixed to the -// name, e.g. 'go.micro.service.foo' => 'bar/go.micro.service.foo' -func withNamespace(srv pb.Service, ns string) *pb.Service { - // if the namespace is the default, don't append anything since this - // means users not leveraging multi-tenancy won't experience any changes - if ns == namespace.DefaultNamespace { - return &srv + // ensure the account is requesing access to it's own domain + if acc.Issuer != domain { + return errors.Forbidden("go.micro.registry", "An account issued by %v is required", domain) } - srv.Name = strings.Join([]string{ns, srv.Name}, nameSeperator) - return &srv + return nil } diff --git a/service/registry/registry.go b/service/registry/registry.go index 388cbb8447b..46c2562a8f4 100644 --- a/service/registry/registry.go +++ b/service/registry/registry.go @@ -114,10 +114,9 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { // register the handler pb.RegisterRegistryHandler(service.Server(), &handler.Registry{ - Id: id, + ID: id, Publisher: micro.NewPublisher(Topic, service.Client()), Registry: service.Options().Registry, - Auth: service.Options().Auth, }) // run the service diff --git a/service/router/handler/router.go b/service/router/handler/router.go index 9c5eaf8ba0c..bec8687d785 100644 --- a/service/router/handler/router.go +++ b/service/router/handler/router.go @@ -17,7 +17,10 @@ type Router struct { // Lookup looks up routes in the routing table and returns them func (r *Router) Lookup(ctx context.Context, req *pb.LookupRequest, resp *pb.LookupResponse) error { - routes, err := r.Router.Lookup(router.QueryService(req.Query.Service)) + routes, err := r.Router.Lookup( + router.QueryService(req.Query.Service), + router.QueryNetwork(req.Query.Network), + ) if err != nil { return errors.InternalServerError("go.micro.router", "failed to lookup routes: %v", err) } @@ -126,7 +129,7 @@ func (r *Router) Process(ctx context.Context, req *pb.Advert, rsp *pb.ProcessRes return nil } -// Watch streans routing table events +// Watch streams routing table events func (r *Router) Watch(ctx context.Context, req *pb.WatchRequest, stream pb.Router_WatchStream) error { watcher, err := r.Router.Watch() if err != nil { diff --git a/service/router/handler/table.go b/service/router/handler/table.go index fded9720a0d..b2401b016bc 100644 --- a/service/router/handler/table.go +++ b/service/router/handler/table.go @@ -90,7 +90,10 @@ func (t *Table) List(ctx context.Context, req *pb.Request, resp *pb.ListResponse } func (t *Table) Query(ctx context.Context, req *pb.QueryRequest, resp *pb.QueryResponse) error { - routes, err := t.Router.Table().Query(router.QueryService(req.Query.Service)) + routes, err := t.Router.Table().Query( + router.QueryService(req.Query.Service), + router.QueryNetwork(req.Query.Network), + ) if err != nil { return errors.InternalServerError("go.micro.router", "failed to lookup routes: %s", err) } diff --git a/service/router/router.go b/service/router/router.go index dfc74131019..43a7ce5358b 100644 --- a/service/router/router.go +++ b/service/router/router.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "os" - "sync" "time" "github.com/micro/cli/v2" @@ -137,21 +136,11 @@ func (r *rtr) PublishAdverts(ch <-chan *router.Advert) error { return nil } -// Start starts the micro router -func (r *rtr) Start() error { - // start the router - if err := r.Router.Start(); err != nil { - return fmt.Errorf("failed to start router: %v", err) - } - - return nil -} - -// Stop stops the micro router -func (r *rtr) Stop() error { - // stop the router - if err := r.Router.Stop(); err != nil { - return fmt.Errorf("failed to stop router: %v", err) +// Close the micro router +func (r *rtr) Close() error { + // close the router + if err := r.Router.Close(); err != nil { + return fmt.Errorf("failed to close router: %v", err) } return nil @@ -233,39 +222,27 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { // create new micro router and start advertising routes rtr := newRouter(service, r) - log.Info("starting micro router") - - if err := rtr.Start(); err != nil { - log.Errorf("failed to start: %s", err) - os.Exit(1) - } - log.Info("starting to advertise") advertChan, err := rtr.Advertise() if err != nil { log.Errorf("failed to advertise: %s", err) log.Info("attempting to stop the router") - if err := rtr.Stop(); err != nil { - log.Errorf("failed to stop: %s", err) + if err := rtr.Close(); err != nil { + log.Errorf("failed to close: %s", err) os.Exit(1) } os.Exit(1) } - var wg sync.WaitGroup // error channel to collect router errors errChan := make(chan error, 2) - wg.Add(1) go func() { - defer wg.Done() errChan <- rtr.PublishAdverts(advertChan) }() - wg.Add(1) go func() { - defer wg.Done() errChan <- service.Run() }() @@ -274,17 +251,15 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { log.Errorf("error running the router: %v", err) } - log.Info("attempting to stop the router") + log.Info("attempting to close the router") - // stop the router - if err := r.Stop(); err != nil { - log.Errorf("failed to stop: %s", err) + // close the router + if err := r.Close(); err != nil { + log.Errorf("failed to close: %s", err) os.Exit(1) } - wg.Wait() - - log.Info("successfully stopped") + log.Info("successfully closed") } func Commands(options ...micro.Option) []*cli.Command { diff --git a/service/runtime/handler/util.go b/service/runtime/handler/util.go index ac15b8a2f3e..eeb4fa9be36 100644 --- a/service/runtime/handler/util.go +++ b/service/runtime/handler/util.go @@ -164,8 +164,20 @@ func compress(src string, buf io.Writer) error { // must provide real name // (see https://golang.org/src/archive/tar/common.go?#L626) - header.Name = filepath.ToSlash(strings.ReplaceAll(file, src+string(filepath.Separator), "")) - if header.Name == src { + srcWithSlash := src + if !strings.HasSuffix(src, string(filepath.Separator)) { + srcWithSlash = src + string(filepath.Separator) + } + header.Name = strings.ReplaceAll(file, srcWithSlash, "") + if header.Name == src || len(strings.TrimSpace(header.Name)) == 0 { + return nil + } + + // @todo This is a quick hack to speed up whole repo uploads + // https://github.com/micro/micro/pull/956 + if !fi.IsDir() && !strings.HasSuffix(header.Name, ".go") && + !strings.HasSuffix(header.Name, ".mod") && + !strings.HasSuffix(header.Name, ".sum") { return nil } @@ -176,6 +188,7 @@ func compress(src string, buf io.Writer) error { if fi.IsDir() { return nil } + // if not a dir, write file content data, err := os.Open(file) diff --git a/service/runtime/manager/events.go b/service/runtime/manager/events.go index 324aa7bb485..46cdb93d12f 100644 --- a/service/runtime/manager/events.go +++ b/service/runtime/manager/events.go @@ -154,9 +154,9 @@ func (m *manager) runtimeEnv(options *runtime.CreateOptions) []string { // override with vars from the Profile setEnv(m.options.Profile, env) - // temp: set the auth namespace. this will be removed once he namespace can be determined from certs. + // temp: set the service namespace. this will be removed once he namespace can be determined from certs. if len(options.Namespace) > 0 { - env["MICRO_AUTH_NAMESPACE"] = options.Namespace + env["MICRO_NAMESPACE"] = options.Namespace } // create a new env diff --git a/service/runtime/service.go b/service/runtime/service.go index 0d397642dfa..2a296a669e9 100644 --- a/service/runtime/service.go +++ b/service/runtime/service.go @@ -246,7 +246,17 @@ func upload(ctx *cli.Context, source *git.Source) (string, error) { } uploadedFileName := strings.ReplaceAll(source.Folder, string(filepath.Separator), "-") + ".tar.gz" path := filepath.Join(os.TempDir(), uploadedFileName) - err := handler.Compress(source.FullPath, path) + + var err error + if len(source.LocalRepoRoot) > 0 { + // @todo currently this uploads the whole repo all the time to support local dependencies + // in parents (ie service path is `repo/a/b/c` and it depends on `repo/a/b`). + // Optimise this by only uploading things that are needed. + err = handler.Compress(source.LocalRepoRoot, path) + } else { + err = handler.Compress(source.FullPath, path) + } + if err != nil { fmt.Println(err) os.Exit(1) diff --git a/service/tunnel/tunnel.go b/service/tunnel/tunnel.go index 389058cabf7..d033e8611a5 100644 --- a/service/tunnel/tunnel.go +++ b/service/tunnel/tunnel.go @@ -76,12 +76,6 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { router.Registry(service.Client().Options().Registry), ) - // start the router - if err := r.Start(); err != nil { - log.Errorf("Tunnel error starting router: %s", err) - os.Exit(1) - } - // create a tunnel t := tun.NewTunnel( tun.Address(Address), @@ -152,8 +146,8 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { } // stop the router - if err := r.Stop(); err != nil { - log.Errorf("Tunnel error stopping tunnel router: %v", err) + if err := r.Close(); err != nil { + log.Errorf("Tunnel error closing tunnel router: %v", err) } // stop the server diff --git a/test/Dockerfile b/test/Dockerfile index b627b47c9a0..170c97367c5 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -31,7 +31,6 @@ COPY ./test/config-example-service ${GOPATH}/src/config-example-service # Speeding up tests by predownloading dependencies for services used. RUN cd ${GOPATH}/src/example-service && go get && \ cd ${GOPATH}/src/config-example-service && go get && \ - go get github.com/micro/services/location && \ go get github.com/micro/services/helloworld # RUN go get github.com/crufter/micro-services/logspammer diff --git a/test/README.md b/test/README.md index d84e0ad11e7..6bda20fd9e7 100644 --- a/test/README.md +++ b/test/README.md @@ -14,7 +14,12 @@ Reasons why you should not run this locally: Although the tests run in docker, the containers and envs are named so you can easily interact with them. Some useful tricks: -First let's start a test, cd into the `test` folder and then: +First, we have to build a local docker image: +``` +bash scripts/build-local-docker.sh +``` + +To start a test, cd into the `test` folder and then: ``` go clean -testcache && go test --tags=integration -failfast -v -run TestServerAuth$ @@ -44,3 +49,14 @@ This means we can also interact with the server running in the container in the ``` $ micro -env=testServerAuth status ``` + +The loop script can be used to test for flakiness: +``` +cd test; bash loop.sh +``` + +or to run all tests once: + +``` +go clean -testcache && go test --tags=integration -v ./... +``` \ No newline at end of file diff --git a/test/dep-test/dep-test-service/.gitignore b/test/dep-test/dep-test-service/.gitignore new file mode 100644 index 00000000000..9d7aeafc174 --- /dev/null +++ b/test/dep-test/dep-test-service/.gitignore @@ -0,0 +1,2 @@ + +dep-service diff --git a/test/dep-test/dep-test-service/Dockerfile b/test/dep-test/dep-test-service/Dockerfile new file mode 100644 index 00000000000..d062d7b6220 --- /dev/null +++ b/test/dep-test/dep-test-service/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine +ADD dep-service /dep-service +ENTRYPOINT [ "/dep-service" ] diff --git a/test/dep-test/dep-test-service/Makefile b/test/dep-test/dep-test-service/Makefile new file mode 100644 index 00000000000..167883e2c1b --- /dev/null +++ b/test/dep-test/dep-test-service/Makefile @@ -0,0 +1,22 @@ + +GOPATH:=$(shell go env GOPATH) +MODIFY=Mproto/imports/api.proto=github.com/micro/go-micro/v2/api/proto + +.PHONY: proto +proto: + + protoc --proto_path=. --micro_out=${MODIFY}:. --go_out=${MODIFY}:. proto/dep/dep.proto + + +.PHONY: build +build: proto + + go build -o dep-service *.go + +.PHONY: test +test: + go test -v ./... -cover + +.PHONY: docker +docker: + docker build . -t dep-service:latest diff --git a/test/dep-test/dep-test-service/README.md b/test/dep-test/dep-test-service/README.md new file mode 100644 index 00000000000..63c0e6d95ba --- /dev/null +++ b/test/dep-test/dep-test-service/README.md @@ -0,0 +1,55 @@ +# Dep Service + +This is the Dep service + +Generated with + +``` +micro new --namespace=go.micro --type=service dep-test-service +``` + +## Getting Started + +- [Configuration](#configuration) +- [Dependencies](#dependencies) +- [Usage](#usage) + +## Configuration + +- FQDN: go.micro.service.dep +- Type: service +- Alias: dep + +## Dependencies + +Micro services depend on service discovery. The default is multicast DNS, a zeroconf system. + +In the event you need a resilient multi-host setup we recommend etcd. + +``` +# install etcd +brew install etcd + +# run etcd +etcd +``` + +## Usage + +A Makefile is included for convenience + +Build the binary + +``` +make build +``` + +Run the service +``` +./dep-service +``` + +Build a docker image +``` +make docker +``` \ No newline at end of file diff --git a/test/dep-test/dep-test-service/generate.go b/test/dep-test/dep-test-service/generate.go new file mode 100644 index 00000000000..96f431a281b --- /dev/null +++ b/test/dep-test/dep-test-service/generate.go @@ -0,0 +1,2 @@ +package main +//go:generate make proto diff --git a/test/dep-test/dep-test-service/go.mod b/test/dep-test/dep-test-service/go.mod new file mode 100644 index 00000000000..7ff0dff0333 --- /dev/null +++ b/test/dep-test/dep-test-service/go.mod @@ -0,0 +1,16 @@ +module dep-test-service + +go 1.13 + +// This can be removed once etcd becomes go gettable, version 3.4 and 3.5 is not, +// see https://github.com/etcd-io/etcd/issues/11154 and https://github.com/etcd-io/etcd/issues/11931. +replace google.golang.org/grpc => google.golang.org/grpc v1.26.0 + +replace dependency => ../ + +require ( + dependency v0.0.0-00010101000000-000000000000 + github.com/golang/protobuf v1.4.2 + github.com/micro/go-micro/v2 v2.9.0 + google.golang.org/protobuf v1.24.0 +) diff --git a/test/dep-test/dep-test-service/go.sum b/test/dep-test/dep-test-service/go.sum new file mode 100644 index 00000000000..cec3566cb0f --- /dev/null +++ b/test/dep-test/dep-test-service/go.sum @@ -0,0 +1,574 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +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= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +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/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +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/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest/autorest v0.1.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= +github.com/Azure/go-autorest/autorest v0.5.0/go.mod h1:9HLKlQjVBH6U3oDfsXOeVc56THsLPw1L03yban4xThw= +github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= +github.com/Azure/go-autorest/autorest/adal v0.2.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= +github.com/Azure/go-autorest/autorest/azure/auth v0.1.0/go.mod h1:Gf7/i2FUpyb/sGBLIFxTBzrNzBo7aPXXE3ZVeDRwdpM= +github.com/Azure/go-autorest/autorest/azure/cli v0.1.0/go.mod h1:Dk8CUAt/b/PzkfeRsWzVG9Yj3ps8mS8ECztu43rdU8U= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= +github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= +github.com/Microsoft/hcsshim v0.8.7-0.20191101173118-65519b62243c/go.mod h1:7xhjOwRV2+0HXGmM0jxaEu+ZiXJFoVZOTfL/dmqbrD8= +github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:iGLljf5n9GjT6kc0HBvyI1nOKnGQbNB66VzSNbK5iks= +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/go.mod h1:uAXEEpARkRhCZfEvy/y0Jcc888f9tHCc1W7/UeEtreE= +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= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190808125512-07798873deee/go.mod h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ= +github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/aws/aws-sdk-go v1.23.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= +github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/bwmarrin/discordgo v0.20.2/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= +github.com/caddyserver/certmagic v0.10.6/go.mod h1:Y8jcUBctgk/IhpAzlHKfimZNyXCkfGgRTC0orl8gROQ= +github.com/cenkalti/backoff/v4 v4.0.0/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= +github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= +github.com/cloudflare/cloudflare-go v0.10.2/go.mod h1:qhVI5MKwBGhdNU89ZRz2plgYutcJ5PCekLxXn56w6SY= +github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= +github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= +github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= +github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= +github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= +github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= +github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.18+incompatible h1:Zz1aXgDrFFi1nadh58tA9ktt06cmPTwNNP3dXwIq1lE= +github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +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= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMElOWxok= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= +github.com/dnaeon/go-vcr v0.0.0-20180814043457-aafff18a5cc2/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/dnsimple/dnsimple-go v0.30.0/go.mod h1:O5TJ0/U6r7AfT8niYNlmohpLbCSG+c71tQlGr9SeGrg= +github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v1.4.2-0.20191101170500-ac7306503d23/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +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= +github.com/ef-ds/deque v1.0.4-0.20190904040645-54cb57c252a1/go.mod h1:HvODWzv6Y6kBf3Ah2WzN1bHjDUezGLaAhwuWVwfpEJs= +github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch/v5 v5.0.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= +github.com/exoscale/egoscale v0.18.1/go.mod h1:Z7OOdzzTOz1Q1PjQXumlz9Wn/CddH0zSYdCF3rnBKXE= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/forestgiant/sliceutil v0.0.0-20160425183142-94783f95db6c/go.mod h1:pFdJbAhRf7rh6YYMUdIQGyzne6zYL1tCUW8QV2B3UfY= +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/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.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-acme/lego/v3 v3.4.0/go.mod h1:xYbLDuxq3Hy4bMUT1t9JIuz6GWIWb3m5X+TeTHYaT7M= +github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM= +github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= +github.com/go-git/go-git/v5 v5.1.0 h1:HxJn9g/E7eYvKW3Fm7Jt4ee8LXfPOm/H1cdDu8vEssk= +github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ini/ini v1.44.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.3/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +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/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +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/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +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/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +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/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +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= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +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 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= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +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/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= +github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4= +github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= +github.com/imdario/mergo v0.3.9/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/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/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +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/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/labbsr0x/bindman-dns-webhook v1.0.2/go.mod h1:p6b+VCXIR8NYKpDr8/dg1HKfQoRHCdcsROXKvmoehKA= +github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c027w= +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/go.mod h1:Vn3/Fb0/77b02SGhQk36KzOUmXgVpFfizUfW5WMaqyU= +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/go.mod h1:pxVXcHHw1pNIt8Qo0pwSYQEoZ8yYOOPXTCZLQQunvRc= +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= +github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= +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/micro/go-micro v1.18.0 h1:gP70EZVHpJuUIT0YWth192JmlIci+qMOEByHm83XE9E= +github.com/micro/go-micro/v2 v2.9.0 h1:SeQ3ba02jqcl51mtkGPcZjxpIRrBXxUel8PFG4Z9QSU= +github.com/micro/go-micro/v2 v2.9.0/go.mod h1:x55ZM3Puy0FyvvkR3e0ha0xsE9DFwfPSUMWAIbFY0SY= +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= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0= +github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= +github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04/go.mod h1:5sN+Lt1CaY4wsPvgQH/jsuJi4XO2ssZbdsIizr4CVC8= +github.com/nats-io/jwt v0.3.2 h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.6/go.mod h1:BL1NOtaBQ5/y97djERRVWNouMW7GT3gxnmbE/eC8u8A= +github.com/nats-io/nats.go v1.9.2 h1:oDeERm3NcZVrPpdR/JpGdWHMv3oJ8yY30YwxKq+DU2s= +github.com/nats-io/nats.go v1.9.2/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.4 h1:aEsHIssIk6ETN5m2/MD8Y4B2X7FfXrBAUdkyRvbVYzA= +github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= +github.com/nats-io/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/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk= +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/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/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +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.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= +github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= +github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= +github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +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= +github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +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/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= +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= +github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKcyumwBO6qip7RNQ5r77yrssm9bfCowcLEBcU5IA= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/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/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.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +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/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/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +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= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +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/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog= +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/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/transip/gotransip v0.0.0-20190812104329-6d8d9179b66f/go.mod h1:i0f4R4o2HM0m3DZYQWsj6/MEowD57VzoH0v3d7igeFY= +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/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= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= +github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +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.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= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/ratelimit v0.0.0-20180316092928-c15da0234277/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +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= +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-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-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +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/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= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +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-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/net v0.0.0-20180611182652-db08ff08e862/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +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-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-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= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +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/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/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +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= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/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-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-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-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= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-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/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/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= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +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= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +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.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-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= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +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/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +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/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +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/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= +gopkg.in/resty.v1 v1.9.1/go.mod h1:vo52Hzryw9PnPHcJfPsBiFW62XhNx5OczbV9y+IMpgc= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/telegram-bot-api.v4 v4.6.4/go.mod h1:5DpGO5dbumb40px+dXcwCpcjmeHNYLpk0bp3XRNvWDM= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +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= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +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= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +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= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/test/dep-test/dep-test-service/handler/dep.go b/test/dep-test/dep-test-service/handler/dep.go new file mode 100644 index 00000000000..d2daf8c554a --- /dev/null +++ b/test/dep-test/dep-test-service/handler/dep.go @@ -0,0 +1,48 @@ +package handler + +import ( + "context" + + log "github.com/micro/go-micro/v2/logger" + + dep "dep-test-service/proto/dep" +) + +type Dep struct{} + +// Call is a single request handler called via client.Call or the generated client code +func (e *Dep) Call(ctx context.Context, req *dep.Request, rsp *dep.Response) error { + log.Info("Received Dep.Call request") + rsp.Msg = "Hello " + req.Name + return nil +} + +// Stream is a server side stream handler called via client.Stream or the generated client code +func (e *Dep) Stream(ctx context.Context, req *dep.StreamingRequest, stream dep.Dep_StreamStream) error { + log.Infof("Received Dep.Stream request with count: %d", req.Count) + + for i := 0; i < int(req.Count); i++ { + log.Infof("Responding: %d", i) + if err := stream.Send(&dep.StreamingResponse{ + Count: int64(i), + }); err != nil { + return err + } + } + + return nil +} + +// PingPong is a bidirectional stream handler called via client.Stream or the generated client code +func (e *Dep) PingPong(ctx context.Context, stream dep.Dep_PingPongStream) error { + for { + req, err := stream.Recv() + if err != nil { + return err + } + log.Infof("Got ping %v", req.Stroke) + if err := stream.Send(&dep.Pong{Stroke: req.Stroke}); err != nil { + return err + } + } +} diff --git a/test/dep-test/dep-test-service/main.go b/test/dep-test/dep-test-service/main.go new file mode 100644 index 00000000000..0c90aaac361 --- /dev/null +++ b/test/dep-test/dep-test-service/main.go @@ -0,0 +1,36 @@ +package main + +import ( + "dep-test-service/handler" + "dep-test-service/subscriber" + "fmt" + + "github.com/micro/go-micro/v2" + log "github.com/micro/go-micro/v2/logger" + + dep "dep-test-service/proto/dep" + dependency "dependency" +) + +func main() { + // New Service + service := micro.NewService( + micro.Name("go.micro.service.dep"), + micro.Version("latest"), + ) + + // Initialise service + service.Init() + fmt.Println(dependency.Hello) + + // Register Handler + dep.RegisterDepHandler(service.Server(), new(handler.Dep)) + + // Register Struct as Subscriber + micro.RegisterSubscriber("go.micro.service.dep", service.Server(), new(subscriber.Dep)) + + // Run service + if err := service.Run(); err != nil { + log.Fatal(err) + } +} diff --git a/test/dep-test/dep-test-service/plugin.go b/test/dep-test/dep-test-service/plugin.go new file mode 100644 index 00000000000..c9ecbf5e0a1 --- /dev/null +++ b/test/dep-test/dep-test-service/plugin.go @@ -0,0 +1,2 @@ +package main + diff --git a/test/dep-test/dep-test-service/proto/dep/dep.pb.go b/test/dep-test/dep-test-service/proto/dep/dep.pb.go new file mode 100644 index 00000000000..52d96802221 --- /dev/null +++ b/test/dep-test/dep-test-service/proto/dep/dep.pb.go @@ -0,0 +1,541 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.24.0 +// protoc v3.6.1 +// source: proto/dep/dep.proto + +package go_micro_service_dep + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Message struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Say string `protobuf:"bytes,1,opt,name=say,proto3" json:"say,omitempty"` +} + +func (x *Message) Reset() { + *x = Message{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_dep_dep_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Message) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Message) ProtoMessage() {} + +func (x *Message) ProtoReflect() protoreflect.Message { + mi := &file_proto_dep_dep_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Message.ProtoReflect.Descriptor instead. +func (*Message) Descriptor() ([]byte, []int) { + return file_proto_dep_dep_proto_rawDescGZIP(), []int{0} +} + +func (x *Message) GetSay() string { + if x != nil { + return x.Say + } + return "" +} + +type Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Request) Reset() { + *x = Request{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_dep_dep_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Request) ProtoMessage() {} + +func (x *Request) ProtoReflect() protoreflect.Message { + mi := &file_proto_dep_dep_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Request.ProtoReflect.Descriptor instead. +func (*Request) Descriptor() ([]byte, []int) { + return file_proto_dep_dep_proto_rawDescGZIP(), []int{1} +} + +func (x *Request) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` +} + +func (x *Response) Reset() { + *x = Response{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_dep_dep_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_proto_dep_dep_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { + return file_proto_dep_dep_proto_rawDescGZIP(), []int{2} +} + +func (x *Response) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +type StreamingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *StreamingRequest) Reset() { + *x = StreamingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_dep_dep_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamingRequest) ProtoMessage() {} + +func (x *StreamingRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_dep_dep_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamingRequest.ProtoReflect.Descriptor instead. +func (*StreamingRequest) Descriptor() ([]byte, []int) { + return file_proto_dep_dep_proto_rawDescGZIP(), []int{3} +} + +func (x *StreamingRequest) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +type StreamingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *StreamingResponse) Reset() { + *x = StreamingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_dep_dep_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamingResponse) ProtoMessage() {} + +func (x *StreamingResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_dep_dep_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamingResponse.ProtoReflect.Descriptor instead. +func (*StreamingResponse) Descriptor() ([]byte, []int) { + return file_proto_dep_dep_proto_rawDescGZIP(), []int{4} +} + +func (x *StreamingResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +type Ping struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Stroke int64 `protobuf:"varint,1,opt,name=stroke,proto3" json:"stroke,omitempty"` +} + +func (x *Ping) Reset() { + *x = Ping{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_dep_dep_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ping) ProtoMessage() {} + +func (x *Ping) ProtoReflect() protoreflect.Message { + mi := &file_proto_dep_dep_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ping.ProtoReflect.Descriptor instead. +func (*Ping) Descriptor() ([]byte, []int) { + return file_proto_dep_dep_proto_rawDescGZIP(), []int{5} +} + +func (x *Ping) GetStroke() int64 { + if x != nil { + return x.Stroke + } + return 0 +} + +type Pong struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Stroke int64 `protobuf:"varint,1,opt,name=stroke,proto3" json:"stroke,omitempty"` +} + +func (x *Pong) Reset() { + *x = Pong{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_dep_dep_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pong) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pong) ProtoMessage() {} + +func (x *Pong) ProtoReflect() protoreflect.Message { + mi := &file_proto_dep_dep_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Pong.ProtoReflect.Descriptor instead. +func (*Pong) Descriptor() ([]byte, []int) { + return file_proto_dep_dep_proto_rawDescGZIP(), []int{6} +} + +func (x *Pong) GetStroke() int64 { + if x != nil { + return x.Stroke + } + return 0 +} + +var File_proto_dep_dep_proto protoreflect.FileDescriptor + +var file_proto_dep_dep_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x65, 0x70, 0x2f, 0x64, 0x65, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x70, 0x22, 0x1b, 0x0a, 0x07, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x61, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x61, 0x79, 0x22, 0x1d, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x1c, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x28, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, + 0x29, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x1e, 0x0a, 0x04, 0x50, 0x69, + 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x22, 0x1e, 0x0a, 0x04, 0x50, 0x6f, + 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x32, 0xf7, 0x01, 0x0a, 0x03, 0x44, + 0x65, 0x70, 0x12, 0x47, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x2e, + 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x65, + 0x70, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, + 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x70, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x06, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x70, 0x2e, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, + 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x64, 0x65, 0x70, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x48, 0x0a, 0x08, 0x50, 0x69, + 0x6e, 0x67, 0x50, 0x6f, 0x6e, 0x67, 0x12, 0x1a, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, + 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x70, 0x2e, 0x50, 0x69, + 0x6e, 0x67, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x70, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x22, 0x00, + 0x28, 0x01, 0x30, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_dep_dep_proto_rawDescOnce sync.Once + file_proto_dep_dep_proto_rawDescData = file_proto_dep_dep_proto_rawDesc +) + +func file_proto_dep_dep_proto_rawDescGZIP() []byte { + file_proto_dep_dep_proto_rawDescOnce.Do(func() { + file_proto_dep_dep_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_dep_dep_proto_rawDescData) + }) + return file_proto_dep_dep_proto_rawDescData +} + +var file_proto_dep_dep_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_proto_dep_dep_proto_goTypes = []interface{}{ + (*Message)(nil), // 0: go.micro.service.dep.Message + (*Request)(nil), // 1: go.micro.service.dep.Request + (*Response)(nil), // 2: go.micro.service.dep.Response + (*StreamingRequest)(nil), // 3: go.micro.service.dep.StreamingRequest + (*StreamingResponse)(nil), // 4: go.micro.service.dep.StreamingResponse + (*Ping)(nil), // 5: go.micro.service.dep.Ping + (*Pong)(nil), // 6: go.micro.service.dep.Pong +} +var file_proto_dep_dep_proto_depIdxs = []int32{ + 1, // 0: go.micro.service.dep.Dep.Call:input_type -> go.micro.service.dep.Request + 3, // 1: go.micro.service.dep.Dep.Stream:input_type -> go.micro.service.dep.StreamingRequest + 5, // 2: go.micro.service.dep.Dep.PingPong:input_type -> go.micro.service.dep.Ping + 2, // 3: go.micro.service.dep.Dep.Call:output_type -> go.micro.service.dep.Response + 4, // 4: go.micro.service.dep.Dep.Stream:output_type -> go.micro.service.dep.StreamingResponse + 6, // 5: go.micro.service.dep.Dep.PingPong:output_type -> go.micro.service.dep.Pong + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_proto_dep_dep_proto_init() } +func file_proto_dep_dep_proto_init() { + if File_proto_dep_dep_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_dep_dep_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Message); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_dep_dep_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_dep_dep_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_dep_dep_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamingRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_dep_dep_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_dep_dep_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ping); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_dep_dep_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pong); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_dep_dep_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_dep_dep_proto_goTypes, + DependencyIndexes: file_proto_dep_dep_proto_depIdxs, + MessageInfos: file_proto_dep_dep_proto_msgTypes, + }.Build() + File_proto_dep_dep_proto = out.File + file_proto_dep_dep_proto_rawDesc = nil + file_proto_dep_dep_proto_goTypes = nil + file_proto_dep_dep_proto_depIdxs = nil +} diff --git a/test/dep-test/dep-test-service/proto/dep/dep.pb.micro.go b/test/dep-test/dep-test-service/proto/dep/dep.pb.micro.go new file mode 100644 index 00000000000..1823fb7c2a4 --- /dev/null +++ b/test/dep-test/dep-test-service/proto/dep/dep.pb.micro.go @@ -0,0 +1,284 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: proto/dep/dep.proto + +package go_micro_service_dep + +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 Dep service + +func NewDepEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for Dep service + +type DepService interface { + Call(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) + Stream(ctx context.Context, in *StreamingRequest, opts ...client.CallOption) (Dep_StreamService, error) + PingPong(ctx context.Context, opts ...client.CallOption) (Dep_PingPongService, error) +} + +type depService struct { + c client.Client + name string +} + +func NewDepService(name string, c client.Client) DepService { + return &depService{ + c: c, + name: name, + } +} + +func (c *depService) Call(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) { + req := c.c.NewRequest(c.name, "Dep.Call", in) + out := new(Response) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *depService) Stream(ctx context.Context, in *StreamingRequest, opts ...client.CallOption) (Dep_StreamService, error) { + req := c.c.NewRequest(c.name, "Dep.Stream", &StreamingRequest{}) + 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 &depServiceStream{stream}, nil +} + +type Dep_StreamService interface { + Context() context.Context + SendMsg(interface{}) error + RecvMsg(interface{}) error + Close() error + Recv() (*StreamingResponse, error) +} + +type depServiceStream struct { + stream client.Stream +} + +func (x *depServiceStream) Close() error { + return x.stream.Close() +} + +func (x *depServiceStream) Context() context.Context { + return x.stream.Context() +} + +func (x *depServiceStream) SendMsg(m interface{}) error { + return x.stream.Send(m) +} + +func (x *depServiceStream) RecvMsg(m interface{}) error { + return x.stream.Recv(m) +} + +func (x *depServiceStream) Recv() (*StreamingResponse, error) { + m := new(StreamingResponse) + err := x.stream.Recv(m) + if err != nil { + return nil, err + } + return m, nil +} + +func (c *depService) PingPong(ctx context.Context, opts ...client.CallOption) (Dep_PingPongService, error) { + req := c.c.NewRequest(c.name, "Dep.PingPong", &Ping{}) + stream, err := c.c.Stream(ctx, req, opts...) + if err != nil { + return nil, err + } + return &depServicePingPong{stream}, nil +} + +type Dep_PingPongService interface { + Context() context.Context + SendMsg(interface{}) error + RecvMsg(interface{}) error + Close() error + Send(*Ping) error + Recv() (*Pong, error) +} + +type depServicePingPong struct { + stream client.Stream +} + +func (x *depServicePingPong) Close() error { + return x.stream.Close() +} + +func (x *depServicePingPong) Context() context.Context { + return x.stream.Context() +} + +func (x *depServicePingPong) SendMsg(m interface{}) error { + return x.stream.Send(m) +} + +func (x *depServicePingPong) RecvMsg(m interface{}) error { + return x.stream.Recv(m) +} + +func (x *depServicePingPong) Send(m *Ping) error { + return x.stream.Send(m) +} + +func (x *depServicePingPong) Recv() (*Pong, error) { + m := new(Pong) + err := x.stream.Recv(m) + if err != nil { + return nil, err + } + return m, nil +} + +// Server API for Dep service + +type DepHandler interface { + Call(context.Context, *Request, *Response) error + Stream(context.Context, *StreamingRequest, Dep_StreamStream) error + PingPong(context.Context, Dep_PingPongStream) error +} + +func RegisterDepHandler(s server.Server, hdlr DepHandler, opts ...server.HandlerOption) error { + type dep interface { + Call(ctx context.Context, in *Request, out *Response) error + Stream(ctx context.Context, stream server.Stream) error + PingPong(ctx context.Context, stream server.Stream) error + } + type Dep struct { + dep + } + h := &depHandler{hdlr} + return s.Handle(s.NewHandler(&Dep{h}, opts...)) +} + +type depHandler struct { + DepHandler +} + +func (h *depHandler) Call(ctx context.Context, in *Request, out *Response) error { + return h.DepHandler.Call(ctx, in, out) +} + +func (h *depHandler) Stream(ctx context.Context, stream server.Stream) error { + m := new(StreamingRequest) + if err := stream.Recv(m); err != nil { + return err + } + return h.DepHandler.Stream(ctx, m, &depStreamStream{stream}) +} + +type Dep_StreamStream interface { + Context() context.Context + SendMsg(interface{}) error + RecvMsg(interface{}) error + Close() error + Send(*StreamingResponse) error +} + +type depStreamStream struct { + stream server.Stream +} + +func (x *depStreamStream) Close() error { + return x.stream.Close() +} + +func (x *depStreamStream) Context() context.Context { + return x.stream.Context() +} + +func (x *depStreamStream) SendMsg(m interface{}) error { + return x.stream.Send(m) +} + +func (x *depStreamStream) RecvMsg(m interface{}) error { + return x.stream.Recv(m) +} + +func (x *depStreamStream) Send(m *StreamingResponse) error { + return x.stream.Send(m) +} + +func (h *depHandler) PingPong(ctx context.Context, stream server.Stream) error { + return h.DepHandler.PingPong(ctx, &depPingPongStream{stream}) +} + +type Dep_PingPongStream interface { + Context() context.Context + SendMsg(interface{}) error + RecvMsg(interface{}) error + Close() error + Send(*Pong) error + Recv() (*Ping, error) +} + +type depPingPongStream struct { + stream server.Stream +} + +func (x *depPingPongStream) Close() error { + return x.stream.Close() +} + +func (x *depPingPongStream) Context() context.Context { + return x.stream.Context() +} + +func (x *depPingPongStream) SendMsg(m interface{}) error { + return x.stream.Send(m) +} + +func (x *depPingPongStream) RecvMsg(m interface{}) error { + return x.stream.Recv(m) +} + +func (x *depPingPongStream) Send(m *Pong) error { + return x.stream.Send(m) +} + +func (x *depPingPongStream) Recv() (*Ping, error) { + m := new(Ping) + if err := x.stream.Recv(m); err != nil { + return nil, err + } + return m, nil +} diff --git a/test/dep-test/dep-test-service/proto/dep/dep.proto b/test/dep-test/dep-test-service/proto/dep/dep.proto new file mode 100644 index 00000000000..495df1a2c16 --- /dev/null +++ b/test/dep-test/dep-test-service/proto/dep/dep.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; + +package go.micro.service.dep; + +service Dep { + rpc Call(Request) returns (Response) {} + rpc Stream(StreamingRequest) returns (stream StreamingResponse) {} + rpc PingPong(stream Ping) returns (stream Pong) {} +} + +message Message { + string say = 1; +} + +message Request { + string name = 1; +} + +message Response { + string msg = 1; +} + +message StreamingRequest { + int64 count = 1; +} + +message StreamingResponse { + int64 count = 1; +} + +message Ping { + int64 stroke = 1; +} + +message Pong { + int64 stroke = 1; +} diff --git a/test/dep-test/dep-test-service/proto/imports/api.proto b/test/dep-test/dep-test-service/proto/imports/api.proto new file mode 100644 index 00000000000..fd0f9fec901 --- /dev/null +++ b/test/dep-test/dep-test-service/proto/imports/api.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package go.api; + +message Pair { + string key = 1; + repeated string values = 2; +} + +// A HTTP request as RPC +// Forward by the api handler +message Request { + string method = 1; + string path = 2; + map header = 3; + map get = 4; + map post = 5; + string body = 6; // raw request body; if not application/x-www-form-urlencoded + string url = 7; +} + +// A HTTP response as RPC +// Expected response for the api handler +message Response { + int32 statusCode = 1; + map header = 2; + string body = 3; +} + +// A HTTP event as RPC +// Forwarded by the event handler +message Event { + // e.g login + string name = 1; + // uuid + string id = 2; + // unix timestamp of event + int64 timestamp = 3; + // event headers + map header = 4; + // the event data + string data = 5; +} diff --git a/test/dep-test/dep-test-service/subscriber/dep.go b/test/dep-test/dep-test-service/subscriber/dep.go new file mode 100644 index 00000000000..8135aebb06b --- /dev/null +++ b/test/dep-test/dep-test-service/subscriber/dep.go @@ -0,0 +1,20 @@ +package subscriber + +import ( + "context" + log "github.com/micro/go-micro/v2/logger" + + dep "dep-test-service/proto/dep" +) + +type Dep struct{} + +func (e *Dep) Handle(ctx context.Context, msg *dep.Message) error { + log.Info("Handler Received message: ", msg.Say) + return nil +} + +func Handler(ctx context.Context, msg *dep.Message) error { + log.Info("Function Received message: ", msg.Say) + return nil +} diff --git a/test/dep-test/dep.go b/test/dep-test/dep.go new file mode 100644 index 00000000000..e98f504a9c3 --- /dev/null +++ b/test/dep-test/dep.go @@ -0,0 +1,3 @@ +package dep + +const Hello = "hello" diff --git a/test/dep-test/go.mod b/test/dep-test/go.mod new file mode 100644 index 00000000000..c6c52bf3c79 --- /dev/null +++ b/test/dep-test/go.mod @@ -0,0 +1,3 @@ +module github.com/micro/micro/test/dep-test + +go 1.13 diff --git a/test/misc_test.go b/test/misc_test.go index c84bfdef0cd..5ebd3275714 100644 --- a/test/misc_test.go +++ b/test/misc_test.go @@ -3,6 +3,7 @@ package test import ( + "fmt" "os/exec" "strings" "testing" @@ -108,3 +109,48 @@ func testWrongCommands(t *t) { t.Fatalf("Unexpected output for unrecognized subcommand: %v", string(outp)) } } + +// TestHelps ensures all `micro [command name] help` && `micro [command name] --help` commands are working. +func TestHelps(t *testing.T) { + trySuite(t, testHelps, retryCount) +} + +func testHelps(t *t) { + comm := exec.Command("micro", "help") + outp, err := comm.CombinedOutput() + if err != nil { + t.Fatal(err) + } + commands := strings.Split(strings.Split(string(outp), "COMMANDS:")[1], "GLOBAL OPTIONS:")[0] + for _, line := range strings.Split(commands, "\n") { + trimmed := strings.TrimSpace(line) + if len(trimmed) == 0 { + continue + } + // no help for help ;) + if strings.Contains(trimmed, "help") { + continue + } + commandName := strings.Split(trimmed, " ")[0] + comm = exec.Command("micro", commandName, "--help") + outp, err = comm.CombinedOutput() + + if err != nil { + t.Fatal(fmt.Errorf("Command %v output is wrong: %v", commandName, string(outp))) + break + } + if !strings.Contains(string(outp), "micro "+commandName+" -") { + t.Fatal(commandName + " output is wrong: " + string(outp)) + break + } + } +} + +func TestUnrecognisedCommand(t *testing.T) { + t.Parallel() + outp, _ := exec.Command("micro", "foobar").CombinedOutput() + if !strings.Contains(string(outp), "Unrecognized micro command: foobar. Please refer to 'micro --help'") { + t.Fatalf("micro foobar does not return correct error %v", string(outp)) + return + } +} diff --git a/test/runtime_test.go b/test/runtime_test.go index 06b930218ae..07405cdd707 100644 --- a/test/runtime_test.go +++ b/test/runtime_test.go @@ -9,8 +9,8 @@ import ( "os" "os/exec" "path/filepath" + "regexp" "strings" - "syscall" "testing" "time" ) @@ -68,7 +68,7 @@ func testRunLocalSource(t *t) { // The started service should have the runtime name of "test/example-service", // as the runtime name is the relative path inside a repo. - if !strings.Contains(string(outp), "test/example-service") { + if !statusRunning("test/example-service", outp) { return outp, errors.New("Can't find example service in runtime") } return outp, err @@ -112,7 +112,7 @@ func testRunAndKill(t *t) { // The started service should have the runtime name of "test/example-service", // as the runtime name is the relative path inside a repo. - if !strings.Contains(string(outp), "test/example-service") { + if !statusRunning("test/example-service", outp) { return outp, errors.New("Can't find example service in runtime") } return outp, err @@ -230,42 +230,10 @@ func testLocalOutsideRepo(t *t) { }, 75*time.Second) } -func TestLocalEnvRunGithubSource(t *testing.T) { - //trySuite(t, testLocalEnvRunGithubSource, retryCount) -} - -func testLocalEnvRunGithubSource(t *t) { - t.Parallel() - outp, err := exec.Command("micro", "env", "set", "local").CombinedOutput() - if err != nil { - t.Fatalf("Failed to set env to local, err: %v, output: %v", err, string(outp)) - return - } - var cmd *exec.Cmd - go func() { - cmd = exec.Command("micro", "run", "location") - // fire and forget as this will run forever - cmd.CombinedOutput() - }() - time.Sleep(100 * time.Millisecond) - defer func() { - if cmd.Process != nil { - cmd.Process.Signal(syscall.SIGTERM) - } - }() +func statusRunning(service string, statusOutput []byte) bool { + reg, _ := regexp.Compile(service + "\\s+latest\\s+\\S+\\s+running") - try("Find location", t, func() ([]byte, error) { - psCmd := exec.Command("micro", "status") - outp, err := psCmd.CombinedOutput() - if err != nil { - return outp, err - } - - if !strings.Contains(string(outp), "location") { - return outp, errors.New("Output should contain location") - } - return outp, nil - }, 30*time.Second) + return reg.Match(statusOutput) } func TestRunGithubSource(t *testing.T) { @@ -301,7 +269,7 @@ func testRunGithubSource(t *t) { return outp, err } - if !strings.Contains(string(outp), "helloworld") { + if !statusRunning("helloworld", outp) { return outp, errors.New("Output should contain hello world") } return outp, nil @@ -353,7 +321,7 @@ func testRunLocalUpdateAndCall(t *t) { // The started service should have the runtime name of "test/example-service", // as the runtime name is the relative path inside a repo. - if !strings.Contains(string(outp), "test/example-service") { + if !statusRunning("test/example-service", outp) { return outp, errors.New("can't find service in runtime") } return outp, err @@ -522,3 +490,34 @@ func replaceStringInFile(t *t, filepath string, original, newone string) { return } } + +func TestParentDependency(t *testing.T) { + trySuite(t, testParentDependency, retryCount) +} + +func testParentDependency(t *t) { + t.Parallel() + serv := newServer(t) + serv.launch() + defer serv.close() + + runCmd := exec.Command("micro", serv.envFlag(), "run", "./dep-test/dep-test-service") + outp, err := runCmd.CombinedOutput() + if err != nil { + t.Fatalf("micro run failure, output: %v", string(outp)) + return + } + + try("Find hello world", t, func() ([]byte, error) { + psCmd := exec.Command("micro", serv.envFlag(), "status") + outp, err = psCmd.CombinedOutput() + if err != nil { + return outp, err + } + + if !statusRunning("dep-test-service", outp) { + return outp, errors.New("Output should contain hello world") + } + return outp, nil + }, 30*time.Second) +}