class Obsctl::Diagnostics::Doctor

Overview

Collects setup diagnostics for obsctl doctor.

Every external dependency is injected so the whole report is reproducible in specs without a daemon, a config file, or an OBS instance. The probe returns the daemon's server-status payload, or nil when the daemon is not reachable.

Defined in:

obsctl/diagnostics/doctor.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(config_path : String, socket_path : String, env : Hash(String, String) | ENV.class = ENV, daemon_probe : DaemonProbe = ->Doctor.probe_daemon(String), service_path : String = Service::SystemdUserService.default_path) #

[View source]

Class Method Detail

def self.healthy?(checks : Array(Check)) : Bool #

True when no check failed. Warnings do not fail the command.


[View source]
def self.probe_daemon(socket_path : String) : JSON::Any | Nil #

Default probe: asks a running daemon for its status payload.


[View source]

Instance Method Detail

def run : Array(Check) #

Runs every check in report order.


[View source]