api

package
v0.0.0-...-8fead6e Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2019 License: GPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	R *mux.Router
	// contains filtered or unexported fields
}

API is a wrapper around a HTTP router and supporting data.

func NewAPI

func NewAPI(s *alerts.State, logger *zap.Logger) *API

NewAPI creates a new API object.

func (*API) GetAlertByHash

func (a *API) GetAlertByHash(w http.ResponseWriter, r *http.Request)

GetAlertByHash returns the alert data according to the specified hash.

func (*API) GetLastUpdated

func (a *API) GetLastUpdated(w http.ResponseWriter, r *http.Request)

GetLastUpdated gets the time when the Cache was last updated.

func (*API) GetRelated

func (a *API) GetRelated(w http.ResponseWriter, r *http.Request)

GetRelated gets the list of related alerts according to the name and label set.

Jump to

Keyboard shortcuts

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