monitor

package
v0.0.0-...-07d49b8 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const StatusDown string = "DOWN"
View Source
const StatusFailed string = "FAILED"
View Source
const StatusTimeout string = "TIMEOUT"
View Source
const StatusUp string = "UP"
View Source
const TelegramNotifierTimeout int = 10

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	Check() (int, string)
}

type Dispatcher

type Dispatcher struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

func NewDispatcher

func NewDispatcher(db *gorm.DB, logger *logrus.Logger) *Dispatcher

func (*Dispatcher) AddService

func (d *Dispatcher) AddService(serviceID uint)

func (*Dispatcher) RemoveService

func (d *Dispatcher) RemoveService(serviceID uint)

func (*Dispatcher) RestartService

func (d *Dispatcher) RestartService(serviceID uint)

func (*Dispatcher) Start

func (d *Dispatcher) Start()

func (*Dispatcher) Stop

func (d *Dispatcher) Stop()

type HTTPCHecker

type HTTPCHecker struct {
	URL                string
	Name               string
	AcceptedStatusCode int
	// contains filtered or unexported fields
}

func NewHTTPCHecker

func NewHTTPCHecker(logger *logrus.Logger, name, url string, timeout, acceptedStatusCode int) *HTTPCHecker

func (*HTTPCHecker) Check

func (c *HTTPCHecker) Check() (int, string)

type Monitor

type Monitor struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor(db *gorm.DB, logger *logrus.Logger, service *model.Service) *Monitor

func (*Monitor) Start

func (m *Monitor) Start()

func (*Monitor) Stop

func (m *Monitor) Stop()

type Notifier

type Notifier interface {
	Notify(message string)
}

type TelegramNotifier

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

func NewTelegramNotifier

func NewTelegramNotifier(logger *logrus.Logger, notification *model.Notification) *TelegramNotifier

func (*TelegramNotifier) Notify

func (n *TelegramNotifier) Notify(message string)

Jump to

Keyboard shortcuts

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