controllers

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KuberController

type KuberController struct {
	Logger *logrus.Logger
}

func (*KuberController) CheckComponent

func (i *KuberController) CheckComponent(ComponentMeta map[string]string) error

func (*KuberController) RunTask

func (i *KuberController) RunTask(taskMeta map[string]string, componentMeta map[string]string) error

func (*KuberController) ValideComponent

func (i *KuberController) ValideComponent(ComponentMeta map[string]string) error

func (*KuberController) ValideTask

func (i *KuberController) ValideTask(TaskMeta map[string]string) error

type PromQLMonitorController

type PromQLMonitorController struct {
	// contains filtered or unexported fields
}

func NewPromQLMonitorController

func NewPromQLMonitorController(logger *logrus.Logger, apiURL string) *PromQLMonitorController

func (*PromQLMonitorController) CheckMonitoring

func (p *PromQLMonitorController) CheckMonitoring(config map[string]string) error

CheckMonitoring — по сути alias для RunCheck, или можешь добавить дополнительную логику

func (*PromQLMonitorController) RunCheck

func (p *PromQLMonitorController) RunCheck(monitorMeta map[string]string) error

RunCheck выполняет запрос к Prometheus API и анализирует результат

func (*PromQLMonitorController) ValidateCheck

func (p *PromQLMonitorController) ValidateCheck(monitorMeta map[string]string) error

ValidateCheck проверяет корректность параметров запроса PromQL

func (*PromQLMonitorController) ValidateMonitoring

func (p *PromQLMonitorController) ValidateMonitoring(config map[string]string) error

ValidateMonitoring — здесь можно проверить конфиг мониторинга, например, таймауты, повторные попытки и т.д. Для упрощения — просто возвращаем nil

type PrometheusQueryData

type PrometheusQueryData struct {
	ResultType string                  `json:"resultType"`
	Result     []PrometheusQueryResult `json:"result"`
}

type PrometheusQueryResponse

type PrometheusQueryResponse struct {
	Status string              `json:"status"`
	Data   PrometheusQueryData `json:"data"`
}

type PrometheusQueryResult

type PrometheusQueryResult struct {
	Metric map[string]string `json:"metric"`
	Value  [2]interface{}    `json:"value"` // [ timestamp, value ]
}

type SSHController

type SSHController struct {
	Logger *logrus.Logger
}

func (*SSHController) CheckComponent

func (s *SSHController) CheckComponent(componentMeta map[string]string) error

func (*SSHController) RunTask

func (s *SSHController) RunTask(taskMeta map[string]string, componentMeta map[string]string) error

func (*SSHController) ValideComponent

func (s *SSHController) ValideComponent(componentMeta map[string]string) error

func (*SSHController) ValideTask

func (s *SSHController) ValideTask(taskMeta map[string]string) error

Jump to

Keyboard shortcuts

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