alertclient

package
v0.0.0-...-4448a72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: BSD-3-Clause Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// We directly access alerts from Kubernetes pod to pod
	// so https is not required.
	API_INCIDENTS_PATTERN = "http://%s/_/incidents"
	API_SILENCES_PATTERN  = "http://%s/_/silences"
)

Variables

This section is empty.

Functions

func New

func New(hc HTTPClient, server string) *apiclient

New creates a new APIClient with the given parameters.

Types

type APIClient

type APIClient interface {
	// GetAlerts fetches all alerts from the server and returns them in a slice.
	GetAlerts() ([]incident.Incident, error)
	// GetSilences fetches all silences from the server and returns them in a slice.
	GetSilences() ([]silence.Silence, error)
}

type HTTPClient

type HTTPClient interface {
	Get(url string) (*http.Response, error)
}

HTTPClient represents the http calls needed by the client. This interface is a subset of http.Client and makes for easier mocking.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL