Documentation
¶
Overview ¶
Package planjson projects mailctl's plan and audit results into a stable JSON schema. Both `mailctl plan -json` and the local UI server render through it, so a script gating a pipeline and the UI can never disagree about what a run intends to do.
Index ¶
Constants ¶
const SchemaVersion = 1
SchemaVersion is incremented when a change would break an existing consumer. Adding a field is not such a change; removing or repurposing one is.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
// ID identifies the action within this plan only. It is a position, not a
// durable identity, and it is not stable across runs.
ID string `json:"id"`
Op string `json:"op"`
Resource string `json:"resource"`
Domain string `json:"domain"`
Provider string `json:"provider,omitempty"`
Detail string `json:"detail"`
// Manual marks an action a human completes outside mailctl. It renders in
// the plan and is never executed, so a converged plan may still list one.
Manual bool `json:"manual"`
}
Action is one intended change, described but not executable.
plan.Action carries Do, a closure over live provider clients. It is deliberately absent here: this type describes intent, and a plan that has been through JSON must never be a way to ask for work. Apply resolves actions from a plan it holds itself.
type Deliverability ¶
type Domain ¶
type Domain struct {
Name string `json:"name"`
Zone string `json:"zone"`
Providers []string `json:"providers"`
Mailboxes []Mailbox `json:"mailboxes"`
Aliases []Alias `json:"aliases"`
CatchAll *CatchAll `json:"catchAll,omitempty"` // absent: left alone
Deliverability Deliverability `json:"deliverability"`
}
type Domains ¶
Domains is `mailctl domains -json`: the config as mailctl resolved it, per domain. It names the environment variable a credential comes from and never a value.
func FromDomains ¶
type Mailbox ¶
type Mailbox struct {
Address string `json:"address"`
// PasswordEnv names where the credential comes from; empty means mailctl
// generates one when it creates the mailbox.
PasswordEnv string `json:"passwordEnv,omitempty"`
DisplayName string `json:"displayName,omitempty"`
License string `json:"license,omitempty"`
Recovery int `json:"recovery"`
}
type Report ¶
type Report struct {
Domain string `json:"domain"`
OK bool `json:"ok"`
Checks []Check `json:"checks"`
Notes []string `json:"notes"`
}
Report is one domain's audit result. OK is materialised as a field because audit.Report.OK() is a method and would otherwise be invisible to a consumer.