Documentation
¶
Overview ¶
Package privatefile updates small owner-private files by atomic replacement.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConfigurationChanged = errors.New("Configuration changed while this command was running; no changes were made. Review the file and retry.")
ErrConfigurationChanged is the published retryable outcome for an accidental concurrent edit detected before replacement.
Functions ¶
Types ¶
type CommitState ¶
type CommitState string
CommitState describes how far a preserving update progressed.
const ( // CommitNoop means the requested value already held. CommitNoop CommitState = "no_op" // CommitNotApplied means replacement did not occur. CommitNotApplied CommitState = "not_applied" // CommitDurable means replacement and parent sync succeeded. CommitDurable CommitState = "durable" // CommitReplacementAppliedDurabilityUnknown means replacement occurred but a later durability step failed. CommitReplacementAppliedDurabilityUnknown CommitState = "replacement_applied_durability_unknown" )
func Update ¶
func Update(ctx context.Context, path, conventionalPath string, maxBytes int64, mutate Mutate) (CommitState, error)
Update performs a bounded preserving update. Its second read is best-effort detection of accidental concurrent edits, not a CAS against a hostile same-UID process. conventionalPath may name the one target whose missing 0700 parent directory may be created.
Click to show internal directories.
Click to hide internal directories.