New creates a new Client and loads config from disk.
()
| 29 | |
| 30 | // New creates a new Client and loads config from disk. |
| 31 | func New() (*Client, error) { |
| 32 | c := &Client{ |
| 33 | http: &http.Client{Timeout: 30 * time.Second}, |
| 34 | } |
| 35 | cfg, err := config.Load() |
| 36 | if err != nil { |
| 37 | return nil, err |
| 38 | } |
| 39 | c.Config = cfg |
| 40 | return c, nil |
| 41 | } |
| 42 | |
| 43 | // IsInitialized returns true if credentials are present. |
| 44 | func (c *Client) IsInitialized() bool { |
no test coverage detected