Documentation ¶
Index ¶
Constants ¶
View Source
const ( // The different API error types. ErrBadData ErrorType = "bad_data" ErrTimeout = "timeout" ErrCanceled = "canceled" ErrExec = "execution" ErrBadResponse = "bad_response" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertAPI ¶
type AlertAPI interface { // List all the active alerts. List(ctx context.Context) ([]*model.Alert, error) // Push a list of alerts into the Alertmanager. Push(ctx context.Context, alerts ...*model.Alert) error }
func NewAlertAPI ¶
NewAlertAPI returns a new AlertAPI for the client.
type CancelableTransport ¶
type CancelableTransport interface { http.RoundTripper CancelRequest(req *http.Request) }
CancelableTransport is like net.Transport but provides per-request cancelation functionality.
type Config ¶
type Config struct { // The address of the Prometheus to connect to. Address string // Transport is used by the Client to drive HTTP requests. If not // provided, DefaultTransport will be used. Transport CancelableTransport }
Config defines configuration parameters for a new client.
type SilenceAPI ¶
type SilenceAPI interface { // Get returns the silence associated with the given ID. Get(ctx context.Context, id uint64) (*model.Silence, error) // Set updates or creates the given silence and returns its ID. Set(ctx context.Context, sil *model.Silence) (uint64, error) // Del deletes the silence with the given ID. Del(ctx context.Context, id uint64) error // List all silences of the server. List(ctx context.Context) ([]*model.Silence, error) }
SilenceAPI provides bindings the Alertmanager's silence API.
func NewSilenceAPI ¶
func NewSilenceAPI(c Client) SilenceAPI
NewSilenceAPI returns a new SilenceAPI for the client.
Click to show internal directories.
Click to hide internal directories.