Documentation
¶
Overview ¶
Package engine resolves and synchronizes direct secret mappings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Change ¶
type Change struct {
Environment string `json:"environment"`
Kind ChangeKind `json:"kind"`
}
Change describes what would happen to a single mapping's destination.
type ChangeKind ¶
type ChangeKind string
ChangeKind classifies how a mapping's destination compares to its resolved source value.
const ( // Unchanged means the destination already holds the resolved value. Unchanged ChangeKind = "unchanged" // Create means the destination binding could not be read back — it (or // its container) doesn't exist yet. Create ChangeKind = "create" // Update means the destination exists but holds a different value. Update ChangeKind = "update" )
type RollbackResult ¶
type RollbackResult struct {
Environment string `json:"environment"`
Status RollbackStatus `json:"status"`
Detail string `json:"detail,omitempty"`
}
RollbackResult reports what happened when rolling back one mapping's destination.
func Rollback ¶
func Rollback(ctx context.Context, p *Plan) ([]RollbackResult, error)
Rollback reverts every mapping's destination container to its previous value, one call per distinct container (mirroring how writes are grouped). It never reads or writes a source, and never contacts a provider that doesn't implement provider.Rollbacker for the mapping's destination scheme — those mappings are reported Unsupported rather than attempted. Rollback returns its per-mapping results even when some containers fail; it only returns a non-nil error for a failure that prevents reporting at all (there is none today, but the signature stays symmetric with Sync).
type RollbackStatus ¶
type RollbackStatus string
RollbackStatus classifies the outcome of reverting one mapping's destination.
const ( // Reverted means the destination's container was successfully rolled // back to its previous value. Reverted RollbackStatus = "reverted" // Unsupported means the destination's provider adapter doesn't // implement provider.Rollbacker — nothing was attempted. Unsupported RollbackStatus = "unsupported" // Failed means a rollback was attempted and the provider rejected it // (e.g. there is no distinct previous value to revert to). Failed RollbackStatus = "failed" )
type SyncResult ¶
type SyncResult struct {
DryRun bool `json:"dryRun"`
Changes []Change `json:"changes"`
Completed []string `json:"completed"`
}
func Sync ¶
func Sync(ctx context.Context, p *Plan, options SyncOptions) (SyncResult, error)
Sync resolves all sources, inspects every destination container once, and writes only changed mappings. No confirmation or write occurs unless every source and destination snapshot was read successfully.