From f1350515cde41c9160574e46339c397a82b02142 Mon Sep 17 00:00:00 2001 From: Dominic Evans Date: Thu, 29 Apr 2021 22:53:18 +0100 Subject: [PATCH] chore: renovate dependencies - move to github.com/urface/cli/v2 API - refresh all dependencies to @latest - golang.org/x/crypto/ssh/terminal moved to golang.org/x/term --- cli/cli.go | 99 ++++++++++++++++++++++++++++++------------------------ go.mod | 13 +++---- go.sum | 45 ++++++++++++------------- 3 files changed, 82 insertions(+), 75 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index 91ccdf61..fca1254f 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -9,8 +9,8 @@ import ( toxiproxyServer "github.com/Shopify/toxiproxy" "github.com/Shopify/toxiproxy/client" - "github.com/urfave/cli" - "golang.org/x/crypto/ssh/terminal" + "github.com/urfave/cli/v2" + terminal "golang.org/x/term" ) const ( @@ -75,7 +75,7 @@ func main() { app.Name = "toxiproxy-cli" app.Version = toxiproxyServer.Version app.Usage = "Simulate network and system conditions" - app.Commands = []cli.Command{ + app.Commands = []*cli.Command{ { Name: "list", Usage: "list all proxies\n\tusage: 'toxiproxy-cli list'\n", @@ -93,13 +93,15 @@ func main() { Usage: "create a new proxy\n\tusage: 'toxiproxy-cli create --listen --upstream '\n", Aliases: []string{"c", "new"}, Flags: []cli.Flag{ - cli.StringFlag{ - Name: "listen, l", - Usage: "proxy will listen on this address", + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "proxy will listen on this address", }, - cli.StringFlag{ - Name: "upstream, u", - Usage: "proxy will forward to this address", + &cli.StringFlag{ + Name: "upstream", + Aliases: []string{"u"}, + Usage: "proxy will forward to this address", }, }, Action: withToxi(createProxy), @@ -121,36 +123,42 @@ func main() { Aliases: []string{"t"}, Usage: "\tadd, remove or update a toxic\n\t\tusage: see 'toxiproxy-cli toxic'\n", Description: toxicDescription, - Subcommands: []cli.Command{ + Subcommands: []*cli.Command{ { Name: "add", Aliases: []string{"a"}, Usage: "add a new toxic", ArgsUsage: "", Flags: []cli.Flag{ - cli.StringFlag{ - Name: "toxicName, n", - Usage: "name of the toxic", + &cli.StringFlag{ + Name: "toxicName", + Aliases: []string{"n"}, + Usage: "name of the toxic", }, - cli.StringFlag{ - Name: "type, t", - Usage: "type of toxic", + &cli.StringFlag{ + Name: "type", + Aliases: []string{"t"}, + Usage: "type of toxic", }, - cli.StringFlag{ - Name: "toxicity, tox", - Usage: "toxicity of toxic", + &cli.StringFlag{ + Name: "toxicity", + Aliases: []string{"tox"}, + Usage: "toxicity of toxic", }, - cli.StringSliceFlag{ - Name: "attribute, a", - Usage: "toxic attribute in key=value format", + &cli.StringSliceFlag{ + Name: "attribute", + Aliases: []string{"a"}, + Usage: "toxic attribute in key=value format", }, - cli.BoolFlag{ - Name: "upstream, u", - Usage: "add toxic to upstream", + &cli.BoolFlag{ + Name: "upstream", + Aliases: []string{"u"}, + Usage: "add toxic to upstream", }, - cli.BoolFlag{ - Name: "downstream, d", - Usage: "add toxic to downstream", + &cli.BoolFlag{ + Name: "downstream", + Aliases: []string{"d"}, + Usage: "add toxic to downstream", }, }, Action: withToxi(addToxic), @@ -161,17 +169,20 @@ func main() { Usage: "update an enabled toxic", ArgsUsage: "", Flags: []cli.Flag{ - cli.StringFlag{ - Name: "toxicName, n", - Usage: "name of the toxic", + &cli.StringFlag{ + Name: "toxicName", + Aliases: []string{"n"}, + Usage: "name of the toxic", }, - cli.StringFlag{ - Name: "toxicity, tox", - Usage: "toxicity of toxic", + &cli.StringFlag{ + Name: "toxicity", + Aliases: []string{"tox"}, + Usage: "toxicity of toxic", }, - cli.StringSliceFlag{ - Name: "attribute, a", - Usage: "toxic attribute in key=value format", + &cli.StringSliceFlag{ + Name: "attribute", + Aliases: []string{"a"}, + Usage: "toxic attribute in key=value format", }, }, Action: withToxi(updateToxic), @@ -182,9 +193,10 @@ func main() { Usage: "remove an enabled toxic", ArgsUsage: "", Flags: []cli.Flag{ - cli.StringFlag{ - Name: "toxicName, n", - Usage: "name of the toxic", + &cli.StringFlag{ + Name: "toxicName", + Aliases: []string{"n"}, + Usage: "name of the toxic", }, }, Action: withToxi(removeToxic), @@ -192,13 +204,14 @@ func main() { }, }, } - cli.HelpFlag = cli.BoolFlag{ + cli.HelpFlag = &cli.BoolFlag{ Name: "help", Usage: "show help", } app.Flags = []cli.Flag{ - cli.StringFlag{ - Name: "host, h", + &cli.StringFlag{ + Name: "host", + Aliases: []string{"h"}, Value: "http://localhost:8474", Usage: "toxiproxy host to connect to", Destination: &hostname, diff --git a/go.mod b/go.mod index 4322b1ce..82f91629 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,11 @@ module github.com/Shopify/toxiproxy -go 1.12 +go 1.15 require ( - github.com/gorilla/mux v1.7.2 - github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect - github.com/sirupsen/logrus v1.4.2 - github.com/stretchr/testify v1.3.0 // indirect - github.com/urfave/cli v1.20.0 - golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 - golang.org/x/sys v0.0.0-20190606165138-5da285871e9c // indirect + github.com/gorilla/mux v1.8.0 + github.com/sirupsen/logrus v1.8.1 + github.com/urfave/cli/v2 v2.3.0 + golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 ) diff --git a/go.sum b/go.sum index 11fd227e..b436cbd0 100644 --- a/go.sum +++ b/go.sum @@ -1,31 +1,28 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +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/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/gorilla/mux v1.7.2 h1:zoNxOV7WjqXptQOVngLmcSQgXmgk4NMz1HibBchjl/I= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -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 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= 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/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -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/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/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.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -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-20190606165138-5da285871e9c h1:+EXw7AwNOKzPFXMZ1yNjO40aWCh3PIquJB2fYlv9wcs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=