mock

package
v1.4.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetPrometheusResponse

func SetPrometheusResponse(monitorName, monitorNamespace string, mp *MonitorParams, fw portforward.PortForward) error

Types

type ActiveTargets

type ActiveTargets struct {
	DiscoveredLabels DiscoveredLabels `json:"discoveredLabels"`
	Health           string           `json:"health"`
}

type DiscoveredLabels

type DiscoveredLabels struct {
	Job     string `json:"job"`
	PodName string `json:"__meta_kubernetes_pod_name"`
}

type MonitorInterface

type MonitorInterface interface {
	ServeQuery(w http.ResponseWriter, r *http.Request)
	ServeTargets(w http.ResponseWriter, r *http.Request)
	SetResponse(w http.ResponseWriter, r *http.Request)
}

func NewMockPrometheus

func NewMockPrometheus() MonitorInterface

type MonitorParams

type MonitorParams struct {
	KubernetesNamespace string   `json:"kubernetesNamespace"`
	Name                string   `json:"name"`
	MemberType          string   `json:"memberType"`
	Duration            string   `json:"duration"`
	Value               string   `json:"value"`
	InstancesPod        []string `json:"instances"`
	QueryType           string   `json:"queryType"`
	StorageType         string   `json:"storageType"`
}

type MonitorTargets

type MonitorTargets struct {
	Status string             `json:"status"`
	Data   MonitorTargetsData `json:"data"`
}

type MonitorTargetsData

type MonitorTargetsData struct {
	ActiveTargets []ActiveTargets `json:"activeTargets"`
}

Jump to

Keyboard shortcuts

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