NewClient returns a new configuration object for clients.
()
| 108 | |
| 109 | // NewClient returns a new configuration object for clients. |
| 110 | func NewClient() *Client { |
| 111 | c := &Client{ |
| 112 | Authentication: &Authentication{}, |
| 113 | } |
| 114 | err := c.Sanitize() |
| 115 | if err != nil { |
| 116 | panic(fmt.Sprintf("failed to create a new client configuration: %v", err)) |
| 117 | } |
| 118 | return c |
| 119 | } |
| 120 | |
| 121 | // Sanitize sets default values to empty configuration variables, if it's possible. |
| 122 | func (c *Client) Sanitize() error { |