server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateStage

func CreateStage(s store.DataStore) http.HandlerFunc

func DeleteStage

func DeleteStage(s store.DataStore) http.HandlerFunc

func FetchAlerts

func FetchAlerts(cfg *config.ServerConfig) http.HandlerFunc

func FetchAvailableServices

func FetchAvailableServices(cfg *config.ServerConfig) http.HandlerFunc

func FetchMetrics

func FetchMetrics(cfg *config.ServerConfig) http.HandlerFunc

func GetGraph

func GetGraph(s store.DataStore) http.HandlerFunc

func SaveStage

func SaveStage(s store.DataStore) http.HandlerFunc

Types

type AvailableServicesResponse

type AvailableServicesResponse struct {
	AvailableServices []string `json:"available_services"`
}

type Metric

type Metric struct {
	Metric map[string]string `json:"metric"`
	Value  [][]interface{}   `json:"values"`
}

type MetricResponse

type MetricResponse struct {
	// map service_id => query => value
	Metrics map[string]map[string][]TSValue `json:"metrics"`
}

type QueryResult

type QueryResult struct {
	Status string `json:"status"`
	Data   struct {
		Type   string   `json:"resultType"`
		Result []Metric `json:"result"`
	} `json:"data"`
}

type RulesResponse

type RulesResponse struct {
	Status string           `json:"status"`
	Data   prom.RulesResult `json:"data"`
}

type Server

type Server struct {
	http.Server
	ServerConfig *config.ServerConfig
	DiskStore    *store.DiskStore
}

Server ..

func New

func New(cfg *config.ServerConfig, staticDir, dataDir string) *Server

New ..

type TSValue

type TSValue struct {
	Date  string  `json:"date"`
	Value float64 `json:"value"`
}

Jump to

Keyboard shortcuts

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