prober

package
v0.0.0-...-47ae3e1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotRunning    = errors.New("no probing in progress")
	ErrServerClosed  = errors.New("controller has shut down")
	ErrReloadPending = errors.New("reload already in progress")
)
View Source
var (
	DefaultMonitorName = "unknown"
)

Functions

This section is empty.

Types

type Controller

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

func NewController

func NewController(config string, opts ControllerOptions) *Controller

func (*Controller) Reload

func (c *Controller) Reload(ctx context.Context) error

func (*Controller) ReloadMonitors

func (c *Controller) ReloadMonitors(m ...*Monitor) error

func (*Controller) Run

func (c *Controller) Run() error

func (*Controller) Stats

func (c *Controller) Stats() []Stats

func (*Controller) Stop

func (c *Controller) Stop() error

type ControllerOptions

type ControllerOptions struct {
	Logger      *slog.Logger
	ProbeLogger *slog.Logger
}

type Monitor

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

func NewMonitor

func NewMonitor(module string, strat probe.Strategy, prober probe.Prober, opts MonitorOptions) *Monitor

func (*Monitor) Delay

func (m *Monitor) Delay() time.Duration

func (*Monitor) Interval

func (m *Monitor) Interval() time.Duration

func (*Monitor) Module

func (m *Monitor) Module() string

func (*Monitor) Monitor

func (m *Monitor) Monitor(ctx context.Context, logger *slog.Logger) error

func (*Monitor) Probe

func (m *Monitor) Probe() probe.Strategy

func (*Monitor) Stats

func (m *Monitor) Stats() Stats

func (*Monitor) Timeout

func (m *Monitor) Timeout() time.Duration

type MonitorOptions

type MonitorOptions struct {
	Logger *slog.Logger

	Delay    time.Duration
	Interval time.Duration
	Timeout  time.Duration
}

type Stats

type Stats struct {
	Module string
	Probe  probe.Strategy

	TotalSuccess  int64
	TotalFailures int64
	AvgExecution  float64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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