From ac6da04387d4dad148eeea6f864ef909a1b5556e Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Wed, 3 Jun 2020 15:27:25 +0100 Subject: [PATCH 01/47] Fix `micro new --type api` (#911) * v1 fix up micro new api * dont use buildinfo, traverse the go mod cache instead * fix go.mod * fix up go.sum * proto compile command is actually just `make proto` * fix test for new output --- client/cli/new/new.go | 233 ++++++++++++++++++---------------- go.sum | 83 +----------- internal/template/makefile.go | 2 +- internal/template/proto.go | 2 +- test/runtime_test.go | 7 +- 5 files changed, 131 insertions(+), 196 deletions(-) diff --git a/client/cli/new/new.go b/client/cli/new/new.go index f2dffe06398..8cf66575b11 100644 --- a/client/cli/new/new.go +++ b/client/cli/new/new.go @@ -2,8 +2,10 @@ package new import ( + "errors" "fmt" "go/build" + "io/ioutil" "os" "path" "path/filepath" @@ -28,7 +30,7 @@ func protoComments(goDir, alias string) []string { "go get github.com/micro/micro/v2/cmd/protoc-gen-micro", "\ncompile the proto file " + alias + ".proto:\n", "cd " + goDir, - "protoc --proto_path=.:$GOPATH/src --go_out=. --micro_out=. proto/" + alias + "/" + alias + ".proto\n", + "make proto\n", } } @@ -104,35 +106,28 @@ func create(c config) error { t := treeprint.New() - nodes := map[string]treeprint.Tree{} - nodes[c.GoDir] = t - // write the files for _, file := range c.Files { f := filepath.Join(c.GoDir, file.Path) dir := filepath.Dir(f) - b, ok := nodes[dir] - if !ok { - d, _ := filepath.Rel(c.GoDir, dir) - b = t.AddBranch(d) - nodes[dir] = b - } - if _, err := os.Stat(dir); os.IsNotExist(err) { if err := os.MkdirAll(dir, 0755); err != nil { return err } } - p := filepath.Base(f) - - b.AddNode(p) + addFileToTree(t, file.Path) if err := write(c, f, file.Tmpl); err != nil { return err } } + dst, err := copyAPIProto(c) + if err != nil { + return err + } + addFileToTree(t, dst) // print tree fmt.Println(t.String()) @@ -146,6 +141,62 @@ func create(c config) error { return nil } +func copyAPIProto(c config) (string, error) { + // Find and copy the api proto from go-micro located *somewhere* on local machine. + // Required because proto can't do imports from random places on the internet like github.com, + // needs to be somewhere local. Let's try and find it from go mod. This doesn't work if micro + // wasn't built on the user's machine + basedir := build.Default.GOPATH + + contents, err := ioutil.ReadDir(filepath.Join(basedir, "pkg", "mod", "github.com", "micro", "go-micro")) + if err != nil { + return "", errors.New("Unable to find go-micro version. Please try `go get github.com/micro/go-micro/v2`") + } + newestDir := "" + for _, v := range contents { + if v.IsDir() && strings.HasPrefix(v.Name(), "v2") && strings.Compare(newestDir, v.Name()) < 0 { + newestDir = v.Name() + } + } + if newestDir == "" { + return "", errors.New("Unable to find go-micro version. Please try `go get github.com/micro/go-micro/v2`") + } + + input, err := ioutil.ReadFile(fmt.Sprintf("%s/pkg/mod/github.com/micro/go-micro/%s/api/proto/api.proto", basedir, newestDir)) + if err != nil { + return "", err + } + f := filepath.Join(c.GoDir, "proto", "imports", "api.proto") + importsDir := filepath.Dir(f) + if err := os.Mkdir(importsDir, 0755); err != nil { + return "", err + } + err = ioutil.WriteFile(f, input, 0644) + if err != nil { + return "", err + } + return f[len(c.GoDir)+1:], nil + +} + +func addFileToTree(root treeprint.Tree, file string) { + + split := strings.Split(file, "/") + curr := root + for i := 0; i < len(split)-1; i++ { + n := curr.FindByValue(split[i]) + if n != nil { + curr = n + } else { + curr = curr.AddBranch(split[i]) + } + } + if curr.FindByValue(split[len(split)-1]) == nil { + curr.AddNode(split[len(split)-1]) + } + +} + func Run(ctx *cli.Context) { namespace := ctx.String("namespace") alias := ctx.String("alias") @@ -245,115 +296,78 @@ func Run(ctx *cli.Context) { } } - var c config + c := config{ + Alias: alias, + Command: command, + Namespace: namespace, + Type: atype, + FQDN: fqdn, + Dir: dir, + GoDir: goDir, + GoPath: goPath, + UseGoPath: useGoPath, + Plugins: plugins, + Comments: protoComments(goDir, alias), + } switch atype { case "function": // create service config - c = config{ - Alias: alias, - Command: command, - Namespace: namespace, - Type: atype, - FQDN: fqdn, - Dir: dir, - GoDir: goDir, - GoPath: goPath, - UseGoPath: useGoPath, - Plugins: plugins, - Files: []file{ - {"main.go", tmpl.MainFNC}, - {"generate.go", tmpl.GenerateFile}, - {"plugin.go", tmpl.Plugin}, - {"handler/" + alias + ".go", tmpl.HandlerFNC}, - {"subscriber/" + alias + ".go", tmpl.SubscriberFNC}, - {"proto/" + alias + "/" + alias + ".proto", tmpl.ProtoFNC}, - {"Dockerfile", tmpl.DockerFNC}, - {"Makefile", tmpl.Makefile}, - {"README.md", tmpl.ReadmeFNC}, - {".gitignore", tmpl.GitIgnore}, - }, - Comments: protoComments(goDir, alias), + c.Files = []file{ + {"main.go", tmpl.MainFNC}, + {"generate.go", tmpl.GenerateFile}, + {"plugin.go", tmpl.Plugin}, + {"handler/" + alias + ".go", tmpl.HandlerFNC}, + {"subscriber/" + alias + ".go", tmpl.SubscriberFNC}, + {"proto/" + alias + "/" + alias + ".proto", tmpl.ProtoFNC}, + {"Dockerfile", tmpl.DockerFNC}, + {"Makefile", tmpl.Makefile}, + {"README.md", tmpl.ReadmeFNC}, + {".gitignore", tmpl.GitIgnore}, } + case "service": // create service config - c = config{ - Alias: alias, - Command: command, - Namespace: namespace, - Type: atype, - FQDN: fqdn, - Dir: dir, - GoDir: goDir, - GoPath: goPath, - UseGoPath: useGoPath, - Plugins: plugins, - Files: []file{ - {"main.go", tmpl.MainSRV}, - {"generate.go", tmpl.GenerateFile}, - {"plugin.go", tmpl.Plugin}, - {"handler/" + alias + ".go", tmpl.HandlerSRV}, - {"subscriber/" + alias + ".go", tmpl.SubscriberSRV}, - {"proto/" + alias + "/" + alias + ".proto", tmpl.ProtoSRV}, - {"Dockerfile", tmpl.DockerSRV}, - {"Makefile", tmpl.Makefile}, - {"README.md", tmpl.Readme}, - {".gitignore", tmpl.GitIgnore}, - }, - Comments: protoComments(goDir, alias), + c.Files = []file{ + {"main.go", tmpl.MainSRV}, + {"generate.go", tmpl.GenerateFile}, + {"plugin.go", tmpl.Plugin}, + {"handler/" + alias + ".go", tmpl.HandlerSRV}, + {"subscriber/" + alias + ".go", tmpl.SubscriberSRV}, + {"proto/" + alias + "/" + alias + ".proto", tmpl.ProtoSRV}, + {"Dockerfile", tmpl.DockerSRV}, + {"Makefile", tmpl.Makefile}, + {"README.md", tmpl.Readme}, + {".gitignore", tmpl.GitIgnore}, } case "api": // create api config - c = config{ - Alias: alias, - Command: command, - Namespace: namespace, - Type: atype, - FQDN: fqdn, - Dir: dir, - GoDir: goDir, - GoPath: goPath, - UseGoPath: useGoPath, - Plugins: plugins, - Files: []file{ - {"main.go", tmpl.MainAPI}, - {"generate.go", tmpl.GenerateFile}, - {"plugin.go", tmpl.Plugin}, - {"client/" + alias + ".go", tmpl.WrapperAPI}, - {"handler/" + alias + ".go", tmpl.HandlerAPI}, - {"proto/" + alias + "/" + alias + ".proto", tmpl.ProtoAPI}, - {"Makefile", tmpl.Makefile}, - {"Dockerfile", tmpl.DockerSRV}, - {"README.md", tmpl.Readme}, - {".gitignore", tmpl.GitIgnore}, - }, - Comments: protoComments(goDir, alias), + c.Files = []file{ + {"main.go", tmpl.MainAPI}, + {"generate.go", tmpl.GenerateFile}, + {"plugin.go", tmpl.Plugin}, + {"client/" + alias + ".go", tmpl.WrapperAPI}, + {"handler/" + alias + ".go", tmpl.HandlerAPI}, + {"proto/" + alias + "/" + alias + ".proto", tmpl.ProtoAPI}, + {"Makefile", tmpl.Makefile}, + {"Dockerfile", tmpl.DockerSRV}, + {"README.md", tmpl.Readme}, + {".gitignore", tmpl.GitIgnore}, } case "web": // create service config - c = config{ - Alias: alias, - Command: command, - Namespace: namespace, - Type: atype, - FQDN: fqdn, - Dir: dir, - GoDir: goDir, - GoPath: goPath, - UseGoPath: useGoPath, - Plugins: plugins, - Files: []file{ - {"main.go", tmpl.MainWEB}, - {"plugin.go", tmpl.Plugin}, - {"handler/handler.go", tmpl.HandlerWEB}, - {"html/index.html", tmpl.HTMLWEB}, - {"Dockerfile", tmpl.DockerWEB}, - {"Makefile", tmpl.Makefile}, - {"README.md", tmpl.Readme}, - {".gitignore", tmpl.GitIgnore}, - }, - Comments: []string{}, + c.Files = []file{ + {"main.go", tmpl.MainWEB}, + {"plugin.go", tmpl.Plugin}, + {"handler/handler.go", tmpl.HandlerWEB}, + {"html/index.html", tmpl.HTMLWEB}, + {"Dockerfile", tmpl.DockerWEB}, + {"Makefile", tmpl.Makefile}, + {"README.md", tmpl.Readme}, + {".gitignore", tmpl.GitIgnore}, } + c.Comments = []string{} + default: fmt.Println("Unknown type", atype) return @@ -368,6 +382,7 @@ func Run(ctx *cli.Context) { fmt.Println(err) return } + } func Commands() []*cli.Command { diff --git a/go.sum b/go.sum index ac3abd50dc4..e02d646b954 100644 --- a/go.sum +++ b/go.sum @@ -29,9 +29,7 @@ github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvd 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.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7-0.20191101173118-65519b62243c/go.mod h1:7xhjOwRV2+0HXGmM0jxaEu+ZiXJFoVZOTfL/dmqbrD8= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:iGLljf5n9GjT6kc0HBvyI1nOKnGQbNB66VzSNbK5iks= @@ -55,7 +53,6 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aws/aws-sdk-go v1.23.0 h1:ilfJN/vJtFo1XDFxB2YMBYGeOvGZl6Qow17oyD4+Z9A= 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/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= 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 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -67,14 +64,10 @@ github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4Yn github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/bwmarrin/discordgo v0.19.0/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= -github.com/bwmarrin/discordgo v0.20.1/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= github.com/bwmarrin/discordgo v0.20.2 h1:nA7jiTtqUA9lT93WL2jPjUp8ZTEInRujBdx1C9gkr20= github.com/bwmarrin/discordgo v0.20.2/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= github.com/caddyserver/certmagic v0.10.6 h1:sCya6FmfaN74oZE46kqfaFOVoROD/mF36rTQfjN7TZc= github.com/caddyserver/certmagic v0.10.6/go.mod h1:Y8jcUBctgk/IhpAzlHKfimZNyXCkfGgRTC0orl8gROQ= -github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c= -github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v4 v4.0.0 h1:6VeaLF9aI+MAUQ95106HwWzYZgJJpZ4stumjj6RFYAU= 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= @@ -96,7 +89,6 @@ github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqh 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-20181203112020-004b46473808/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= 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= @@ -106,7 +98,6 @@ github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkE github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY= github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.17+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= 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.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -121,12 +112,10 @@ github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMEl 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.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= 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 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decker502/dnspod-go v0.2.0/go.mod h1:qsurYu1FgxcDwfSwXJdLt4kRsBLZeosEb9uq4Sy+08g= 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/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= @@ -134,7 +123,6 @@ github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQ 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.20190710153559-aa8249ae1b8b/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= 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= @@ -146,7 +134,6 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP 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.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 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 h1:dKTrUeykyQwKb/kx7Z+4ukDs6l+4L41HqG1XHnhX7WE= @@ -159,13 +146,11 @@ github.com/forestgiant/sliceutil v0.0.0-20160425183142-94783f95db6c h1:pBgVXWDXj 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.4.4/go.mod h1:PrwszSL5fbmsESocROrOGq/NULMXRw+bajY0ltzD6MA= 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 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-acme/lego/v3 v3.1.0/go.mod h1:074uqt+JS6plx+c9Xaiz6+L+GBb+7itGtzfcDM2AhEE= github.com/go-acme/lego/v3 v3.4.0 h1:deB9NkelA+TfjGHVw8J7iKl/rMtffcGMWSMmptvMv0A= 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= @@ -176,19 +161,13 @@ github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agR 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 h1:q+IFMfLx200Q3scvt2hN79JsEzy4AmBTp/pqnefH+Bc= 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.0.0 h1:k5RWPm4iJwYtfWoxIJy4wJX9ON7ihPeZZYC1fLYDnpg= -github.com/go-git/go-git/v5 v5.0.0/go.mod h1:oYD8y9kWsGINPFJoLdaScGCN6dlKg23blmClfZwtUVA= 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-log/log v0.1.0/go.mod h1:4mBwpdRMFLiuXZDCwU2lKQFsoSCo72j3HqBK9d81N2M= 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-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= 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 h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU= github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= @@ -208,7 +187,6 @@ github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptG github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191002201903-404acd9df4cc/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -280,9 +258,6 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T 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/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd/go.mod h1:3LVOLeyx9XVvwPgrt2be44XgSqndprz1G18rSk8KD84= -github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= 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= @@ -293,11 +268,9 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5i github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1/go.mod h1:DFXrEwSRX0p/aSvxE21319menCBFeQO0jXpRj7LEZUA= 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.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= 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= @@ -308,7 +281,6 @@ github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v 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.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.3 h1:CCtW0xUnWGVINKvE/WWOYKdsPV6mawAtvQuSl8guwQs= 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= @@ -319,21 +291,15 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 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/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/linode/linodego v0.10.0/go.mod h1:cziNP7pbvE3mXIPneHj0oRY8L1WtGEIKlZ8LANE4eXA= github.com/liquidweb/liquidweb-go v1.6.0/go.mod h1:UDcVnAMDkZxpw4Y7NOHkqoeiGacVLEIG/i5J9cyixzQ= -github.com/lucas-clemente/quic-go v0.12.1/go.mod h1:UXJJPE4RfFef/xPO5wQm0tITK8gNfqwTxjbE7s3Vb8s= -github.com/lucas-clemente/quic-go v0.13.1/go.mod h1:Vn3/Fb0/77b02SGhQk36KzOUmXgVpFfizUfW5WMaqyU= github.com/lucas-clemente/quic-go v0.14.1 h1:c1aKoBZKOPA+49q96B1wGkibyPP0AxYh45WuAoq+87E= github.com/lucas-clemente/quic-go v0.14.1/go.mod h1:Vn3/Fb0/77b02SGhQk36KzOUmXgVpFfizUfW5WMaqyU= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= @@ -341,7 +307,6 @@ github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/marten-seemann/chacha20 v0.2.0 h1:f40vqzzx+3GdOmzQoItkLX5WLvHgPgyYqFFIO5Gh4hQ= github.com/marten-seemann/chacha20 v0.2.0/go.mod h1:HSdjFau7GzYRj+ahFNwsO3ouVJr1HFkWoEwNDb4TMtE= github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= -github.com/marten-seemann/qtls v0.3.2/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= github.com/marten-seemann/qtls v0.4.1 h1:YlT8QP3WCCvvok7MGEZkMldXbyqgr8oFg5/n8Gtbkks= github.com/marten-seemann/qtls v0.4.1/go.mod h1:pxVXcHHw1pNIt8Qo0pwSYQEoZ8yYOOPXTCZLQQunvRc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -355,17 +320,8 @@ github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mholt/certmagic v0.7.5/go.mod h1:91uJzK5K8IWtYQqTi5R2tsxV1pCde+wdGfaRaOZi6aQ= -github.com/mholt/certmagic v0.8.3/go.mod h1:91uJzK5K8IWtYQqTi5R2tsxV1pCde+wdGfaRaOZi6aQ= -github.com/micro/cli v0.2.0 h1:ut3rV5JWqZjsXIa2MvGF+qMUP8DAUTvHX9Br5gO4afA= -github.com/micro/cli v0.2.0/go.mod h1:jRT9gmfVKWSS6pkKcXQ8YhUyj6bzwxK8Fp5b0Y7qNnk= 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.16.0/go.mod h1:A0F58bHLh2m0LAI9QyhvmbN8c1cxhAZo3cM6s+iDsrM= -github.com/micro/go-micro v1.18.0 h1:gP70EZVHpJuUIT0YWth192JmlIci+qMOEByHm83XE9E= -github.com/micro/go-micro v1.18.0/go.mod h1:klwUJL1gkdY1MHFyz+fFJXn52dKcty4hoe95Mp571AA= -github.com/micro/go-micro/v2 v2.7.1-0.20200527112433-192f548c8304 h1:i1lF68DEucSAPGi7DPMTaxgwzj6aj2g4hwrYDKJ5Jow= -github.com/micro/go-micro/v2 v2.7.1-0.20200527112433-192f548c8304/go.mod h1:bImBPfyXthPdQeVSik9sACGUxuxDE7jY8g5K7xZZV4c= 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= @@ -374,7 +330,6 @@ github.com/micro/mdns v0.3.0/go.mod h1:KJ0dW7KmicXU2BV++qkLlmHYcVv7/hHnbtguSWt9A 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/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.22/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= 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= @@ -393,18 +348,12 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb 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.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= 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.0/go.mod h1:r5y0WgCag0dTj/qiHkHrXAcKQ/f5GMOZaEGdoxxnJ4I= github.com/nats-io/nats-server/v2 v2.1.6 h1:qAaHZaS8pRRNQLFaiBA1rq5WynyEGp9DFgmMfoaiXGY= github.com/nats-io/nats-server/v2 v2.1.6/go.mod h1:BL1NOtaBQ5/y97djERRVWNouMW7GT3gxnmbE/eC8u8A= -github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= 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.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= 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= @@ -415,7 +364,6 @@ github.com/netdata/go-orchestrator v0.0.0-20190905093727-c793edba0e8f h1:jSzujNr github.com/netdata/go-orchestrator v0.0.0-20190905093727-c793edba0e8f/go.mod h1:ECF8anFVCt/TfTIWVPgPrNaYJXtAtpAOF62ugDbw41A= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nlopes/slack v0.6.0/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk= github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249 h1:Pr5gZa2VcmktVwq0lyC39MsN5tz356vC/pQHKvq+QBo= 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= @@ -447,7 +395,6 @@ github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgF 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/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -492,7 +439,6 @@ github.com/sacloud/libsacloud v1.26.1/go.mod h1:79ZwATmHLIFZIMd7sxA3LwzVy/B77uj3 github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 h1:ofR1ZdrNSkiWcMsRrubK9tb2/SlZVWttAfqUjJi6QYc= github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= @@ -520,10 +466,8 @@ github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.6.3 h1:pDDu1OyEDTKzpJwdq4TiuLyMsUgRa/BT5cn5O62NoHs= github.com/spf13/viper v1.6.3/go.mod h1:jUMtyi0/lB5yZH/FjyGAoH7IMNrIhlBf6pXZmbMDvzw= -github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= 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 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= @@ -555,7 +499,6 @@ github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca h1:1CFlNzQhALwjS9mB github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -567,35 +510,27 @@ 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.2.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 h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= 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.12.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= 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-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/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-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= 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-20191108234033-bd318be0434a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 h1:3zb4D3T4G8jdExgVU/95+vQXfpEPiMdCaZgmGVxjNHM= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -643,9 +578,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL 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-20191011234655-491137f69257/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-20191109021931-daa7c04131f5/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -669,12 +602,10 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/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= @@ -684,17 +615,15 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w 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-20190710143415-6ec70d6a5542/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-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4/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 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= 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= @@ -722,9 +651,7 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn 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-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/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= @@ -757,7 +684,6 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn 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-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -768,8 +694,6 @@ google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= 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= @@ -790,8 +714,6 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 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/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= 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= @@ -802,9 +724,6 @@ 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 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98= -gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= -gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8= gopkg.in/telegram-bot-api.v4 v4.6.4 h1:hpHWhzn4jTCsAJZZ2loNKfy2QWyPDRJVl3aTFXeMW8g= 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= diff --git a/internal/template/makefile.go b/internal/template/makefile.go index cc9993d4aa7..6acb9d92cde 100644 --- a/internal/template/makefile.go +++ b/internal/template/makefile.go @@ -3,7 +3,7 @@ package template var ( Makefile = ` GOPATH:=$(shell go env GOPATH) -MODIFY=Mgithub.com/micro/go-micro/api/proto/api.proto=github.com/micro/go-micro/v2/api/proto +MODIFY=Mproto/imports/api.proto=github.com/micro/go-micro/v2/api/proto {{if ne .Type "web"}} .PHONY: proto proto: diff --git a/internal/template/proto.go b/internal/template/proto.go index bff393ec536..df3d54678ed 100644 --- a/internal/template/proto.go +++ b/internal/template/proto.go @@ -67,7 +67,7 @@ message Pong { package {{.FQDN}}; -import "github.com/micro/go-micro/api/proto/api.proto"; +import "proto/imports/api.proto"; service {{title .Alias}} { rpc Call(go.api.Request) returns (go.api.Response) {} diff --git a/test/runtime_test.go b/test/runtime_test.go index 73e4187e6e5..656339ff156 100644 --- a/test/runtime_test.go +++ b/test/runtime_test.go @@ -45,12 +45,13 @@ func testNew(t *t) { return } } - if strings.HasPrefix(line, "protoc") { - parts := strings.Split(line, " ") - protocCmd := exec.Command(parts[0], parts[1:]...) + if strings.HasPrefix(line, "make proto") { + mp := strings.Split(line, " ") + protocCmd := exec.Command(mp[0], mp[1:]...) protocCmd.Dir = "./foobar" pOutp, pErr := protocCmd.CombinedOutput() if pErr != nil { + t.Log("That didn't work ", pErr) t.Fatal(string(pOutp)) return } From 3e5a7ec42e3df7cd0e1a85f88a901220beb1ae58 Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Thu, 4 Jun 2020 17:15:42 +0100 Subject: [PATCH 02/47] fix nil pointer on notify (#918) --- go.mod | 1 + go.sum | 1 + internal/platform/platform.go | 10 +++-- internal/platform/platform_test.go | 67 ++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 internal/platform/platform_test.go diff --git a/go.mod b/go.mod index a7129a2e8c6..72df6c1e23e 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 github.com/spf13/viper v1.6.3 + github.com/stretchr/testify v1.4.0 github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 diff --git a/go.sum b/go.sum index e02d646b954..020bfbd17d4 100644 --- a/go.sum +++ b/go.sum @@ -472,6 +472,7 @@ 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/platform/platform.go b/internal/platform/platform.go index 21ec8dc1d87..bc11d3b34ce 100644 --- a/internal/platform/platform.go +++ b/internal/platform/platform.go @@ -62,14 +62,18 @@ func (i *initScheduler) Notify() (<-chan gorun.Event, error) { for ev := range ch { // fire an event per service for _, service := range i.services { - evChan <- gorun.Event{ + newEv := gorun.Event{ Service: &gorun.Service{ - Name: service, - Version: ev.Service.Version, + Name: service, }, Timestamp: ev.Timestamp, Type: ev.Type, } + // Some updates don't come with version, e.g. filesystem watcher or the update notifier + if ev.Service != nil { + newEv.Service.Version = ev.Service.Version + } + evChan <- newEv // slow roll the change time.Sleep(time.Second) } diff --git a/internal/platform/platform_test.go b/internal/platform/platform_test.go new file mode 100644 index 00000000000..26f5b346cc7 --- /dev/null +++ b/internal/platform/platform_test.go @@ -0,0 +1,67 @@ +package platform + +import ( + "testing" + "time" + + gorun "github.com/micro/go-micro/v2/runtime" + + "github.com/stretchr/testify/assert" +) + +type mockScheduler struct { + ch chan gorun.Event +} + +func (s *mockScheduler) Notify() (<-chan gorun.Event, error) { + return s.ch, nil +} + +func (s *mockScheduler) Close() error { + return nil +} + +func TestNilOnNotify(t *testing.T) { + msch := &mockScheduler{ch: make(chan gorun.Event, 32)} + is := initScheduler{Scheduler: msch, services: Services} + + ch, err := is.Notify() + assert.NoError(t, err) + msch.ch <- gorun.Event{ + Type: gorun.Update, + Timestamp: time.Now(), + } + multiple := len(Services) * 2 + tick := time.NewTicker(time.Duration(multiple) * time.Second) + defer tick.Stop() + for i := 0; i < len(Services); i++ { + select { + case ev := <-ch: + assert.NotNil(t, ev.Timestamp, "Event timestamp should not be nil") + case <-tick.C: + assert.FailNow(t, "Failed to get enough events") + } + } + + msch.ch <- gorun.Event{ + Type: gorun.Update, + Timestamp: time.Now(), + Service: &gorun.Service{ + Name: "foobar", + Version: "123", + }, + } + multiple = len(Services) * 2 + tick = time.NewTicker(time.Duration(multiple) * time.Second) + defer tick.Stop() + for i := 0; i < len(Services); i++ { + select { + case ev := <-ch: + assert.NotNil(t, ev.Timestamp, "Event timestamp should not be nil") + assert.Equal(t, ev.Service.Version, "123") + case <-tick.C: + assert.FailNow(t, "Failed to get enough events") + } + } + +} From 132347b502fc83962c4d85beb2ec575e4caed63c Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Mon, 8 Jun 2020 14:00:28 +0100 Subject: [PATCH 03/47] Stop overwriting status of service with "starting" (#924) --- service/runtime/manager/events.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/service/runtime/manager/events.go b/service/runtime/manager/events.go index d3802783da3..324aa7bb485 100644 --- a/service/runtime/manager/events.go +++ b/service/runtime/manager/events.go @@ -100,7 +100,7 @@ func (m *manager) processEvent(key string) { } // log the event - logger.Infof("Procesing %v event for service %v:%v in namespace %v", ev.Type, ev.Service.Name, ev.Service.Version, ns) + logger.Infof("Processing %v event for service %v:%v in namespace %v", ev.Type, ev.Service.Name, ev.Service.Version, ns) // apply the event to the managed runtime switch ev.Type { @@ -121,11 +121,10 @@ func (m *manager) processEvent(key string) { // if there was an error update the status in the cache if err != nil { - logger.Warnf("Error procesing %v event for service %v:%v in namespace %v: %v,", ev.Type, ev.Service.Name, ev.Service.Version, ns, err) + logger.Warnf("Error processing %v event for service %v:%v in namespace %v: %v", ev.Type, ev.Service.Name, ev.Service.Version, ns, err) ev.Service.Metadata = map[string]string{"status": "error", "error": err.Error()} m.cacheStatus(ns, ev.Service) } else if ev.Type != runtime.Delete { - ev.Service.Metadata = map[string]string{"status": "starting"} m.cacheStatus(ns, ev.Service) } From 69d85ca74e9e21dd09da2dbf4d6bc4088615b884 Mon Sep 17 00:00:00 2001 From: Janos Dobronszki Date: Mon, 8 Jun 2020 16:42:36 +0200 Subject: [PATCH 04/47] Bump go micro version (#925) Co-authored-by: Asim Aslam --- go.mod | 2 +- test/test_framework.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 72df6c1e23e..1aa9d902d15 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.8.1-0.20200603084508-7b379bf1f16e + github.com/micro/go-micro/v2 v2.8.1-0.20200608094725-47bdd5c99383 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/test/test_framework.go b/test/test_framework.go index 748b77c4dcf..069ba4d26c7 100644 --- a/test/test_framework.go +++ b/test/test_framework.go @@ -160,6 +160,7 @@ func (s server) launch() { !strings.Contains(string(outp), "config") || !strings.Contains(string(outp), "debug") || !strings.Contains(string(outp), "proxy") || + !strings.Contains(string(outp), "auth") || !strings.Contains(string(outp), "store") { return outp, errors.New("Not ready") } From 29bac7e7c231854c74015c46b2c9316a45aa6c27 Mon Sep 17 00:00:00 2001 From: Janos Dobronszki Date: Tue, 9 Jun 2020 13:01:35 +0200 Subject: [PATCH 05/47] Test and config cli fixes (#930) --- go.mod | 2 +- go.sum | 3 +++ scripts/run-etcd.sh | 1 + service/config/config.go | 3 ++- service/config/handler/handler.go | 5 ++++- test/config_test.go | 2 +- test/test_framework.go | 2 +- 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 1aa9d902d15..16fa5847b88 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.8.1-0.20200608094725-47bdd5c99383 + github.com/micro/go-micro/v2 v2.8.1-0.20200609104731-cdd8f9fd82c5 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 020bfbd17d4..6155ee5bbfe 100644 --- a/go.sum +++ b/go.sum @@ -326,6 +326,9 @@ github.com/micro/go-micro/v2 v2.8.0 h1:WKogg6xqJmk3CjTFscrzSKN1fSGtince4sWfaqx98 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/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= diff --git a/scripts/run-etcd.sh b/scripts/run-etcd.sh index b2a68db6afc..a3f217475ae 100755 --- a/scripts/run-etcd.sh +++ b/scripts/run-etcd.sh @@ -5,4 +5,5 @@ ETCD_CMD="/bin/etcd -data-dir=/data" echo -e "Running '$ETCD_CMD'\nBEGIN ETCD OUTPUT\n" exec $ETCD_CMD & +sleep 4 /micro $* diff --git a/service/config/config.go b/service/config/config.go index 3f2adb581e9..025b29175e1 100644 --- a/service/config/config.go +++ b/service/config/config.go @@ -115,8 +115,9 @@ func getConfig(ctx *cli.Context) error { // The actual key for the val Path: key, }) + if err != nil { - if strings.Contains(err.Error(), "not found") { + if strings.Contains(strings.ToLower(err.Error()), "not found") { fmt.Println("not found") os.Exit(1) } diff --git a/service/config/handler/handler.go b/service/config/handler/handler.go index 47330269d89..46b482c4901 100644 --- a/service/config/handler/handler.go +++ b/service/config/handler/handler.go @@ -273,7 +273,10 @@ func (c *Config) Delete(ctx context.Context, req *pb.DeleteRequest, rsp *pb.Dele // Get the current change set records, err := c.Store.Read(namespace) if err != nil { - return errors.BadRequest("go.micro.config.Update", "read old value error: %v", err) + if err.Error() != "not found" { + return errors.BadRequest("go.micro.srv.Delete", "read old value error: %v", err) + } + return nil } ch := &pb.Change{} diff --git a/test/config_test.go b/test/config_test.go index 5402e2e4594..1cfe6c4ac9a 100644 --- a/test/config_test.go +++ b/test/config_test.go @@ -14,7 +14,7 @@ import ( ) func TestConfig(t *testing.T) { - trySuite(t, testConfig, 5) + trySuite(t, testConfig, retryCount) } func testConfig(t *t) { diff --git a/test/test_framework.go b/test/test_framework.go index 069ba4d26c7..eefcdb7a03c 100644 --- a/test/test_framework.go +++ b/test/test_framework.go @@ -14,7 +14,7 @@ import ( ) const ( - retryCount = 2 + retryCount = 1 isParallel = true ) From f7df432b7c9967ad0f42c5a47ab81d7c789147c3 Mon Sep 17 00:00:00 2001 From: Janos Dobronszki Date: Tue, 9 Jun 2020 14:41:19 +0200 Subject: [PATCH 06/47] Do not set namespace for non server and platform envs (#931) --- internal/client/client.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/client/client.go b/internal/client/client.go index fa2513bf31e..483d88c21c0 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -2,7 +2,6 @@ package client import ( "context" - "strings" ccli "github.com/micro/cli/v2" "github.com/micro/go-micro/v2/auth" @@ -34,8 +33,15 @@ func (a *wrapper) Call(ctx context.Context, req client.Request, rsp interface{}, ctx = metadata.Set(ctx, "Authorization", auth.BearerScheme+a.token) } if len(a.env) > 0 && !util.IsLocal(a.ctx) && !util.IsServer(a.ctx) { - env := strings.ReplaceAll(a.env, "/", "-") - ctx = metadata.Set(ctx, "Micro-Namespace", env) + // @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) } return a.Client.Call(ctx, req, rsp, opts...) } From 7e82fcb1f8eda0298612445e51eebc9bb676b616 Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Tue, 9 Jun 2020 15:50:51 +0100 Subject: [PATCH 07/47] Show help if subcommand is not recognised rather than run the core service (#933) * Show help if subcommand is not recognised rather than run the server --- internal/helper/helper.go | 11 +++++++++++ service/auth/auth.go | 9 ++++----- service/config/config.go | 4 ++++ service/network/network.go | 11 ++++++----- service/registry/registry.go | 18 ++++-------------- service/store/store.go | 6 +++++- 6 files changed, 34 insertions(+), 25 deletions(-) diff --git a/internal/helper/helper.go b/internal/helper/helper.go index a04250845a4..445f21a71d9 100644 --- a/internal/helper/helper.go +++ b/internal/helper/helper.go @@ -5,6 +5,7 @@ import ( "crypto/tls" "crypto/x509" "errors" + "fmt" "io/ioutil" "net/http" "strings" @@ -67,3 +68,13 @@ func TLSConfig(ctx *cli.Context) (*tls.Config, error) { return nil, errors.New("TLS certificate and key files not specified") } + +// UnexpectedSubcommand checks for erroneous subcommands and prints help and returns error +func UnexpectedSubcommand(ctx *cli.Context) error { + if first := ctx.Args().First(); first != "" { + // received something that isn't a subcommand + cli.ShowSubcommandHelp(ctx) + return fmt.Errorf("Unrecognized subcommand %s", first) + } + return nil +} diff --git a/service/auth/auth.go b/service/auth/auth.go index 77033d4a1c0..1f285d88209 100644 --- a/service/auth/auth.go +++ b/service/auth/auth.go @@ -19,6 +19,7 @@ import ( cliutil "github.com/micro/micro/v2/client/cli/util" "github.com/micro/micro/v2/internal/client" "github.com/micro/micro/v2/internal/config" + "github.com/micro/micro/v2/internal/helper" "github.com/micro/micro/v2/service/auth/api" authHandler "github.com/micro/micro/v2/service/auth/handler/auth" rulesHandler "github.com/micro/micro/v2/service/auth/handler/rules" @@ -90,11 +91,6 @@ var ( func Run(ctx *cli.Context, srvOpts ...micro.Option) { log.Init(log.WithFields(map[string]interface{}{"service": "auth"})) - // Init plugins - for _, p := range Plugins() { - p.Init(ctx) - } - if len(ctx.String("address")) > 0 { Address = ctx.String("address") } @@ -229,6 +225,9 @@ func Commands(srvOpts ...micro.Option) []*cli.Command { Name: "auth", Usage: "Run the auth service", Action: func(ctx *cli.Context) error { + if err := helper.UnexpectedSubcommand(ctx); err != nil { + return err + } Run(ctx) return nil }, diff --git a/service/config/config.go b/service/config/config.go index 025b29175e1..2dd9890e79d 100644 --- a/service/config/config.go +++ b/service/config/config.go @@ -13,6 +13,7 @@ import ( proto "github.com/micro/go-micro/v2/config/source/service/proto" log "github.com/micro/go-micro/v2/logger" "github.com/micro/micro/v2/internal/client" + "github.com/micro/micro/v2/internal/helper" "github.com/micro/micro/v2/service/config/handler" ) @@ -199,6 +200,9 @@ func Commands(options ...micro.Option) []*cli.Command { }, }, Action: func(ctx *cli.Context) error { + if err := helper.UnexpectedSubcommand(ctx); err != nil { + return err + } Run(ctx, options...) return nil }, diff --git a/service/network/network.go b/service/network/network.go index 28dab143c16..3f4c92e9774 100644 --- a/service/network/network.go +++ b/service/network/network.go @@ -50,11 +50,6 @@ var ( func Run(ctx *cli.Context, srvOpts ...micro.Option) { log.Init(log.WithFields(map[string]interface{}{"service": "network"})) - if ctx.Args().Len() > 0 { - cli.ShowSubcommandHelp(ctx) - os.Exit(1) - } - // Init plugins for _, p := range Plugins() { p.Init(ctx) @@ -307,6 +302,9 @@ func Commands(options ...micro.Option) []*cli.Command { }, }, Action: func(ctx *cli.Context) error { + if err := helper.UnexpectedSubcommand(ctx); err != nil { + return err + } netdns.Run(ctx) return nil }, @@ -314,6 +312,9 @@ func Commands(options ...micro.Option) []*cli.Command { }, }, mcli.NetworkCommands()...), Action: func(ctx *cli.Context) error { + if err := helper.UnexpectedSubcommand(ctx); err != nil { + return err + } Run(ctx, options...) return nil }, diff --git a/service/registry/registry.go b/service/registry/registry.go index 749633ddb6b..388cbb8447b 100644 --- a/service/registry/registry.go +++ b/service/registry/registry.go @@ -12,6 +12,7 @@ import ( "github.com/micro/go-micro/v2/registry/service" pb "github.com/micro/go-micro/v2/registry/service/proto" rcli "github.com/micro/micro/v2/client/cli" + "github.com/micro/micro/v2/internal/helper" "github.com/micro/micro/v2/service/registry/handler" ) @@ -111,20 +112,6 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { // get server id id := service.Server().Options().Id - /* - // create the subscriber - s := &subscriber{ - Id: id, - Registry: service.Options().Registry, - } - - // register the subscriber - if err := micro.RegisterSubscriber(Topic, service.Server(), s); err != nil { - log.Debugf("failed to subscribe to events: %s", err) - os.Exit(1) - } - */ - // register the handler pb.RegisterRegistryHandler(service.Server(), &handler.Registry{ Id: id, @@ -151,6 +138,9 @@ func Commands(options ...micro.Option) []*cli.Command { }, }, Action: func(ctx *cli.Context) error { + if err := helper.UnexpectedSubcommand(ctx); err != nil { + return err + } Run(ctx, options...) return nil }, diff --git a/service/store/store.go b/service/store/store.go index a00b651f715..08d7bef2731 100644 --- a/service/store/store.go +++ b/service/store/store.go @@ -7,6 +7,7 @@ import ( "github.com/micro/go-micro/v2/store" pb "github.com/micro/go-micro/v2/store/service/proto" mcli "github.com/micro/micro/v2/client/cli" + "github.com/micro/micro/v2/internal/helper" "github.com/micro/micro/v2/service/store/handler" "github.com/pkg/errors" ) @@ -18,7 +19,7 @@ var ( Address = ":8002" ) -// run runs the micro server +// Run runs the micro server func Run(ctx *cli.Context, srvOpts ...micro.Option) { log.Init(log.WithFields(map[string]interface{}{"service": "store"})) @@ -100,6 +101,9 @@ func Commands(options ...micro.Option) []*cli.Command { }, }, Action: func(ctx *cli.Context) error { + if err := helper.UnexpectedSubcommand(ctx); err != nil { + return err + } Run(ctx, options...) return nil }, From 9184315bb41849b6536afb29af62a950e1c3b50c Mon Sep 17 00:00:00 2001 From: Janos Dobronszki Date: Tue, 9 Jun 2020 17:19:55 +0200 Subject: [PATCH 08/47] More test fixes - integration tests now pass (#932) --- test/config-example-service/go.mod | 2 +- test/config_test.go | 2 +- test/example-service/go.mod | 2 +- test/runtime_test.go | 21 ++++++++------------- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/test/config-example-service/go.mod b/test/config-example-service/go.mod index e5ed8c6e8a2..6b9c2f6276f 100644 --- a/test/config-example-service/go.mod +++ b/test/config-example-service/go.mod @@ -2,4 +2,4 @@ module exampl go 1.13 -require github.com/micro/go-micro/v2 v2.8.0 // indirect +require github.com/micro/go-micro/v2 v2.8.1-0.20200609104731-cdd8f9fd82c5 // indirect diff --git a/test/config_test.go b/test/config_test.go index 1cfe6c4ac9a..326e1d4d887 100644 --- a/test/config_test.go +++ b/test/config_test.go @@ -146,7 +146,7 @@ func testConfigReadFromService(t *t) { // This needs to be retried to the the "error listing rules" // error log output that happens when the auth service is not yet available. try("Calling micro config set", t, func() ([]byte, error) { - setCmd := exec.Command("micro", serv.envFlag(), "config", "set", "key", "subkey", "val1") + setCmd := exec.Command("micro", serv.envFlag(), "config", "set", "key.subkey", "val1") outp, err := setCmd.CombinedOutput() if err != nil { return outp, err diff --git a/test/example-service/go.mod b/test/example-service/go.mod index 354a058ac79..62231ed1f93 100644 --- a/test/example-service/go.mod +++ b/test/example-service/go.mod @@ -4,5 +4,5 @@ go 1.13 require ( github.com/golang/protobuf v1.4.1 - github.com/micro/go-micro/v2 v2.7.1-0.20200527081416-e2d662608c1d + github.com/micro/go-micro/v2 v2.8.1-0.20200609104731-cdd8f9fd82c5 ) diff --git a/test/runtime_test.go b/test/runtime_test.go index 656339ff156..68dd501d0a7 100644 --- a/test/runtime_test.go +++ b/test/runtime_test.go @@ -139,7 +139,7 @@ func testRunLocalSource(t *t) { } func TestRunAndKill(t *testing.T) { - trySuite(t, testRunLocalSource, retryCount) + trySuite(t, testRunAndKill, retryCount) } func testRunAndKill(t *t) { @@ -181,16 +181,11 @@ func testRunAndKill(t *t) { return outp, err }, 50*time.Second) - try("Kill the example service ", t, func() ([]byte, error) { - outp, err := exec.Command("micro", serv.envFlag(), "kill", "test/example-service").CombinedOutput() - if err != nil { - return outp, err - } - if !strings.Contains(string(outp), "go.micro.service.example") { - return outp, errors.New("Can't find example service in list") - } - return outp, err - }, 50*time.Second) + outp, err = exec.Command("micro", serv.envFlag(), "kill", "test/example-service").CombinedOutput() + if err != nil { + t.Fatalf("micro kill failure, output: %v", string(outp)) + return + } try("Find test/example", t, func() ([]byte, error) { psCmd := exec.Command("micro", serv.envFlag(), "status") @@ -337,14 +332,14 @@ func testRunGithubSource(t *t) { return } if len(p) == 0 { - t.Fatalf("Git is not available %v", p) + t.Fatal("Git is not available") return } serv := newServer(t) serv.launch() defer serv.close() - runCmd := exec.Command("micro", serv.envFlag(), "run", "helloworld") + runCmd := exec.Command("micro", serv.envFlag(), "run", "github.com/micro/examples/helloworld") outp, err := runCmd.CombinedOutput() if err != nil { t.Fatalf("micro run failure, output: %v", string(outp)) From 6bfcf49b9ca9c2fdc412bc6ae187e7e1d7bc1df6 Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Wed, 10 Jun 2020 09:36:55 +0100 Subject: [PATCH 09/47] Upload should check we have a main package (#934) * Upload should check we have a main package. * prepend path to file --- service/runtime/service.go | 41 ++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/service/runtime/service.go b/service/runtime/service.go index 7ce0b359d67..0d397642dfa 100644 --- a/service/runtime/service.go +++ b/service/runtime/service.go @@ -4,6 +4,7 @@ package runtime import ( "encoding/json" "fmt" + "io/ioutil" "os" "os/signal" "path/filepath" @@ -105,7 +106,11 @@ func runService(ctx *cli.Context, srvOpts ...micro.Option) { } var newSource string if source.Local { - newSource = upload(ctx, source) + newSource, err = upload(ctx, source) + if err != nil { + fmt.Println(err) + os.Exit(1) + } } typ := ctx.String("type") @@ -214,7 +219,31 @@ func killService(ctx *cli.Context, srvOpts ...micro.Option) { } } -func upload(ctx *cli.Context, source *git.Source) string { +func grepMain(path string) error { + files, err := ioutil.ReadDir(path) + if err != nil { + return err + } + for _, f := range files { + if !strings.HasSuffix(f.Name(), ".go") { + continue + } + file := filepath.Join(path, f.Name()) + b, err := ioutil.ReadFile(file) + if err != nil { + continue + } + if strings.Contains(string(b), "package main") { + return nil + } + } + return fmt.Errorf("Directory does not contain a main package") +} + +func upload(ctx *cli.Context, source *git.Source) (string, error) { + if err := grepMain(source.FullPath); err != nil { + return "", err + } uploadedFileName := strings.ReplaceAll(source.Folder, string(filepath.Separator), "-") + ".tar.gz" path := filepath.Join(os.TempDir(), uploadedFileName) err := handler.Compress(source.FullPath, path) @@ -227,7 +256,7 @@ func upload(ctx *cli.Context, source *git.Source) string { fmt.Println(err) os.Exit(1) } - return uploadedFileName + return uploadedFileName, nil } func updateService(ctx *cli.Context, srvOpts ...micro.Option) { @@ -249,7 +278,11 @@ func updateService(ctx *cli.Context, srvOpts ...micro.Option) { } var newSource string if source.Local { - newSource = upload(ctx, source) + newSource, err = upload(ctx, source) + if err != nil { + fmt.Println(err) + os.Exit(1) + } } runtimeSource := source.RuntimeSource() From 903cc241da175d0acdc0ed082d8eff822fdec204 Mon Sep 17 00:00:00 2001 From: Janos Dobronszki Date: Wed, 10 Jun 2020 15:02:56 +0200 Subject: [PATCH 10/47] Fixing suboptimal help behaviours (#937) --- client/cli/util/util.go | 3 +- cmd/cmd.go | 13 +++-- internal/helper/helper.go | 20 ++++++- test/misc_test.go | 110 ++++++++++++++++++++++++++++++++++++++ test/runtime_test.go | 52 ------------------ test/test_framework.go | 2 +- 6 files changed, 141 insertions(+), 59 deletions(-) create mode 100644 test/misc_test.go diff --git a/client/cli/util/util.go b/client/cli/util/util.go index f71fb105e2e..4bdeb9f277d 100644 --- a/client/cli/util/util.go +++ b/client/cli/util/util.go @@ -52,7 +52,8 @@ var defaultEnvs = map[string]Env{ } func isBuiltinService(command string) bool { - if command == "server" { + switch command { + case "server", "help": return true } for _, service := range platform.Services { diff --git a/cmd/cmd.go b/cmd/cmd.go index f9e23abdc9c..c13032a18a7 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -38,6 +38,7 @@ import ( // internals inauth "github.com/micro/micro/v2/internal/auth" + "github.com/micro/micro/v2/internal/helper" "github.com/micro/micro/v2/internal/platform" _ "github.com/micro/micro/v2/internal/plugins" "github.com/micro/micro/v2/internal/update" @@ -255,6 +256,10 @@ func setup(app *ccli.App) { util.SetupCommand(ctx) // now do previous before if err := before(ctx); err != nil { + // DO NOT return this error otherwise the action will fail + // and help will be printed. + fmt.Println(err) + os.Exit(1) return err } @@ -369,7 +374,8 @@ func Setup(app *ccli.App, options ...micro.Option) { v, err := exec.LookPath(command) if err != nil { - return ccli.ShowAppHelp(c) + fmt.Println(helper.UnexpectedCommand(c)) + os.Exit(1) } // execute the command @@ -378,8 +384,9 @@ func Setup(app *ccli.App, options ...micro.Option) { ce.Stderr = os.Stderr return ce.Run() } - - return ccli.ShowAppHelp(c) + fmt.Println(helper.MissingCommand(c)) + os.Exit(1) + return nil } setup(app) diff --git a/internal/helper/helper.go b/internal/helper/helper.go index 445f21a71d9..5bc18159fbb 100644 --- a/internal/helper/helper.go +++ b/internal/helper/helper.go @@ -8,6 +8,7 @@ import ( "fmt" "io/ioutil" "net/http" + "os" "strings" "github.com/micro/cli/v2" @@ -73,8 +74,23 @@ 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 - cli.ShowSubcommandHelp(ctx) - return fmt.Errorf("Unrecognized subcommand %s", first) + return fmt.Errorf("Unrecognized subcommand for %s: %s. Please refer to '%s help'", ctx.App.Name, first, ctx.App.Name) } return nil } + +func UnexpectedCommand(ctx *cli.Context) error { + commandName := "" + // We fall back to os.Args as ctx does not seem to have the original command. + for _, arg := range os.Args[1:] { + // Exclude flags + if !strings.HasPrefix(arg, "-") { + commandName = arg + } + } + 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'") +} diff --git a/test/misc_test.go b/test/misc_test.go new file mode 100644 index 00000000000..c84bfdef0cd --- /dev/null +++ b/test/misc_test.go @@ -0,0 +1,110 @@ +// +build integration + +package test + +import ( + "os/exec" + "strings" + "testing" +) + +func TestNew(t *testing.T) { + trySuite(t, testNew, retryCount) +} + +func testNew(t *t) { + t.Parallel() + defer func() { + exec.Command("rm", "-r", "./foobar").CombinedOutput() + }() + outp, err := exec.Command("micro", "new", "foobar").CombinedOutput() + if err != nil { + t.Fatal(err) + return + } + if !strings.Contains(string(outp), "protoc") { + t.Fatalf("micro new lacks protobuf install instructions %v", string(outp)) + return + } + + lines := strings.Split(string(outp), "\n") + // executing install instructions + for _, line := range lines { + if strings.HasPrefix(line, "go get") { + parts := strings.Split(line, " ") + getOutp, getErr := exec.Command(parts[0], parts[1:]...).CombinedOutput() + if getErr != nil { + t.Fatal(string(getOutp)) + return + } + } + if strings.HasPrefix(line, "make proto") { + mp := strings.Split(line, " ") + protocCmd := exec.Command(mp[0], mp[1:]...) + protocCmd.Dir = "./foobar" + pOutp, pErr := protocCmd.CombinedOutput() + if pErr != nil { + t.Log("That didn't work ", pErr) + t.Fatal(string(pOutp)) + return + } + } + } + + buildCommand := exec.Command("go", "build") + buildCommand.Dir = "./foobar" + outp, err = buildCommand.CombinedOutput() + if err != nil { + t.Fatal(string(outp)) + return + } +} + +func TestWrongCommands(t *testing.T) { + trySuite(t, testWrongCommands, retryCount) +} + +func testWrongCommands(t *t) { + // @TODO this is obviously bad that we have to start a server for this. Why? + // What happens is in `cmd/cmd.go` `/service/store/cli/util.go`.SetupCommand is called + // which does not run for builtin services and help etc but there is no such exception for + // missing/unrecognized commands, so the behaviour below will only happen if a `micro server` + // is running. This is most likely because some config/auth wrapper in the background failing. + // Fix this later. + serv := newServer(t) + serv.launch() + defer serv.close() + + t.Parallel() + + comm := exec.Command("micro", serv.envFlag()) + outp, err := comm.CombinedOutput() + if err == nil { + t.Fatal("Missing command should error") + } + + if !strings.Contains(string(outp), "No command") { + t.Fatalf("Unexpected output for no command: %v", string(outp)) + } + + comm = exec.Command("micro", serv.envFlag(), "asdasd") + outp, err = comm.CombinedOutput() + if err == nil { + t.Fatal("Wrong command should error") + } + + if !strings.Contains(string(outp), "Unrecognized micro command") { + t.Fatalf("Unexpected output for unrecognized command: %v", string(outp)) + } + + comm = exec.Command("micro", serv.envFlag(), "config", "asdasd") + outp, err = comm.CombinedOutput() + if err == nil { + t.Fatal("Wrong subcommand should error") + } + + // @todod for some reason this one returns multiple lines so we don't check for line count now + if !strings.Contains(string(outp), "Unrecognized subcommand for micro config") { + t.Fatalf("Unexpected output for unrecognized subcommand: %v", string(outp)) + } +} diff --git a/test/runtime_test.go b/test/runtime_test.go index 68dd501d0a7..06b930218ae 100644 --- a/test/runtime_test.go +++ b/test/runtime_test.go @@ -15,58 +15,6 @@ import ( "time" ) -func TestNew(t *testing.T) { - trySuite(t, testNew, retryCount) -} - -func testNew(t *t) { - t.Parallel() - defer func() { - exec.Command("rm", "-r", "./foobar").CombinedOutput() - }() - outp, err := exec.Command("micro", "new", "foobar").CombinedOutput() - if err != nil { - t.Fatal(err) - return - } - if !strings.Contains(string(outp), "protoc") { - t.Fatalf("micro new lacks protobuf install instructions %v", string(outp)) - return - } - - lines := strings.Split(string(outp), "\n") - // executing install instructions - for _, line := range lines { - if strings.HasPrefix(line, "go get") { - parts := strings.Split(line, " ") - getOutp, getErr := exec.Command(parts[0], parts[1:]...).CombinedOutput() - if getErr != nil { - t.Fatal(string(getOutp)) - return - } - } - if strings.HasPrefix(line, "make proto") { - mp := strings.Split(line, " ") - protocCmd := exec.Command(mp[0], mp[1:]...) - protocCmd.Dir = "./foobar" - pOutp, pErr := protocCmd.CombinedOutput() - if pErr != nil { - t.Log("That didn't work ", pErr) - t.Fatal(string(pOutp)) - return - } - } - } - - buildCommand := exec.Command("go", "build") - buildCommand.Dir = "./foobar" - outp, err = buildCommand.CombinedOutput() - if err != nil { - t.Fatal(string(outp)) - return - } -} - func TestServerModeCall(t *testing.T) { trySuite(t, testServerModeCall, retryCount) } diff --git a/test/test_framework.go b/test/test_framework.go index eefcdb7a03c..069ba4d26c7 100644 --- a/test/test_framework.go +++ b/test/test_framework.go @@ -14,7 +14,7 @@ import ( ) const ( - retryCount = 1 + retryCount = 2 isParallel = true ) From dcc143be6e188dff57b15fef3623692e7ec8f14d Mon Sep 17 00:00:00 2001 From: Alex Unger Date: Thu, 11 Jun 2020 09:56:06 +0200 Subject: [PATCH 11/47] check length of Issuer for noop auth (#921) Co-authored-by: Asim Aslam --- client/api/auth/wrapper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/api/auth/wrapper.go b/client/api/auth/wrapper.go index 59a92c16ddd..e2f137c706c 100644 --- a/client/api/auth/wrapper.go +++ b/client/api/auth/wrapper.go @@ -66,7 +66,7 @@ func (a authWrapper) ServeHTTP(w http.ResponseWriter, req *http.Request) { acc, _ := a.auth.Inspect(token) // Ensure the accounts issuer matches the namespace being requested - if acc != nil && acc.Issuer != ns { + if acc != nil && len(acc.Issuer) > 0 && acc.Issuer != ns { http.Error(w, "Account not issued by "+ns, 403) return } From 0bd8ee6cce651629e7e7575c5e97c9add94031fe Mon Sep 17 00:00:00 2001 From: Janos Dobronszki Date: Thu, 11 Jun 2020 10:55:08 +0200 Subject: [PATCH 12/47] Testdocs amendment (#905) Co-authored-by: Dominic Wong --- test/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/README.md b/test/README.md index d84e0ad11e7..890e1cd89fe 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,8 @@ 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 +``` From 9b53e0ec46d08a69434e0245737cc03293e97770 Mon Sep 17 00:00:00 2001 From: Janos Dobronszki Date: Thu, 11 Jun 2020 16:28:54 +0200 Subject: [PATCH 13/47] Micro new now works even if `micro server` is not running (#938) --- client/cli/util/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cli/util/util.go b/client/cli/util/util.go index 4bdeb9f277d..6bb24add430 100644 --- a/client/cli/util/util.go +++ b/client/cli/util/util.go @@ -53,7 +53,7 @@ var defaultEnvs = map[string]Env{ func isBuiltinService(command string) bool { switch command { - case "server", "help": + case "new", "server", "help": return true } for _, service := range platform.Services { From de7bdb0b636d0d28309f5921e5cadd00b07afac6 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Mon, 8 Jun 2020 18:50:27 +0100 Subject: [PATCH 14/47] Update FUNDING.yml (#926) --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 7928ee1cf37..c99d85a17b8 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -github: asim +github: micro From 37f020f1979c305eea88efdbe1c16b30a14cf231 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Wed, 10 Jun 2020 10:32:14 +0100 Subject: [PATCH 15/47] Update README.md (#935) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d29fddae9e2..cb154e9a335 100644 --- a/README.md +++ b/README.md @@ -131,4 +131,4 @@ See all the options micro --help ``` -See the [docs](https://dev.micro.mu) for detailed information on the architecture, installation and use of the platform. +See the [docs](https://dev.m3o.com) for detailed information on the architecture, installation and use of the platform. From 1aab47b7634b112bd96087ca8962bad3276a34d8 Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Thu, 11 Jun 2020 09:38:12 +0100 Subject: [PATCH 16/47] update go-micro 2.9.0-rc1 --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 16fa5847b88..2823e42ac02 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.8.1-0.20200609104731-cdd8f9fd82c5 + github.com/micro/go-micro/v2 v2.9.0-rc1 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 6155ee5bbfe..c691fb3e362 100644 --- a/go.sum +++ b/go.sum @@ -329,6 +329,8 @@ github.com/micro/go-micro/v2 v2.8.1-0.20200603084508-7b379bf1f16e/go.mod h1:hSdO 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/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= From abc73d4e9cd2b6cbab68c7c6e8663f8683518fdd Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Thu, 11 Jun 2020 10:28:51 +0100 Subject: [PATCH 17/47] loosen up the test timeout --- service/runtime/manager/events_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/service/runtime/manager/events_test.go b/service/runtime/manager/events_test.go index 099be4c3ee3..0effee23284 100644 --- a/service/runtime/manager/events_test.go +++ b/service/runtime/manager/events_test.go @@ -21,8 +21,8 @@ func TestEvents(t *testing.T) { eventPollFrequency = time.Millisecond * 10 go m.watchEvents() - // timeout async tests after 50ms - timeout := time.NewTimer(time.Millisecond * 50) + // timeout async tests after 500ms + timeout := time.NewTimer(time.Millisecond * 500) // the service that should be passed to the runtime testSrv := &runtime.Service{Name: "go.micro.service.foo", Version: "latest"} @@ -35,7 +35,7 @@ func TestEvents(t *testing.T) { t.Errorf("Unexpected error when publishing events: %v", err) } - timeout.Reset(time.Millisecond * 50) + timeout.Reset(time.Millisecond * 500) select { case srv := <-eventChan: @@ -58,7 +58,7 @@ func TestEvents(t *testing.T) { t.Errorf("Unexpected error when publishing events: %v", err) } - timeout.Reset(time.Millisecond * 50) + timeout.Reset(time.Millisecond * 500) select { case srv := <-eventChan: @@ -70,7 +70,7 @@ func TestEvents(t *testing.T) { } if rt.updateCount != 1 { - t.Errorf("Expected runtime update to be called 1 time but was actually called %v times", rt.createCount) + t.Errorf("Expected runtime update to be called 1 time but was actually called %v times", rt.updateCount) } }) @@ -81,7 +81,7 @@ func TestEvents(t *testing.T) { t.Errorf("Unexpected error when publishing events: %v", err) } - timeout.Reset(time.Millisecond * 50) + timeout.Reset(time.Millisecond * 500) select { case srv := <-eventChan: @@ -93,7 +93,7 @@ func TestEvents(t *testing.T) { } if rt.deleteCount != 1 { - t.Errorf("Expected runtime delete to be called 1 time but was actually called %v times", rt.createCount) + t.Errorf("Expected runtime delete to be called 1 time but was actually called %v times", rt.deleteCount) } }) } From e120f10f5ee392e6604d2ccc31e0604193c8b670 Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Thu, 11 Jun 2020 11:07:02 +0100 Subject: [PATCH 18/47] release step failing due to upx --- .github/workflows/release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2ed1ca491d..cbf059bd9d1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,9 +19,6 @@ jobs: uses: actions/setup-go@v1 with: go-version: '1.13' - - - name: Install upx - run: sudo apt install upx -y - name: Run GoReleaser uses: goreleaser/goreleaser-action@v1 From efa9782a29ef025204153cffac84d1092c229144 Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Thu, 11 Jun 2020 15:02:02 +0100 Subject: [PATCH 19/47] remove upx from workflow as its flaky --- .goreleaser.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 14e989554fb..607fc0bb2e3 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -24,8 +24,6 @@ builds: - arm64 goarm: - 7 - hooks: - post: .github/workflows/upx.sh archives: - name_template: '{{.ProjectName}}-{{.Tag}}-{{.Os}}-{{.Arch}}{{if .Arm}}{{.Arm}}{{end}}' replacements: From 635e7862d7f7d03b22c2cfd40ecd3f9487f1c1d2 Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Thu, 11 Jun 2020 15:10:42 +0100 Subject: [PATCH 20/47] Update goreleaser to see if that fixes the upx weirdness --- .github/workflows/release.yml | 5 ++++- .goreleaser.yml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cbf059bd9d1..223001b32b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,9 +19,12 @@ jobs: uses: actions/setup-go@v1 with: go-version: '1.13' + - + name: Install upx + run: sudo apt install upx -y - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v1 + uses: goreleaser/goreleaser-action@v2 with: args: release --rm-dist env: diff --git a/.goreleaser.yml b/.goreleaser.yml index 607fc0bb2e3..14e989554fb 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -24,6 +24,8 @@ builds: - arm64 goarm: - 7 + hooks: + post: .github/workflows/upx.sh archives: - name_template: '{{.ProjectName}}-{{.Tag}}-{{.Os}}-{{.Arch}}{{if .Arm}}{{.Arm}}{{end}}' replacements: From dafdf7ecb55054932cad643bc7fb0bd9d19135cb Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Fri, 12 Jun 2020 11:19:10 +0100 Subject: [PATCH 21/47] update go-micro --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 2823e42ac02..c315b542c06 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-rc1 + github.com/micro/go-micro/v2 v2.9.0 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 c691fb3e362..6dcc6918b10 100644 --- a/go.sum +++ b/go.sum @@ -331,6 +331,8 @@ github.com/micro/go-micro/v2 v2.8.1-0.20200609104731-cdd8f9fd82c5 h1:IUUXIV3yqMc 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= From bed69eb0a00b729277c2a3ced405ce3df6bc58b6 Mon Sep 17 00:00:00 2001 From: Janos Dobronszki Date: Mon, 15 Jun 2020 16:25:23 +0200 Subject: [PATCH 22/47] Fixing the new command (#945) --- client/cli/util/util.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/cli/util/util.go b/client/cli/util/util.go index 6bb24add430..b5b41f0df6c 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 "new", "server", "help": - return true - } for _, service := range platform.Services { if command == service { return true @@ -66,6 +62,10 @@ func isBuiltinService(command string) bool { // SetupCommand includes things that should run for each command. func SetupCommand(ctx *ccli.Context) { + switch ctx.Args().First() { + case "new", "server", "help": + return + } if ctx.Args().Len() == 1 && isBuiltinService(ctx.Args().First()) { return } From 7bbdc17bfe710e212ddfa26fa1873f7c1aa6319d Mon Sep 17 00:00:00 2001 From: Janos Dobronszki Date: Mon, 15 Jun 2020 16:25:23 +0200 Subject: [PATCH 23/47] Fixing the new command (#945) --- client/cli/util/util.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/cli/util/util.go b/client/cli/util/util.go index 4bdeb9f277d..b5b41f0df6c 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,10 @@ func isBuiltinService(command string) bool { // SetupCommand includes things that should run for each command. func SetupCommand(ctx *ccli.Context) { + switch ctx.Args().First() { + case "new", "server", "help": + return + } if ctx.Args().Len() == 1 && isBuiltinService(ctx.Args().First()) { return } From 7d842c035208ee3578d1bb1a9ab7138173c64dd5 Mon Sep 17 00:00:00 2001 From: ben-toogood Date: Mon, 15 Jun 2020 18:16:46 +0100 Subject: [PATCH 24/47] router: exit process when an error occurs (#948) --- service/router/router.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/service/router/router.go b/service/router/router.go index dfc74131019..11f483aaa58 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" @@ -253,19 +252,14 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { 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() }() @@ -282,8 +276,6 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { os.Exit(1) } - wg.Wait() - log.Info("successfully stopped") } From e29e21a5237309c347ea6cb8b5cc8e3ce0218e18 Mon Sep 17 00:00:00 2001 From: Janos Dobronszki Date: Tue, 16 Jun 2020 12:43:14 +0200 Subject: [PATCH 25/47] Fixing help for subcommands (#949) --- client/cli/util/util.go | 6 ++++++ internal/helper/helper.go | 6 +++--- test/misc_test.go | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/client/cli/util/util.go b/client/cli/util/util.go index b5b41f0df6c..4761374abbc 100644 --- a/client/cli/util/util.go +++ b/client/cli/util/util.go @@ -62,6 +62,12 @@ 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 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/test/misc_test.go b/test/misc_test.go index c84bfdef0cd..afb7057c8d3 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,39 @@ 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 + } + } +} From e4672a963c29b0be81a92629bab7edbcbe3024f3 Mon Sep 17 00:00:00 2001 From: Janos Dobronszki Date: Tue, 16 Jun 2020 17:15:57 +0200 Subject: [PATCH 26/47] Push crufter branch to docker hub (#950) --- .github/workflows/docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c6e04da5589..a092c36aa6a 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.* From f4e48d129ae0fa07c59a4bd1ca5701282390d547 Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Tue, 16 Jun 2020 17:14:54 +0100 Subject: [PATCH 27/47] update PR template --- .github/PULL_REQUEST_TEMPLATE.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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** From da11a78e30171057bc320ec36dcc5a7db5611053 Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Thu, 18 Jun 2020 18:06:14 +0100 Subject: [PATCH 28/47] Pass through args from micro server to core services (#953) * Pass through args from micro server to core services * Remove unneeded local env test (local is broken anyway) and fix logic for checking status --- server/server.go | 25 ++++++++++++++++------- test/Dockerfile | 1 - test/runtime_test.go | 48 ++++++++------------------------------------ 3 files changed, 26 insertions(+), 48 deletions(-) diff --git a/server/server.go b/server/server.go index cb976773afa..d23b9443d8f 100644 --- a/server/server.go +++ b/server/server.go @@ -90,18 +90,19 @@ 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 @@ -153,10 +154,20 @@ func Run(context *cli.Context) error { envs = append(envs, "MICRO_AUTH=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/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/runtime_test.go b/test/runtime_test.go index 06b930218ae..8d0e8a91e1b 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 statusRunning(service string, statusOutput []byte) bool { + reg, _ := regexp.Compile(service + "\\s+latest\\s+\\S+\\s+running") -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) - } - }() - - 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 From a30c479011e5c5e462e5b03b3de7f3565d1c1947 Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Fri, 19 Jun 2020 13:22:17 +0100 Subject: [PATCH 29/47] Return quickly from unrecognised command rather than trying to run auth generate (#957) --- client/cli/util/util.go | 5 +++++ test/misc_test.go | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/client/cli/util/util.go b/client/cli/util/util.go index 4761374abbc..0ded1b58fd7 100644 --- a/client/cli/util/util.go +++ b/client/cli/util/util.go @@ -79,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/test/misc_test.go b/test/misc_test.go index afb7057c8d3..5ebd3275714 100644 --- a/test/misc_test.go +++ b/test/misc_test.go @@ -145,3 +145,12 @@ func testHelps(t *t) { } } } + +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 + } +} From 92454a59bd1dae00ba17c4fdea33bf2310f03289 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 19 Jun 2020 13:45:53 +0100 Subject: [PATCH 30/47] registry: update multi-tenancy support --- go.mod | 2 +- go.sum | 11 ++ service/registry/handler/handler.go | 186 ++++++++++++++++------------ service/registry/registry.go | 3 +- 4 files changed, 123 insertions(+), 79 deletions(-) diff --git a/go.mod b/go.mod index c315b542c06..d3e5fb2a45a 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.20200619121644-5f9c3a6efdfc 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..b9eb09d117a 100644 --- a/go.sum +++ b/go.sum @@ -97,6 +97,7 @@ github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kw github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY= github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.18+incompatible h1:Zz1aXgDrFFi1nadh58tA9ktt06cmPTwNNP3dXwIq1lE= github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -260,6 +261,7 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO 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/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= 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 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= @@ -302,6 +304,7 @@ github.com/linode/linodego v0.10.0/go.mod h1:cziNP7pbvE3mXIPneHj0oRY8L1WtGEIKlZ8 github.com/liquidweb/liquidweb-go v1.6.0/go.mod h1:UDcVnAMDkZxpw4Y7NOHkqoeiGacVLEIG/i5J9cyixzQ= github.com/lucas-clemente/quic-go v0.14.1 h1:c1aKoBZKOPA+49q96B1wGkibyPP0AxYh45WuAoq+87E= github.com/lucas-clemente/quic-go v0.14.1/go.mod h1:Vn3/Fb0/77b02SGhQk36KzOUmXgVpFfizUfW5WMaqyU= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/marten-seemann/chacha20 v0.2.0 h1:f40vqzzx+3GdOmzQoItkLX5WLvHgPgyYqFFIO5Gh4hQ= @@ -333,6 +336,10 @@ github.com/micro/go-micro/v2 v2.9.0-rc1 h1:JzuwVr6gcP7yRT/ftkZ7bn6jbv+8iAJPL1VWN 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/go-micro/v2 v2.9.1-0.20200619093412-58c6bbbf6b0a h1:eV5V8kM6VuMYioePvG2GOoEu4y87utYpNsNeTvyNe2g= +github.com/micro/go-micro/v2 v2.9.1-0.20200619093412-58c6bbbf6b0a/go.mod h1:x55ZM3Puy0FyvvkR3e0ha0xsE9DFwfPSUMWAIbFY0SY= +github.com/micro/go-micro/v2 v2.9.1-0.20200619121644-5f9c3a6efdfc h1:LKqSZQvEde1zRHy3VQXXc8zRJmNZo34VSKbpP4iTXj0= +github.com/micro/go-micro/v2 v2.9.1-0.20200619121644-5f9c3a6efdfc/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= @@ -467,10 +474,13 @@ github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.6.3 h1:pDDu1OyEDTKzpJwdq4TiuLyMsUgRa/BT5cn5O62NoHs= github.com/spf13/viper v1.6.3/go.mod h1:jUMtyi0/lB5yZH/FjyGAoH7IMNrIhlBf6pXZmbMDvzw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -491,6 +501,7 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc h1:yUaosF 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/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= 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/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= 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 From faa7c72c8ae9049d21acd104a572c843a15da2ca Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Wed, 24 Jun 2020 10:34:56 +0100 Subject: [PATCH 31/47] {proxy,router,tunnel}: update router usage --- client/proxy/proxy.go | 6 ------ go.mod | 2 ++ go.sum | 18 +++--------------- service/router/router.go | 41 ++++++++++++---------------------------- service/tunnel/tunnel.go | 10 ++-------- 5 files changed, 19 insertions(+), 58 deletions(-) diff --git a/client/proxy/proxy.go b/client/proxy/proxy.go index e61b8fbeca2..69bb71b217e 100644 --- a/client/proxy/proxy.go +++ b/client/proxy/proxy.go @@ -111,12 +111,6 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { 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)) diff --git a/go.mod b/go.mod index c315b542c06..69b4952d22a 100644 --- a/go.mod +++ b/go.mod @@ -33,3 +33,5 @@ require ( google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 google.golang.org/grpc v1.26.0 ) + +replace github.com/micro/go-micro/v2 => ../go-micro diff --git a/go.sum b/go.sum index 6dcc6918b10..657af4f0f9a 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,6 @@ 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/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 +468,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/service/router/router.go b/service/router/router.go index 11f483aaa58..43a7ce5358b 100644 --- a/service/router/router.go +++ b/service/router/router.go @@ -136,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 @@ -232,21 +222,14 @@ 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) @@ -268,15 +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) } - log.Info("successfully stopped") + log.Info("successfully closed") } func Commands(options ...micro.Option) []*cli.Command { 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 From 954f7882a83c69521baafed277ea0af1582b0c52 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Wed, 24 Jun 2020 11:14:06 +0100 Subject: [PATCH 32/47] update go-micro --- go.mod | 4 +--- go.sum | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 69b4952d22a..754926c8034 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.20200624100916-c94096157435 github.com/miekg/dns v1.1.27 github.com/netdata/go-orchestrator v0.0.0-20190905093727-c793edba0e8f github.com/olekukonko/tablewriter v0.0.4 @@ -33,5 +33,3 @@ require ( google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 google.golang.org/grpc v1.26.0 ) - -replace github.com/micro/go-micro/v2 => ../go-micro diff --git a/go.sum b/go.sum index 657af4f0f9a..891be3c8435 100644 --- a/go.sum +++ b/go.sum @@ -325,6 +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.9.1-0.20200624100916-c94096157435 h1:IoR+Ia4nMVBQfOa5g+kIiAO/ggD0t0UeceqQWFn/Vek= +github.com/micro/go-micro/v2 v2.9.1-0.20200624100916-c94096157435/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= From 404ec5bf31c674f5f09355adfd55728f21b32034 Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Wed, 24 Jun 2020 17:32:16 +0100 Subject: [PATCH 33/47] dont copy proto for non api projects (#966) --- client/cli/new/new.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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()) From 2df17a97ff10f1254df350fd101b69faa4218032 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Thu, 25 Jun 2020 14:11:30 +0100 Subject: [PATCH 34/47] service/router: propagate query network --- service/router/handler/router.go | 7 +++++-- service/router/handler/table.go | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) 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) } From 867f44aafdf357eb6b4ef532ebbc7f9e9362576e Mon Sep 17 00:00:00 2001 From: Janos Dobronszki Date: Thu, 25 Jun 2020 18:50:22 +0200 Subject: [PATCH 35/47] Upoad whole repo when doing `micro run` to support services with dependencies inside that repo (#956) --- go.mod | 2 +- go.sum | 4 +- service/runtime/handler/util.go | 17 +- service/runtime/service.go | 12 +- test/README.md | 6 + test/dep-test/dep-test-service/.gitignore | 2 + test/dep-test/dep-test-service/Dockerfile | 3 + test/dep-test/dep-test-service/Makefile | 22 + test/dep-test/dep-test-service/README.md | 55 ++ test/dep-test/dep-test-service/generate.go | 2 + test/dep-test/dep-test-service/go.mod | 16 + test/dep-test/dep-test-service/go.sum | 574 ++++++++++++++++++ test/dep-test/dep-test-service/handler/dep.go | 48 ++ test/dep-test/dep-test-service/main.go | 36 ++ test/dep-test/dep-test-service/plugin.go | 2 + .../dep-test-service/proto/dep/dep.pb.go | 541 +++++++++++++++++ .../proto/dep/dep.pb.micro.go | 284 +++++++++ .../dep-test-service/proto/dep/dep.proto | 37 ++ .../dep-test-service/proto/imports/api.proto | 43 ++ .../dep-test-service/subscriber/dep.go | 20 + test/dep-test/dep.go | 3 + test/dep-test/go.mod | 3 + test/runtime_test.go | 31 + 23 files changed, 1757 insertions(+), 6 deletions(-) create mode 100644 test/dep-test/dep-test-service/.gitignore create mode 100644 test/dep-test/dep-test-service/Dockerfile create mode 100644 test/dep-test/dep-test-service/Makefile create mode 100644 test/dep-test/dep-test-service/README.md create mode 100644 test/dep-test/dep-test-service/generate.go create mode 100644 test/dep-test/dep-test-service/go.mod create mode 100644 test/dep-test/dep-test-service/go.sum create mode 100644 test/dep-test/dep-test-service/handler/dep.go create mode 100644 test/dep-test/dep-test-service/main.go create mode 100644 test/dep-test/dep-test-service/plugin.go create mode 100644 test/dep-test/dep-test-service/proto/dep/dep.pb.go create mode 100644 test/dep-test/dep-test-service/proto/dep/dep.pb.micro.go create mode 100644 test/dep-test/dep-test-service/proto/dep/dep.proto create mode 100644 test/dep-test/dep-test-service/proto/imports/api.proto create mode 100644 test/dep-test/dep-test-service/subscriber/dep.go create mode 100644 test/dep-test/dep.go create mode 100644 test/dep-test/go.mod diff --git a/go.mod b/go.mod index 177483f4b66..4fe149a6907 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.1-0.20200624124743-2b506b1a2a10 + github.com/micro/go-micro/v2 v2.9.1-0.20200625102543-5ab475636ad8 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 0a9f708c956..809c46f67ba 100644 --- a/go.sum +++ b/go.sum @@ -325,8 +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.9.1-0.20200624124743-2b506b1a2a10 h1:oZXYino9LWJSVy7ocSfQzhGxCB+mP6uyCSU5wYIRTME= -github.com/micro/go-micro/v2 v2.9.1-0.20200624124743-2b506b1a2a10/go.mod h1:hSdOM6jb6aGswjBpCeB9wJ0yVH+CugevRm/CX7NlSrQ= +github.com/micro/go-micro/v2 v2.9.1-0.20200625102543-5ab475636ad8 h1:ZGnYAYptWDDqiMUeSt7dVyDJS4T7oNhu+deR/iFidY4= +github.com/micro/go-micro/v2 v2.9.1-0.20200625102543-5ab475636ad8/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= 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/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/test/README.md b/test/README.md index 890e1cd89fe..6bda20fd9e7 100644 --- a/test/README.md +++ b/test/README.md @@ -54,3 +54,9 @@ 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/runtime_test.go b/test/runtime_test.go index 8d0e8a91e1b..07405cdd707 100644 --- a/test/runtime_test.go +++ b/test/runtime_test.go @@ -490,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) +} From 200a03418ccdcfbfb04536c79d58cd06c13f0814 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 26 Jun 2020 09:22:56 +0100 Subject: [PATCH 36/47] internal/resolver/api: update usage of api resolver --- internal/resolver/api/api.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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...), } } From 3da24ccf71648d9031a9b7b1f859cd51184f0c96 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 26 Jun 2020 09:23:31 +0100 Subject: [PATCH 37/47] client/api: update usage of api resolver --- client/api/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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), } From 0646b6e9cf6c88aabfae6254c6830f001129f8e5 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 26 Jun 2020 10:41:34 +0100 Subject: [PATCH 38/47] {cli,proxy} update router support --- client/proxy/proxy.go | 44 ++----------------------------- cmd/cmd.go | 8 ------ go.mod | 4 +-- go.sum | 2 ++ internal/client/client.go | 21 ++++++++------- internal/command/cli/command.go | 16 ++++++----- service/runtime/manager/events.go | 4 +-- 7 files changed, 27 insertions(+), 72 deletions(-) diff --git a/client/proxy/proxy.go b/client/proxy/proxy.go index b277365abd5..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,36 +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.Address(routerAddr), - rs.Client(client.DefaultClient), - router.Registry(registry.DefaultRegistry), - } - - // 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...) + popts := []proxy.Option{ + proxy.WithRouter(service.Options().Router), } - // append router to proxy opts - popts = append(popts, proxy.WithRouter(r)) - // new proxy var p proxy.Proxy // setup the default server @@ -274,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/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 177483f4b66..5998181fef4 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,7 @@ go 1.13 require ( github.com/aws/aws-sdk-go v1.23.0 github.com/boltdb/bolt v1.3.1 - github.com/chzyer/logex v1.1.10 // indirect github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e - github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect github.com/cloudflare/cloudflare-go v0.10.9 github.com/dustin/go-humanize v1.0.0 github.com/fsnotify/fsnotify v1.4.7 @@ -17,7 +15,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.1-0.20200624124743-2b506b1a2a10 + github.com/micro/go-micro/v2 v2.9.1-0.20200626093811-4f0f4326df8b 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 0a9f708c956..f9998d5df32 100644 --- a/go.sum +++ b/go.sum @@ -327,6 +327,8 @@ 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.9.1-0.20200624124743-2b506b1a2a10 h1:oZXYino9LWJSVy7ocSfQzhGxCB+mP6uyCSU5wYIRTME= github.com/micro/go-micro/v2 v2.9.1-0.20200624124743-2b506b1a2a10/go.mod h1:hSdOM6jb6aGswjBpCeB9wJ0yVH+CugevRm/CX7NlSrQ= +github.com/micro/go-micro/v2 v2.9.1-0.20200626093811-4f0f4326df8b h1:rw/6Oyyb6QzN6dOw8AcncNAEhiEVXOXI/JrmkcR4bf0= +github.com/micro/go-micro/v2 v2.9.1-0.20200626093811-4f0f4326df8b/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= 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..a26b92b0554 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("*")) 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/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 From 3fd1951d48e85c5da4dfef556819a1067234f1a9 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 26 Jun 2020 10:45:02 +0100 Subject: [PATCH 39/47] Tidy go.mod --- go.mod | 2 ++ go.sum | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 5998181fef4..0bd7c3b4e94 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,9 @@ go 1.13 require ( github.com/aws/aws-sdk-go v1.23.0 github.com/boltdb/bolt v1.3.1 + github.com/chzyer/logex v1.1.10 // indirect github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e + github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect github.com/cloudflare/cloudflare-go v0.10.9 github.com/dustin/go-humanize v1.0.0 github.com/fsnotify/fsnotify v1.4.7 diff --git a/go.sum b/go.sum index f9998d5df32..51aadb1416f 100644 --- a/go.sum +++ b/go.sum @@ -325,8 +325,6 @@ 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.9.1-0.20200624124743-2b506b1a2a10 h1:oZXYino9LWJSVy7ocSfQzhGxCB+mP6uyCSU5wYIRTME= -github.com/micro/go-micro/v2 v2.9.1-0.20200624124743-2b506b1a2a10/go.mod h1:hSdOM6jb6aGswjBpCeB9wJ0yVH+CugevRm/CX7NlSrQ= github.com/micro/go-micro/v2 v2.9.1-0.20200626093811-4f0f4326df8b h1:rw/6Oyyb6QzN6dOw8AcncNAEhiEVXOXI/JrmkcR4bf0= github.com/micro/go-micro/v2 v2.9.1-0.20200626093811-4f0f4326df8b/go.mod h1:hSdOM6jb6aGswjBpCeB9wJ0yVH+CugevRm/CX7NlSrQ= github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= From 9f702533559a4b6167bf2024e30e5f8cbc88de7e Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 26 Jun 2020 10:45:35 +0100 Subject: [PATCH 40/47] cli: use registry.WildcardDomain var --- internal/command/cli/command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/command/cli/command.go b/internal/command/cli/command.go index a26b92b0554..346bb65788a 100644 --- a/internal/command/cli/command.go +++ b/internal/command/cli/command.go @@ -770,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], registry.GetDomain("*")) + service, err := reg.GetService(args[0], registry.GetDomain(registry.WildcardDomain)) if err != nil { return nil, err } From 9506e250bc0d3447873cfe217d7ce707c2747bdc Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 26 Jun 2020 11:13:25 +0100 Subject: [PATCH 41/47] internal/client: temp disable setting micro network on cli calls --- internal/client/client.go | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/internal/client/client.go b/internal/client/client.go index 4a3d602d3c5..ab10fb93996 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -2,15 +2,12 @@ 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" ) @@ -35,14 +32,14 @@ func (a *wrapper) Call(ctx context.Context, req client.Request, rsp interface{}, ctx = metadata.Set(ctx, "Authorization", auth.BearerScheme+a.token) } - // 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, "/", "-") - } + // 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) + // ctx = metadata.Set(ctx, "Micro-Network", network) return a.Client.Call(ctx, req, rsp, opts...) } From c8e2ff464141de2fc4ac129ce2913eb0a0e76d52 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 26 Jun 2020 11:24:21 +0100 Subject: [PATCH 42/47] Revert "internal/client: temp disable setting micro network on cli calls" This reverts commit 9506e250bc0d3447873cfe217d7ce707c2747bdc. --- internal/client/client.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/internal/client/client.go b/internal/client/client.go index ab10fb93996..4a3d602d3c5 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -2,12 +2,15 @@ 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,14 +35,14 @@ func (a *wrapper) Call(ctx context.Context, req client.Request, rsp interface{}, ctx = metadata.Set(ctx, "Authorization", auth.BearerScheme+a.token) } - // 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, "/", "-") - // } + // 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) + ctx = metadata.Set(ctx, "Micro-Network", network) return a.Client.Call(ctx, req, rsp, opts...) } From 4ecd6ce4ef9b6a98f6e62278ab3ad65943cc76b1 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 26 Jun 2020 12:19:52 +0100 Subject: [PATCH 43/47] server: use router service for clients (api,web,proxy) --- server/server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/server.go b/server/server.go index d23b9443d8f..b22f4c03f74 100644 --- a/server/server.go +++ b/server/server.go @@ -102,6 +102,7 @@ func Run(context *cli.Context) error { if len(profile) == 0 { profile = "server" } + env = append(env, "MICRO_RUNTIME_PROFILE="+profile) env = append(env, os.Environ()...) @@ -152,6 +153,7 @@ 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{} From 32ed5463d6e97e1b856d7750fe71f46715825085 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 26 Jun 2020 14:30:22 +0100 Subject: [PATCH 44/47] update go-micro --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0bd7c3b4e94..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.1-0.20200626093811-4f0f4326df8b + 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 51aadb1416f..66f745dd693 100644 --- a/go.sum +++ b/go.sum @@ -325,8 +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.9.1-0.20200626093811-4f0f4326df8b h1:rw/6Oyyb6QzN6dOw8AcncNAEhiEVXOXI/JrmkcR4bf0= -github.com/micro/go-micro/v2 v2.9.1-0.20200626093811-4f0f4326df8b/go.mod h1:hSdOM6jb6aGswjBpCeB9wJ0yVH+CugevRm/CX7NlSrQ= +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= From 6777fce1b362b0a13f83a2e411be9419aca10316 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 26 Jun 2020 14:41:05 +0100 Subject: [PATCH 45/47] web: update resolver --- client/web/web.go | 6 ++--- internal/resolver/web/resolver.go | 34 +++++++++----------------- internal/resolver/web/resolver_test.go | 5 ++-- 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/client/web/web.go b/client/web/web.go index 5b705ca9f36..6594c6d25f4 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 } @@ -487,8 +487,8 @@ 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), ), 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 { From 35a9a8a4d0ff02dbb94abcc6d34bc8ab364ad125 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 26 Jun 2020 15:25:42 +0100 Subject: [PATCH 46/47] client/web: temp fixes whilst we depricate namespace selector --- client/api/auth/wrapper.go | 6 +++++- client/web/web.go | 11 ++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) 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/web/web.go b/client/web/web.go index 6594c6d25f4..8022a51fa44 100644 --- a/client/web/web.go +++ b/client/web/web.go @@ -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 } @@ -491,6 +491,7 @@ func Run(ctx *cli.Context, srvOpts ...micro.Option) { ServicePrefix: Namespace + "." + Type, Selector: selector.NewSelector( selector.Registry(reg), + selector.Domain(registry.WildcardDomain), ), }, auth: *cmd.DefaultOptions().Auth, From 554ff5d774eebbd715cd9aed8bc401966401a59a Mon Sep 17 00:00:00 2001 From: Lars Gohr Date: Wed, 29 Mar 2023 02:32:32 +0200 Subject: [PATCH 47/47] Updated elgohr/Publish-Docker-Github-Action to a supported version (v5) --- .github/workflows/docker.yml | 2 +- .github/workflows/integration-k8s.yml | 2 +- .github/workflows/staging.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a092c36aa6a..05f3ffefbeb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -21,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 }}