monitor

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: GPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents an SSE client connection to a monitor agent

func (*Client) IsConnected

func (c *Client) IsConnected() (bool, *types.MonitorLiveData)

IsConnected returns the connection status and last data

func (*Client) Start

func (c *Client) Start()

Start starts the client connection

func (*Client) Stop

func (c *Client) Stop()

Stop stops the client connection

type Notifier

type Notifier interface {
	SendAgentNotification(agentName string, eventType string, value *float64) error
}

Notifier interface for sending notifications

type Service

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

Service manages all monitoring clients

func NewService

func NewService(db database.Service, cfg *config.MonitorConfig, broadcastFunc func(types.MonitorUpdate), notifier Notifier) *Service

NewService creates a new monitor service

func NewServiceWithTailscale

func NewServiceWithTailscale(db database.Service, cfg *config.MonitorConfig, tsCfg *config.TailscaleConfig, broadcastFunc func(types.MonitorUpdate), notifier Notifier) *Service

NewServiceWithTailscale creates a new monitor service with Tailscale support

func (*Service) GetAgentStatus

func (s *Service) GetAgentStatus(agentID int64) (bool, *types.MonitorLiveData)

GetAgentStatus returns the status of an agent

func (*Service) GetTailscaleStatus

func (s *Service) GetTailscaleStatus() (map[string]interface{}, error)

GetTailscaleStatus returns the Tailscale status from the discovery service

func (*Service) Start

func (s *Service) Start() error

Start starts the monitor service

func (*Service) StartAgent

func (s *Service) StartAgent(agentID int64) error

StartAgent starts monitoring a specific agent

func (*Service) Stop

func (s *Service) Stop()

Stop stops the monitor service

func (*Service) StopAgent

func (s *Service) StopAgent(agentID int64)

StopAgent stops monitoring a specific agent

type TailscaleDiscovery

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

TailscaleDiscovery handles automatic discovery of Tailscale-connected agents

func NewTailscaleDiscovery

func NewTailscaleDiscovery(cfg *config.TailscaleConfig, service *Service) *TailscaleDiscovery

NewTailscaleDiscovery creates a new Tailscale discovery service

func (*TailscaleDiscovery) GetTailscaleStatus

func (td *TailscaleDiscovery) GetTailscaleStatus() (map[string]interface{}, error)

GetTailscaleStatus returns the current Tailscale status for the discovery service

func (*TailscaleDiscovery) Start

func (td *TailscaleDiscovery) Start(ctx context.Context) error

Start initializes Tailscale connection and begins discovery

func (*TailscaleDiscovery) Stop

func (td *TailscaleDiscovery) Stop()

Stop stops the discovery service

Jump to

Keyboard shortcuts

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