diff options
Diffstat (limited to 'vendor/github.com/armon/consul-api/status.go')
-rw-r--r-- | vendor/github.com/armon/consul-api/status.go | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/vendor/github.com/armon/consul-api/status.go b/vendor/github.com/armon/consul-api/status.go deleted file mode 100644 index 21c31982..00000000 --- a/vendor/github.com/armon/consul-api/status.go +++ /dev/null @@ -1,43 +0,0 @@ -package consulapi - -// Status can be used to query the Status endpoints -type Status struct { - c *Client -} - -// Status returns a handle to the status endpoints -func (c *Client) Status() *Status { - return &Status{c} -} - -// Leader is used to query for a known leader -func (s *Status) Leader() (string, error) { - r := s.c.newRequest("GET", "/v1/status/leader") - _, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return "", err - } - defer resp.Body.Close() - - var leader string - if err := decodeBody(resp, &leader); err != nil { - return "", err - } - return leader, nil -} - -// Peers is used to query for a known raft peers -func (s *Status) Peers() ([]string, error) { - r := s.c.newRequest("GET", "/v1/status/peers") - _, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var peers []string - if err := decodeBody(resp, &peers); err != nil { - return nil, err - } - return peers, nil -} |