Documentation
¶
Overview ¶
Package projectmutation owns the shared mechanics of one focused project mutation. Operation packages retain validation, write order, rollback, recovery, outcome, and presentation policy.
Index ¶
- Variables
- func Finish[T any](outcome T, operationErr, releaseErr error, committed func(T) bool, ...) error
- func Promote[T any](outcome T, err error, phase Phase, committed func(T) bool, ...) error
- type Failure
- type LeaseAcquirer
- type Partial
- type Phase
- type Scope
- type Transaction
- func AcquireProject(ctx context.Context, root string, loader *project.Loader, ...) (*Transaction, error)
- func UseProject(ctx context.Context, root string, loader *project.Loader, ...) (*Transaction, error)
- func UseTracked(ctx context.Context, root string, loader *project.Loader, ...) (*Transaction, error)
- func (t *Transaction) LoadAuthority() (*project.Session, error)
- func (t *Transaction) LoadForMutation(files *filesystem.Handle) (*project.Session, *filesystem.ExpectedIdentity, error)
- func (t *Transaction) Open() (*filesystem.Handle, error)
- func (t *Transaction) Release() error
- func (t *Transaction) Root() string
- func (t *Transaction) Scope() Scope
- func (t *Transaction) Synchronize() (publisher.Result, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrProjectLeaseCoverage identifies a missing tracked-and-resident lease. ErrProjectLeaseCoverage = errors.New("project mutation requires a covering project lease") // ErrTrackedLeaseCoverage identifies a missing selected-checkout lease. ErrTrackedLeaseCoverage = errors.New("project mutation requires a covering tracked lease") // ErrSynchronizationAttempted identifies a second publication attempt. ErrSynchronizationAttempted = errors.New("project mutation synchronization already attempted") )
Functions ¶
func Finish ¶
func Finish[T any](outcome T, operationErr, releaseErr error, committed func(T) bool, makePartial func(T, error, Phase) error) error
Finish joins a release result after the focused operation has classified its own failure. Committed outcomes become typed partials, while an existing partial retains both causes.
Types ¶
type LeaseAcquirer ¶
LeaseAcquirer is the narrow injection seam for acquisition and release faults. A nil acquirer selects the scope's production acquisition.
type Partial ¶
Partial retains an operation-owned outcome, cause, and ordered recovery guidance without taking ownership of their policy.
func NewPartial ¶
NewPartial constructs shared typed partial-effect plumbing for a focused operation's outcome and recovery policy.
type Phase ¶
type Phase string
Phase identifies the mechanical boundary at which an operation stopped.
func FailurePhase ¶
FailurePhase returns the mechanical boundary retained by err.
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction holds one operation-selected lease and its project loader. Callers explicitly decide when authority is loaded, mutated, reloaded, and synchronized.
func AcquireProject ¶
func AcquireProject(ctx context.Context, root string, loader *project.Loader, acquire LeaseAcquirer) (*Transaction, error)
AcquireProject acquires the complete tracked-and-resident transaction.
func UseProject ¶
func UseProject(ctx context.Context, root string, loader *project.Loader, lease *filesystem.Lease) (*Transaction, error)
UseProject binds an already-held complete project lease after caller-owned setup such as compatibility gating and loader construction.
func UseTracked ¶
func UseTracked(ctx context.Context, root string, loader *project.Loader, lease *filesystem.Lease) (*Transaction, error)
UseTracked binds an already-held selected-checkout lease after caller-owned setup such as compatibility gating and loader construction.
func (*Transaction) LoadAuthority ¶
func (t *Transaction) LoadAuthority() (*project.Session, error)
LoadAuthority opens the currently committed project authority while the operation-selected lease is held.
func (*Transaction) LoadForMutation ¶
func (t *Transaction) LoadForMutation(files *filesystem.Handle) (*project.Session, *filesystem.ExpectedIdentity, error)
LoadForMutation selects config authority through files and retains its exact replacement identity.
func (*Transaction) Open ¶
func (t *Transaction) Open() (*filesystem.Handle, error)
Open returns a root-confined filesystem handle for the selected project.
func (*Transaction) Release ¶
func (t *Transaction) Release() error
Release ends the operation-selected lease and types a release fault.
func (*Transaction) Root ¶
func (t *Transaction) Root() string
Root reports the operation-selected project root.
func (*Transaction) Scope ¶
func (t *Transaction) Scope() Scope
Scope reports the physical-root coverage selected by the operation.
func (*Transaction) Synchronize ¶
func (t *Transaction) Synchronize() (publisher.Result, error)
Synchronize reloads committed authority and then performs one Publisher operation under the transaction's existing complete project lease.