NewClient returns a new UAA Client with the provided configuration
(config Config)
| 25 | |
| 26 | // NewClient returns a new UAA Client with the provided configuration |
| 27 | func NewClient(config Config) *Client { |
| 28 | userAgent := fmt.Sprintf("%s/%s (%s; %s %s)", |
| 29 | config.BinaryName(), |
| 30 | config.BinaryVersion(), |
| 31 | runtime.Version(), |
| 32 | runtime.GOARCH, |
| 33 | runtime.GOOS, |
| 34 | ) |
| 35 | |
| 36 | client := Client{ |
| 37 | config: config, |
| 38 | |
| 39 | connection: NewConnection(config.SkipSSLValidation(), config.UAADisableKeepAlives(), config.DialTimeout()), |
| 40 | userAgent: userAgent, |
| 41 | } |
| 42 | client.WrapConnection(NewErrorWrapper()) |
| 43 | |
| 44 | return &client |
| 45 | } |