Documentation
¶
Index ¶
- func GetDockerClient() (*docker.Client, error)
- func PingDocker(ctx context.Context, client *docker.Client) error
- type CheckResult
- type CheckStatus
- type ConfigInfo
- type DependencyInfo
- type DiagnosticResults
- func (r *DiagnosticResults) GetExitCode() int
- func (r *DiagnosticResults) GetIssues() []Issue
- func (r *DiagnosticResults) GetStatusMessage() string
- func (r *DiagnosticResults) HasErrors() bool
- func (r *DiagnosticResults) HasWarnings() bool
- func (r *DiagnosticResults) OutputJSON() error
- func (r *DiagnosticResults) OutputTerminal()
- type DockerInfo
- type DockerShieldInfo
- type Issue
- type PermissionInfo
- type SystemInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDockerClient ¶
GetDockerClient is a helper that returns a Docker client if available
Types ¶
type CheckResult ¶
type CheckResult struct {
Status CheckStatus
Message string
Value string
Fix string // Optional fix suggestion
}
CheckResult represents the result of a single check
type CheckStatus ¶
type CheckStatus string
CheckStatus represents the result of a diagnostic check
const ( StatusPass CheckStatus = "pass" StatusWarning CheckStatus = "warning" StatusFail CheckStatus = "fail" StatusSkipped CheckStatus = "skipped" )
type ConfigInfo ¶
type ConfigInfo struct {
ConfigDirExists CheckResult
ConfigFileExists CheckResult
ConfigFileValid CheckResult
StateDirExists CheckResult
StateDirWritable CheckResult
StateFileExists CheckResult
}
ConfigInfo contains configuration file checks
type DependencyInfo ¶
type DependencyInfo struct {
IptablesInstalled CheckResult
IptablesSaveAccessible CheckResult
UFWInstalled CheckResult
}
DependencyInfo contains dependency checks
func CheckDependencies ¶
func CheckDependencies() *DependencyInfo
CheckDependencies performs dependency checks
type DiagnosticResults ¶
type DiagnosticResults struct {
Timestamp time.Time
System *SystemInfo
Docker *DockerInfo
Permissions *PermissionInfo
Dependencies *DependencyInfo
Config *ConfigInfo
DockerShield *DockerShieldInfo
}
DiagnosticResults contains all diagnostic check results
func RunAll ¶
func RunAll(version, commit string, verbose bool) *DiagnosticResults
RunAll performs all diagnostic checks
func (*DiagnosticResults) GetExitCode ¶
func (r *DiagnosticResults) GetExitCode() int
GetExitCode returns the appropriate exit code
func (*DiagnosticResults) GetIssues ¶
func (r *DiagnosticResults) GetIssues() []Issue
GetIssues returns a list of all issues found
func (*DiagnosticResults) GetStatusMessage ¶
func (r *DiagnosticResults) GetStatusMessage() string
GetStatusMessage returns an overall status message
func (*DiagnosticResults) HasErrors ¶
func (r *DiagnosticResults) HasErrors() bool
HasErrors returns true if any critical errors were found
func (*DiagnosticResults) HasWarnings ¶
func (r *DiagnosticResults) HasWarnings() bool
HasWarnings returns true if any warnings were found
func (*DiagnosticResults) OutputJSON ¶
func (r *DiagnosticResults) OutputJSON() error
OutputJSON prints diagnostic results as JSON
func (*DiagnosticResults) OutputTerminal ¶
func (r *DiagnosticResults) OutputTerminal()
OutputTerminal prints diagnostic results to terminal
type DockerInfo ¶
type DockerInfo struct {
Installed CheckResult
DaemonRunning CheckResult
SocketAccessible CheckResult
APIVersion CheckResult
CanListContainers CheckResult
CanListNetworks CheckResult
}
DockerInfo contains Docker-related diagnostic information
func CheckDocker ¶
func CheckDocker() *DockerInfo
CheckDocker performs Docker-related diagnostic checks
type DockerShieldInfo ¶
type DockerShieldInfo struct {
Version CheckResult
BinaryLocation CheckResult
BuildInfo CheckResult
}
DockerShieldInfo contains DockerShield-specific information
func CheckDockerShield ¶
func CheckDockerShield(version, commit string) *DockerShieldInfo
CheckDockerShield performs DockerShield-specific checks
type Issue ¶
type Issue struct {
Severity string // "error", "warning", "info"
Category string // "system", "docker", "permissions", etc.
Message string
Fix string
}
Issue represents a diagnostic issue
type PermissionInfo ¶
type PermissionInfo struct {
CanReadIptables CheckResult
CanAccessDocker CheckResult
CanWriteState CheckResult
CanReadSSHConfig CheckResult
}
PermissionInfo contains permission-related checks
func CheckPermissions ¶
func CheckPermissions() *PermissionInfo
CheckPermissions performs permission-related diagnostic checks
type SystemInfo ¶
type SystemInfo struct {
OS CheckResult
Architecture CheckResult
Kernel CheckResult
IsRoot CheckResult
Hostname CheckResult
}
SystemInfo contains system-level diagnostic information
func CheckSystem ¶
func CheckSystem() *SystemInfo
CheckSystem performs system-level diagnostic checks