services

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckServiceHealth

func CheckServiceHealth(serviceType, url, apiKey string) (models.ServiceHealth, int)

CheckServiceHealth performs the health check for a given service using the registry pattern

Types

type HealthCheck

type HealthCheck struct {
	Status          string    `json:"status"`
	ResponseTime    int64     `json:"responseTime"`
	Message         string    `json:"message,omitempty"`
	Version         string    `json:"version,omitempty"`
	LastChecked     time.Time `json:"lastChecked"`
	UpdateAvailable bool      `json:"updateAvailable,omitempty"`
}

type HealthService

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

func NewHealthService

func NewHealthService() *HealthService

func (*HealthService) Cleanup

func (h *HealthService) Cleanup()

Cleanup stops all monitoring

func (*HealthService) GetAllHealth

func (h *HealthService) GetAllHealth() map[string]*HealthCheck

func (*HealthService) GetHealth

func (h *HealthService) GetHealth(instanceID string) *HealthCheck

func (*HealthService) StartMonitoring

func (h *HealthService) StartMonitoring(instanceID string, checkFn func(context.Context) (*HealthCheck, error))

func (*HealthService) StopMonitoring

func (h *HealthService) StopMonitoring(instanceID string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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