actions

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package actions holds CCL business logic that is independent of command parsing: pure, testable functions over config types.

Index

Constants

View Source
const DoctorNetTimeout = 5 * time.Second

DoctorNetTimeout bounds each reachability HEAD probe (--check-net).

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckResult

type CheckResult struct {
	Provider string
	Check    string
	Status   Status
	Reason   string
}

CheckResult is the outcome of one diagnostic check on one provider. Fields are derived from logic outcomes only — never from credential values.

func ProbeReachability

func ProbeReachability(ctx context.Context, client *http.Client, name string, p config.Provider) CheckResult

ProbeReachability sends an unauthenticated HEAD to the provider's BaseURL and classifies reachability. Any HTTP response (incl. 4xx/5xx) means the host is live → PASS. Timeout, DNS, or transport error → WARN. NEVER attach auth credentials to this request.

func RunChecks

func RunChecks(name string, p config.Provider) []CheckResult

RunChecks executes the static (offline) checks for one provider in stable order: auth, fields, baseurl.

type Status

type Status string

Status is the outcome severity of a single diagnostic check.

const (
	StatusPass Status = "PASS"
	StatusWarn Status = "WARN"
	StatusFail Status = "FAIL"
)

Jump to

Keyboard shortcuts

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