commit - 8635d20e62566f62e2365441d2091b721cd8ef71
commit + 83f511305d76af055cecefced0265cee26d63d75
blob - f7e037875aad09f3f9c8d9d471b89047f21183d9
blob + 3a84467cec091e7f675eb95959ffdcaac04a5ec6
--- http.go
+++ http.go
}
func (c *Client) get(path string) (*http.Response, error) {
- req, err := newRequest(http.MethodGet, c.host, path, nil)
+ req, err := newRequest(http.MethodGet, c.addr, path, nil)
if err != nil {
return nil, err
}
}
func (c *Client) post(path string, body io.Reader) (*http.Response, error) {
- req, err := newRequest(http.MethodPost, c.host, path, body)
+ req, err := newRequest(http.MethodPost, c.addr, path, body)
if err != nil {
return nil, err
}
}
func (c *Client) put(path string, body io.Reader) error {
- req, err := newRequest(http.MethodPut, c.host, path, body)
+ req, err := newRequest(http.MethodPut, c.addr, path, body)
if err != nil {
return err
}
}
func (c *Client) delete(path string) error {
- req, err := newRequest(http.MethodDelete, c.host, path, nil)
+ req, err := newRequest(http.MethodDelete, c.addr, path, nil)
if err != nil {
return err
}
blob - a268dee69097cbccbda0932108fc00149c0685ef
blob + 192b34d6811b50bb362732c15399eae8ab09f608
--- icinga.go
+++ icinga.go
"net/http"
)
+type State int
+
+const (
+ StateOK State = 0 + iota
+ StateWarning
+ StateCritical
+ StateUnknown
+)
+
+const (
+ HostUp State = 0 + iota
+ HostDown
+ HostUnknown
+)
+
// A Client represents a client connection to the Icinga2 HTTP API.
// It should be created using Dial.
// Since Client wraps http.Client, standard methods such as Get and