diff --git a/Makefile b/Makefile index 45c5e82..f13575a 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ DOCKER_REPO = dyweb/go.ice # --- build vars --- # --- packages --- -PKGST=./cli +PKGST=./cli ./cmd ./dockerclient ./containertest PKGS=./cli/... # --- packages --- diff --git a/README.md b/README.md index d3661c7..d8b5100 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,10 @@ Non Goals ## License +MIT + +NOTE: code under [dockerclient/types](dockerclient/types) are copied from [moby](https://github.com/moby/moby/tree/master/api/types) and licensed under Apache-2.0 + [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fat15%2Fgo.ice.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fat15%2Fgo.ice?ref=badge_large) ## About diff --git a/cmd/dk/main.go b/cmd/dk/main.go new file mode 100644 index 0000000..28ae7e3 --- /dev/null +++ b/cmd/dk/main.go @@ -0,0 +1,85 @@ +package main + +import ( + "context" + "fmt" + "io" + "os" + "runtime" + + "github.com/docker/docker/api/types" + icli "github.com/dyweb/go.ice/cli" + "github.com/dyweb/go.ice/dockerclient" + dlog "github.com/dyweb/gommon/log" + "github.com/spf13/cobra" +) + +const ( + myname = "bh" +) + +var logReg = dlog.NewRegistry() +var log = logReg.Logger() + +var ( + version string + commit string + buildTime string + buildUser string + goVersion = runtime.Version() +) + +var buildInfo = icli.BuildInfo{Version: version, Commit: commit, BuildTime: buildTime, BuildUser: buildUser, GoVersion: goVersion} + +var cli *icli.Root + +func main() { + cli = icli.New( + icli.Name(myname), + icli.Description("BenchHub"), + icli.Version(buildInfo), + ) + root := cli.Command() + psCmd := cobra.Command{ + Use: "ps", + RunE: func(cmd *cobra.Command, args []string) error { + c := mustClient() + containers, err := c.ContainerList(context.Background(), types.ContainerListOptions{ + All: true, + }) + if err != nil { + return err + } + log.Infof("%d", len(containers)) + return nil + }, + } + pullCmd := cobra.Command{ + Use: "pull", + RunE: func(cmd *cobra.Command, args []string) error { + c := mustClient() + reader, err := c.ImagePull(context.Background(), "dyweb/go-dev:1.13.6", types.ImagePullOptions{}) + if err != nil { + return err + } + // TODO: it's actually json stream ... + io.Copy(os.Stdout, reader) + reader.Close() + return nil + }, + } + root.AddCommand(&psCmd) + root.AddCommand(&pullCmd) + if err := root.Execute(); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +} + +func mustClient() *dockerclient.Client { + c, err := dockerclient.New("/var/run/docker.sock") + if err != nil { + log.Fatal(err) + } + return c +} diff --git a/containertest/pkg.go b/containertest/pkg.go new file mode 100644 index 0000000..6cd9be5 --- /dev/null +++ b/containertest/pkg.go @@ -0,0 +1,3 @@ +// Package containertest allows launching container using go code in go test. +// See https://github.com/dyweb/go.ice/issues/56 +package containertest diff --git a/doc/ROADMAP.md b/doc/ROADMAP.md index 4a68642..1cacb64 100644 --- a/doc/ROADMAP.md +++ b/doc/ROADMAP.md @@ -1,5 +1,9 @@ # Roadmap +## v0.0.4 + +- [ ] container test, used by BenchHub + ## 0.1.x Use 0.1.x for v2 features, the v2 is actually v0.2.x since there weren't a usable v2 diff --git a/doc/log/2020/2020-03/2020-03-03-containertest.md b/doc/log/2020/2020-03/2020-03-03-containertest.md new file mode 100644 index 0000000..dad645f --- /dev/null +++ b/doc/log/2020/2020-03/2020-03-03-containertest.md @@ -0,0 +1,13 @@ +# 2020-03-03 Container Test + +For https://github.com/dyweb/go.ice/issues/56, it is required by benchhub for testing relational database. + +## TODO + +- [ ] revive the [old docker client](https://github.com/dyweb/go.ice/tree/archive/2020-01-13/lib/dockerclient) +- [ ] allow start/stop mysql container and wait for ready +- [ ] create database from testdata + +It's a bit hard to have go mod working with docker, suggested way is https://github.com/moby/moby/issues/39302#issuecomment-504146736 + +Moved part of dockerclient part, but maybe shell out is a better idea, compared with manually vendoring the part I need ... \ No newline at end of file diff --git a/dockerclient/client.go b/dockerclient/client.go new file mode 100644 index 0000000..81d38a7 --- /dev/null +++ b/dockerclient/client.go @@ -0,0 +1,75 @@ +package dockerclient + +import ( + "encoding/json" + "net/http" + "strings" + + "github.com/docker/docker/api/types" + "github.com/dyweb/gommon/errors" + "github.com/dyweb/gommon/httpclient" + "github.com/dyweb/gommon/util/httputil" +) + +type Client struct { + version string + h *httpclient.Client +} + +func New(host string) (*Client, error) { + if host != "" && !strings.Contains(host, ".sock") { + // standard docker command accept host without the protocol prefix and use tls flag to indicate https + if !strings.HasPrefix(host, "http://") { + host = "http://" + host + } + } + h, err := httpclient.New( + host, + httpclient.UseJSON(), + httpclient.WithErrorHandlerFunc(DecodeDockerError), + ) + if err != nil { + return nil, err + } + return &Client{ + version: DefaultVersion, + h: h, + }, nil +} + +func (dc *Client) Ping() (types.Ping, error) { + var ping types.Ping + res, err := dc.h.GetRaw(httpclient.Bkg(), "/_ping") + if err != nil { + return ping, err + } + defer httpclient.DrainAndClose(res) + ping.APIVersion = res.Header.Get("API-Version") + if res.Header.Get("Docker-Experimental") == "true" { + ping.Experimental = true + } + ping.OSType = res.Header.Get("OSType") + return ping, nil +} + +func (dc *Client) Version() (types.Version, error) { + var v types.Version + return v, dc.h.Get(httpclient.Bkg(), "/version", &v) +} + +func DecodeDockerError(status int, body []byte, res *http.Response) (decodedError error) { + e := ErrDocker{ + Status: status, + Method: httputil.Method(res.Request.Method), + Url: res.Request.URL.String(), + Path: res.Request.URL.Path, + Body: string(body), + } + // try to decode docker's error message, which is just a single string, well designed ... + var derr types.ErrorResponse + if err := json.Unmarshal(body, &derr); err != nil { + errors.Ignore(err) + } + e.Message = derr.Message + return &e +} diff --git a/dockerclient/container.go b/dockerclient/container.go new file mode 100644 index 0000000..d9055f5 --- /dev/null +++ b/dockerclient/container.go @@ -0,0 +1,101 @@ +package dockerclient + +import ( + "context" + "strconv" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/network" + + "github.com/dyweb/gommon/errors" + "github.com/dyweb/gommon/httpclient" +) + +// TODO +// - start +// - stop +// - kill + +type configWrapper struct { + *container.Config + HostConfig *container.HostConfig + NetworkingConfig *network.NetworkingConfig +} + +// https://docs.docker.com/engine/api/sdk/examples/#run-a-container +// https://github.com/docker/cli/blob/master/cli/command/container/run.go +func (dc *Client) ContainerCreate(ctx context.Context, config *container.Config, + hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, + containerName string) (container.ContainerCreateCreatedBody, error) { + hCtx := httpclient.ConvertContext(ctx) + if containerName != "" { + hCtx.SetParam("name", containerName) + } + body := configWrapper{ + Config: config, + HostConfig: hostConfig, + NetworkingConfig: networkingConfig, + } + + var created container.ContainerCreateCreatedBody + err := dc.h.Post(hCtx, "/containers/create", body, &created) + return created, err +} + +// https://github.com/docker/cli/blob/master/cli/command/container/list.go +// https://github.com/moby/moby/blob/master/client/container_list.go +// https://docs.docker.com/engine/reference/commandline/ps/#usage +func (dc *Client) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) { + hCtx := httpclient.ConvertContext(ctx) + + if options.All { + hCtx.SetParam("all", "1") + } + if options.Limit != -1 { + hCtx.SetParam("limit", strconv.Itoa(options.Limit)) + } + if options.Since != "" { + hCtx.SetParam("since", options.Since) + } + if options.Before != "" { + hCtx.SetParam("before", options.Before) + } + if options.Size { + hCtx.SetParam("size", "1") + } + if options.Filters.Len() > 0 { + if filterJSON, err := filters.ToJSON(options.Filters); err != nil { + return nil, err + } else { + hCtx.SetParam("filters", filterJSON) + } + } + + var containers []types.Container + if err := dc.h.Get(hCtx, "/containers/json", &containers); err != nil { + return nil, err + } + return containers, nil +} + +// TODO: signal should be typed +// TODO: kill -l to list all the signals +// https://www.linux.org/threads/kill-commands-and-signals.8881/ +// https://github.com/docker/cli/blob/master/cli/command/container/kill.go +// https://github.com/moby/moby/blob/master/client/container_kill.go +func (dc *Client) ContainerKill(ctx context.Context, containerId, signal string) error { + hCtx := httpclient.ConvertContext(ctx) + + if signal == "" { + signal = "KILL" + } + if containerId == "" { + return errors.New("containerId is empty for container kill") + } + if err := dc.h.PostIgnoreRes(hCtx, "/containers/"+containerId+"/kill", nil); err != nil { + return err + } + return nil +} diff --git a/dockerclient/image.go b/dockerclient/image.go new file mode 100644 index 0000000..6cd4d16 --- /dev/null +++ b/dockerclient/image.go @@ -0,0 +1,79 @@ +package dockerclient + +import ( + "context" + "io" + "strings" + + "github.com/docker/distribution/reference" + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/filters" + "github.com/docker/docker/api/types/versions" + "github.com/dyweb/gommon/httpclient" +) + +// image.go is merged all the image_*.go into one file + +// https://github.com/moby/moby/blob/master/client/image_pull.go difference between pull and create is pull try to auth +// https://github.com/moby/moby/blob/master/client/image_create.go +func (dc *Client) ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error) { + + hCtx := httpclient.ConvertContext(ctx) + + ref, err := reference.ParseNormalizedNamed(refStr) + if err != nil { + return nil, err + } + hCtx.SetParam("fromImage", reference.FamiliarName(ref)) + hCtx.SetParam("tag", getAPITagFromNamedRef(ref)) + if options.Platform != "" { + hCtx.SetParam("platform", strings.ToLower(options.Platform)) + } + // TODO: handle auth, this is needed to pull from private registry + res, err := dc.h.PostRaw(hCtx, "/images/create", nil) + if err != nil { + return nil, err + } + return res.Body, nil +} + +// https://github.com/moby/moby/blob/master/client/image_list.go +func (dc *Client) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) { + var images []types.ImageSummary + + hCtx := httpclient.ConvertContext(ctx) + optionFilters := options.Filters + referenceFilters := optionFilters.Get("reference") + if versions.LessThan(dc.version, "1.25") && len(referenceFilters) > 0 { + hCtx.SetParam("filter", referenceFilters[0]) + for _, filterValue := range referenceFilters { + optionFilters.Del("reference", filterValue) + } + } + if optionFilters.Len() > 0 { + filterJSON, err := filters.ToJSON(optionFilters) + if err != nil { + return images, err + } + hCtx.SetParam("filters", filterJSON) + } + if options.All { + hCtx.SetParam("all", "1") + } + return images, dc.h.Get(hCtx, "/images/json", &images) +} + +// getAPITagFromNamedRef returns a tag from the specified reference. +// This function is necessary as long as the docker "server" api expects +// digests to be sent as tags and makes a distinction between the name +// and tag/digest part of a reference. +func getAPITagFromNamedRef(ref reference.Named) string { + if digested, ok := ref.(reference.Digested); ok { + return digested.Digest().String() + } + ref = reference.TagNameOnly(ref) + if tagged, ok := ref.(reference.Tagged); ok { + return tagged.Tag() + } + return "" +} diff --git a/dockerclient/pkg.go b/dockerclient/pkg.go new file mode 100644 index 0000000..6dd4011 --- /dev/null +++ b/dockerclient/pkg.go @@ -0,0 +1,31 @@ +// Package dockerclient is a slim docker client without importing the moby repo. +package dockerclient + +import ( + "fmt" + + "github.com/dyweb/gommon/util/httputil" +) + +const ( + DefaultVersion = "1.37" + DefaultLocalHost = "unix:///var/run/docker.sock" +) + +type ErrDocker struct { + Method httputil.Method + Url string + Path string + Status int + // Message is the decoded error message from docker daemon + Message string + Body string +} + +func (e *ErrDocker) Error() string { + msg := e.Message + if e.Message == "" { + msg = e.Body + } + return fmt.Sprintf("docke err %s from %d %s %s", msg, e.Status, e.Method, e.Url) +} diff --git a/go.mod b/go.mod index c49ef7a..52c9b6c 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,20 @@ module github.com/dyweb/go.ice go 1.13 require ( + github.com/docker/distribution v2.7.1+incompatible + github.com/docker/docker v1.13.1 + github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/go-units v0.4.0 // indirect github.com/dyweb/gommon v0.0.13 + github.com/gogo/protobuf v1.3.1 // indirect + github.com/opencontainers/go-digest v1.0.0-rc1 // indirect + github.com/opencontainers/image-spec v1.0.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/sirupsen/logrus v1.4.2 // indirect github.com/spf13/cobra v0.0.5 + google.golang.org/grpc v1.27.1 // indirect gopkg.in/yaml.v2 v2.2.7 + gotest.tools v2.2.0+incompatible // indirect ) + +replace github.com/docker/docker v1.13.1 => github.com/docker/engine v0.0.0-20190717161051-705d9623b7c1 diff --git a/go.sum b/go.sum index 706f3bc..d66b8c3 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,8 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -7,20 +10,53 @@ github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwc 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/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= +github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/engine v0.0.0-20190717161051-705d9623b7c1 h1:pKV3lCoWunXtXfyRUcqYflvdaiFU3BMxHw5izMsYDhY= +github.com/docker/engine v0.0.0-20190717161051-705d9623b7c1/go.mod h1:3CPr2caMgTHxxIAZgEMd3uLYPDlRvPqCpyeRf6ncPcY= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dyweb/gommon v0.0.13 h1:SwEex1UakZJVpO37GqiTc0QQ7iOe5Rz+6hQnGh1UePo= github.com/dyweb/gommon v0.0.13/go.mod h1:cdTMuWn9B/9F87Jza4nwI6Ka8z+uT5+WcGDWWKFhnqM= +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/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +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/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= +github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= +github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= @@ -30,16 +66,54 @@ 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.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= 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.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +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-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +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-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/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-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +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/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=