FetchSettings returns the calnex settings
()
| 706 | } |
| 707 | |
| 708 | // FetchSettings returns the calnex settings |
| 709 | func (a *API) FetchSettings() (*ini.File, error) { |
| 710 | url := fmt.Sprintf(getSettingsURL, a.source) |
| 711 | resp, err := a.Client.Get(url) |
| 712 | if err != nil { |
| 713 | return nil, err |
| 714 | } |
| 715 | defer resp.Body.Close() |
| 716 | |
| 717 | if resp.StatusCode != http.StatusOK { |
| 718 | return nil, errors.New(http.StatusText(resp.StatusCode)) |
| 719 | } |
| 720 | |
| 721 | return ini.Load(resp.Body) |
| 722 | } |
| 723 | |
| 724 | // FetchStatus returns the calnex status |