8 2c4d16ae 2021-12-23 o type Client struct {
10 b74ab3b3 2021-12-30 o username string
11 b74ab3b3 2021-12-30 o password string
15 2c4d16ae 2021-12-23 o func Dial(host, username, password string, client *http.Client) (*Client, error) {
16 2c4d16ae 2021-12-23 o c := &Client{host, username, password, client}
17 2c4d16ae 2021-12-23 o if _, err := c.Status(); err != nil {
18 2c4d16ae 2021-12-23 o return nil, err
23 2c4d16ae 2021-12-23 o func (c *Client) Status() (*http.Response, error) {
24 2c4d16ae 2021-12-23 o resp, err := c.get("/status")
25 2c4d16ae 2021-12-23 o if err != nil {
26 2c4d16ae 2021-12-23 o return nil, err
28 2c4d16ae 2021-12-23 o if resp.StatusCode != http.StatusOK {
29 2c4d16ae 2021-12-23 o return resp, fmt.Errorf("status %s", resp.Status)
31 2c4d16ae 2021-12-23 o return resp, nil