Documentation
¶
Index ¶
- func NewGRPCChecker() *gRPCChecker
- func RegisterChecker(c Checker)
- type AlertDispatcher
- type Checker
- type CheckerRegistry
- type CircuitBreakerConfig
- type DNSChecker
- type Engine
- func (e *Engine) AssignSouls(souls []*core.Soul)
- func (e *Engine) Config() EngineConfig
- func (e *Engine) ForceCheck(soulID string) (*core.Judgment, error)
- func (e *Engine) GetSoulStatus(soulID string) (*core.SoulStatus, error)
- func (e *Engine) GetStatus() *core.ProbeStatus
- func (e *Engine) ListActiveSouls() []*core.Soul
- func (e *Engine) SetOnJudgment(fn func(*core.Judgment))
- func (e *Engine) Stats() map[string]interface{}
- func (e *Engine) Stop()
- func (e *Engine) TriggerImmediate(ctx context.Context, soulID string) (*core.Judgment, error)
- type EngineConfig
- type EngineOptions
- type HTTPChecker
- type ICMPChecker
- type IMAPChecker
- type SMTPChecker
- type Storage
- type TCPChecker
- type TLSChecker
- type UDPChecker
- type WebSocketChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterChecker ¶
func RegisterChecker(c Checker)
RegisterChecker registers a checker with the global registry
Types ¶
type AlertDispatcher ¶
type AlertDispatcher interface {
ProcessJudgment(soul *core.Soul, prevStatus core.SoulStatus, judgment *core.Judgment)
}
AlertDispatcher is the interface for firing alerts
type Checker ¶
type Checker interface {
// Type returns the protocol identifier
Type() core.CheckType
// Judge performs the health check against the given soul
Judge(ctx context.Context, soul *core.Soul) (*core.Judgment, error)
// Validate ensures the soul configuration is valid for this checker
Validate(soul *core.Soul) error
}
Checker is the interface every protocol must implement. Named after the priests who assisted Anubis in the weighing ceremony.
func GetChecker ¶
GetChecker returns a checker by type from the global registry
type CheckerRegistry ¶
type CheckerRegistry struct {
// contains filtered or unexported fields
}
CheckerRegistry maps check types to their implementations
func NewCheckerRegistry ¶
func NewCheckerRegistry() *CheckerRegistry
NewCheckerRegistry creates a new registry with all built-in checkers
func (*CheckerRegistry) Get ¶
func (r *CheckerRegistry) Get(t core.CheckType) (Checker, bool)
Get retrieves a checker by type
func (*CheckerRegistry) List ¶
func (r *CheckerRegistry) List() []core.CheckType
List returns all registered checker types
func (*CheckerRegistry) Register ¶
func (r *CheckerRegistry) Register(c Checker)
Register adds a checker to the registry
type CircuitBreakerConfig ¶ added in v0.0.2
type CircuitBreakerConfig struct {
Enabled bool // Enable circuit breaker
FailureThreshold int // Failures before opening (default: 5)
SuccessThreshold int // Successes before closing (default: 3)
Timeout time.Duration // Time before attempting again (default: 30s)
}
CircuitBreakerConfig configures circuit breaker behavior
type DNSChecker ¶
type DNSChecker struct{}
DNSChecker implements DNS resolution checks
func (*DNSChecker) Type ¶
func (c *DNSChecker) Type() core.CheckType
Type returns the protocol identifier
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the probe scheduling and execution engine. It manages the lifecycle of all soul checks on this Jackal.
func (*Engine) AssignSouls ¶
AssignSouls sets the souls this Jackal is responsible for checking. Called by the Raft leader when distributing checks. Souls with region restrictions are filtered to only run on matching probes.
func (*Engine) Config ¶ added in v0.0.2
func (e *Engine) Config() EngineConfig
Config returns the engine configuration
func (*Engine) ForceCheck ¶
ForceCheck triggers an immediate check (REST API compatible)
func (*Engine) GetSoulStatus ¶
func (e *Engine) GetSoulStatus(soulID string) (*core.SoulStatus, error)
GetSoulStatus returns the current status of a soul
func (*Engine) GetStatus ¶
func (e *Engine) GetStatus() *core.ProbeStatus
GetStatus returns probe engine status (REST API compatible)
func (*Engine) ListActiveSouls ¶
ListActiveSouls returns all currently assigned souls
func (*Engine) SetOnJudgment ¶ added in v0.1.0
SetOnJudgment sets the callback function for judgment events
type EngineConfig ¶ added in v0.0.2
type EngineConfig struct {
MaxConcurrentChecks int // Maximum concurrent checks (default: 100)
CircuitBreaker CircuitBreakerConfig
NodeID string
Region string
}
EngineConfig configures probe engine behavior
func DefaultEngineConfig ¶ added in v0.0.2
func DefaultEngineConfig() EngineConfig
DefaultEngineConfig returns default engine configuration
type EngineOptions ¶
type EngineOptions struct {
Registry *CheckerRegistry
Store Storage
Alerter AlertDispatcher
NodeID string
Region string
Logger *slog.Logger
OnJudgment func(*core.Judgment)
Config EngineConfig
}
EngineOptions configures the probe engine
type HTTPChecker ¶
type HTTPChecker struct {
// contains filtered or unexported fields
}
HTTPChecker implements HTTP/HTTPS health checks
func (*HTTPChecker) Type ¶
func (c *HTTPChecker) Type() core.CheckType
Type returns the protocol identifier
type ICMPChecker ¶
type ICMPChecker struct{}
ICMPChecker implements ICMP ping checks
func (*ICMPChecker) Type ¶
func (c *ICMPChecker) Type() core.CheckType
Type returns the protocol identifier
type IMAPChecker ¶
type IMAPChecker struct{}
IMAPChecker implements IMAP health checks
func (*IMAPChecker) Type ¶
func (c *IMAPChecker) Type() core.CheckType
Type returns the protocol identifier
type SMTPChecker ¶
type SMTPChecker struct{}
SMTPChecker implements SMTP health checks
func (*SMTPChecker) Type ¶
func (c *SMTPChecker) Type() core.CheckType
Type returns the protocol identifier
type Storage ¶
type Storage interface {
SaveJudgment(ctx context.Context, j *core.Judgment) error
GetSoul(ctx context.Context, workspaceID, soulID string) (*core.Soul, error)
ListSouls(ctx context.Context, workspaceID string) ([]*core.Soul, error)
}
Storage is the interface the probe engine uses to persist judgments
type TCPChecker ¶
type TCPChecker struct{}
TCPChecker implements TCP health checks
func (*TCPChecker) Type ¶
func (c *TCPChecker) Type() core.CheckType
Type returns the protocol identifier
type TLSChecker ¶
type TLSChecker struct{}
TLSChecker implements TLS certificate checks
func (*TLSChecker) Type ¶
func (c *TLSChecker) Type() core.CheckType
Type returns the protocol identifier
type UDPChecker ¶
type UDPChecker struct{}
UDPChecker implements UDP health checks
func (*UDPChecker) Type ¶
func (c *UDPChecker) Type() core.CheckType
Type returns the protocol identifier
type WebSocketChecker ¶
type WebSocketChecker struct{}
WebSocketChecker implements WebSocket health checks
func NewWebSocketChecker ¶
func NewWebSocketChecker() *WebSocketChecker
NewWebSocketChecker creates a new WebSocket checker
func (*WebSocketChecker) Type ¶
func (c *WebSocketChecker) Type() core.CheckType
Type returns the protocol identifier