Skip to content

Commit

Permalink
Minor json polish and doc for http client config
Browse files Browse the repository at this point in the history
  • Loading branch information
arriven committed Mar 1, 2022
1 parent 88baee8 commit 9555330
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ The config is expected to be in json format and has following configuration valu
- `path` - `[string]` url path to use (passed directly to go `http.NewRequest`)
- `body` - `[object]` http payload to use (passed directly to go `http.NewRequest`)
- `headers` - `[object]` key-value map of http headers
- `client` - `[object]` http client config for the job
- `client.tls_config` - `[object]` tls config for transport (InsecureSkipVerify is true by default)
- `client.proxy_urls` - `[array]` string urls for proxies to use (chosen randomly for each request)
- `client.timeout` - `[time.Duration]`
- `client.max_idle_connections` - `[number]`

`tcp` and `udp` shared args:

Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ func parseStringTemplate(input string) string {

func httpJob(ctx context.Context, l *logs.Logger, args JobArgs) error {
type HTTPClientConfig struct {
TLSClientConfig *tls.Config `json:"tls_config,omitempty"`
Timeout *time.Duration
MaxIdleConns *int
ProxyURLs []string `json:"proxy_urls"`
TLSClientConfig *tls.Config `json:"tls_config,omitempty"`
Timeout *time.Duration `json:"timeout"`
MaxIdleConns *int `json:"max_idle_connections"`
ProxyURLs []string `json:"proxy_urls"`
}
type httpJobConfig struct {
BasicJobConfig
Expand Down

0 comments on commit 9555330

Please sign in to comment.