Skip to content

Commit

Permalink
cleanup deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
tednaleid committed May 4, 2024
1 parent ec28837 commit 3663dcd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
24 changes: 5 additions & 19 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ func SetupCommand(
conf := config.New()

command := cli.Command{
Name: "ganda",
Name: "ganda",
Usage: "make http requests in parallel",
Authors: []any{
"Ted Naleid <contact@naleid.com>",
},
UsageText: "ganda [options] [file of urls/requests] OR <urls/requests on stdout> | ganda [options]",
Description: "Pipe urls to ganda over stdout or give it a file with one url per line for it to make http requests to each url in parallel.",
UsageText: "<urls/requests on stdout> | ganda [options]",
Description: "Pipe urls to ganda over stdout for it to make http requests to each url in parallel.",
Version: buildInfo.ToString(),
Reader: in,
Writer: stdout,
Expand Down Expand Up @@ -84,22 +85,7 @@ func SetupCommand(
Value: conf.ConnectTimeoutMillis,
Destination: &conf.ConnectTimeoutMillis,
},
&cli.StringFlag{
Name: "data-template",
Aliases: []string{"d"},
Usage: "template string (or literal string) for the body, can use %s placeholders that will be replaced by fields 1..N from the input (all fields on a line after the url), '%%' can be used to insert a single percent symbol",
Destination: &conf.DataTemplate,
},
&cli.BoolFlag{
Name: "discard-body",
Usage: "EXPERIMENTAL: instead of emitting full body, just discard it",
Destination: &conf.DiscardBody,
},
&cli.BoolFlag{
Name: "hash-body",
Usage: "EXPERIMENTAL: instead of emitting full body in JSON, emit the SHA256 of the bytes of the body, useful for checksums, only has meaning with --json-envelope flag",
Destination: &conf.HashBody,
},

&cli.StringSliceFlag{
Name: "header",
Aliases: []string{"H"},
Expand Down
6 changes: 0 additions & 6 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ type Config struct {
BaseRetryDelayMillis int64
Color bool
ConnectTimeoutMillis int64
DataTemplate string
DiscardBody bool
HashBody bool
Insecure bool
JsonEnvelope bool
RequestFilename string
Expand All @@ -33,9 +30,6 @@ func New() *Config {
BaseRetryDelayMillis: 1_000,
Color: false,
ConnectTimeoutMillis: 10_000,
DataTemplate: "",
DiscardBody: false,
HashBody: false,
Insecure: false,
JsonEnvelope: false,
RequestMethod: "GET",
Expand Down
4 changes: 0 additions & 4 deletions execcontext/execcontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ type Context struct {
BaseDirectory string
BaseRetryDelayDuration time.Duration
ConnectTimeoutDuration time.Duration
DiscardBody bool
HashBody bool
In io.Reader
Insecure bool
JsonEnvelope bool
Expand All @@ -40,8 +38,6 @@ func New(conf *config.Config, in io.Reader, stderr io.Writer, stdout io.Writer)
BaseDirectory: conf.BaseDirectory,
BaseRetryDelayDuration: time.Duration(conf.BaseRetryDelayMillis) * time.Millisecond,
ConnectTimeoutDuration: time.Duration(conf.ConnectTimeoutMillis) * time.Millisecond,
DiscardBody: conf.DiscardBody,
HashBody: conf.HashBody,
In: in,
Insecure: conf.Insecure,
JsonEnvelope: conf.JsonEnvelope,
Expand Down

0 comments on commit 3663dcd

Please sign in to comment.