Skip to content

Commit

Permalink
chore: renovate dependencies
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
dnwe committed Apr 29, 2021
1 parent 115744c commit f135051
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 75 deletions.
99 changes: 56 additions & 43 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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",
Expand All @@ -93,13 +93,15 @@ func main() {
Usage: "create a new proxy\n\tusage: 'toxiproxy-cli create <proxyName> --listen <addr> --upstream <addr>'\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),
Expand All @@ -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: "<proxyName>",
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),
Expand All @@ -161,17 +169,20 @@ func main() {
Usage: "update an enabled toxic",
ArgsUsage: "<proxyName>",
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),
Expand All @@ -182,23 +193,25 @@ func main() {
Usage: "remove an enabled toxic",
ArgsUsage: "<proxyName>",
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),
},
},
},
}
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,
Expand Down
13 changes: 5 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
)
45 changes: 21 additions & 24 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=

0 comments on commit f135051

Please sign in to comment.