/
options.go
34 lines (29 loc) · 1002 Bytes
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package client
import (
"time"
"github.com/americanas-go/ignite"
)
type Options struct {
Name string
NoDefaultUserAgentHeader bool
MaxConnsPerHost int
ReadBufferSize int
WriteBufferSize int
MaxConnWaitTimeout time.Duration
ReadTimeout time.Duration
WriteTimeout time.Duration
MaxIdleConnDuration time.Duration
MaxConnDuration time.Duration
DisableHeaderNamesNormalizing bool
DialDualStack bool
MaxResponseBodySize int
MaxIdemponentCallAttempts int
}
// NewOptions returns options from config file or environment vars.
func NewOptions() (*Options, error) {
return ignite.NewOptionsWithPath[Options](root)
}
// NewOptionsWithPath unmarshals a given key path into options and returns it.
func NewOptionsWithPath(path string) (opts *Options, err error) {
return ignite.NewOptionsWithPath[Options](root, path)
}