Documentation
¶
Overview ¶
Package engine turns a config plus live provider state into an ordered plan, and executes it.
Index ¶
- func Confirm(in io.Reader, out io.Writer, p plan.Plan) error
- type Engine
- func (e *Engine) Apply(ctx context.Context, p plan.Plan, out io.Writer) error
- func (e *Engine) Desired(ctx context.Context, d config.Domain) ([]dns.Record, error)
- func (e *Engine) Domains() ([]config.Domain, error)
- func (e *Engine) Plan(ctx context.Context) (plan.Plan, error)
- func (e *Engine) PlanDomain(ctx context.Context, d config.Domain) (plan.Plan, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg config.Config, zone dns.Provider, deployer *worker.Deployer, deps mail.Deps, opts Options) *Engine
New builds an engine. deployer may be nil when no domain deploys an MTA-STS policy Worker; a domain that asks for one then fails with a clear message.
func (*Engine) Desired ¶
Desired returns the DNS records mailctl wants published for a domain, without reading the zone or planning anything. audit uses it, and it applies the same collision guard planDomain does via unionDesiredDNS, so audit and plan cannot disagree about whether a config is legal.
func (*Engine) Plan ¶
Plan reads live state and returns everything that would change. It performs no writes.
func (*Engine) PlanDomain ¶ added in v0.1.1
PlanDomain plans one domain on its own, for a caller that wants to spend provider calls on that domain only. It is exactly what Plan does per domain, so a scoped plan and the matching slice of a full one agree.
type Options ¶
type Options struct {
// Domains limits the run to these domain names. Empty means every domain.
Domains []string
// Prune plans deletion of provider-side objects absent from the config.
Prune bool
// PruneMailboxes allows Prune to plan mailbox deletion. It is a second
// opt-in because deleting a mailbox destroys mail.
PruneMailboxes bool
// ReplaceDNS deletes conflicting DNS records instead of failing.
ReplaceDNS bool
// Secrets resolves mailbox credentials.
Secrets *secret.Resolver
}