Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var KnownMarchatEnvKeys = []string{
"MARCHAT_CONFIG_DIR",
"MARCHAT_PORT",
"MARCHAT_ADMIN_KEY",
"MARCHAT_USERS",
"MARCHAT_DB_PATH",
"MARCHAT_LOG_LEVEL",
"MARCHAT_SESSION_SECRET",
"MARCHAT_JWT_SECRET",
"MARCHAT_TLS_CERT_FILE",
"MARCHAT_TLS_KEY_FILE",
"MARCHAT_BAN_HISTORY_GAPS",
"MARCHAT_PLUGIN_REGISTRY_URL",
"MARCHAT_MAX_FILE_BYTES",
"MARCHAT_MAX_FILE_MB",
"MARCHAT_GLOBAL_E2E_KEY",
"MARCHAT_ALLOWED_USERS",
"MARCHAT_DOCTOR_NO_NETWORK",
}
KnownMarchatEnvKeys lists documented MARCHAT_* variables for doctor output.
Functions ¶
func FormatEnvValue ¶
FormatEnvValue returns a human-safe display string for an environment value.
func ParseLatestReleaseTag ¶
ParseLatestReleaseTag extracts tag_name from a GitHub releases/latest JSON body (for tests).
func ResolveServerConfigDir ¶
ResolveServerConfigDir returns the server configuration directory using the same rules as cmd/server: MARCHAT_CONFIG_DIR, --config-dir flag, then dev (./config) or ~/.config/marchat.
Types ¶
type Check ¶
type Check struct {
ID string `json:"id"`
Status string `json:"status"` // ok, warn, error
Message string `json:"message"`
}
Check is one diagnostic line in the report.
type Options ¶
type Options struct {
Out io.Writer
// JSON emits machine-readable JSON instead of text lines.
JSON bool
// HTTPClient is used for the GitHub latest-release check (optional).
HTTPClient *http.Client
// ServerConfigDirFlag is the value of the server's -config-dir flag (may be empty).
ServerConfigDirFlag string
}
Options configures doctor output and networking.
type Report ¶
type Report struct {
Role string `json:"role"`
Version string `json:"version"`
VersionDetail string `json:"version_detail"`
GoVersion string `json:"go_version"`
GOOS string `json:"goos"`
GOARCH string `json:"goarch"`
StdoutTTY bool `json:"stdout_tty"`
ConfigDir string `json:"config_dir,omitempty"`
Environment []envLine `json:"environment"`
Checks []Check `json:"checks"`
Update UpdateInfo `json:"update"`
}
Report is the full doctor payload for JSON output.
type UpdateInfo ¶
type UpdateInfo struct {
Current string `json:"current"`
Latest string `json:"latest,omitempty"`
UpToDate bool `json:"up_to_date"`
Skipped bool `json:"skipped"`
SkipReason string `json:"skip_reason,omitempty"`
Error string `json:"error,omitempty"`
}
UpdateInfo describes a remote version comparison (if available).
Click to show internal directories.
Click to hide internal directories.