Documentation
¶
Overview ¶
Package staging provides use cases for staging operations.
Index ¶
- type AddInput
- type AddOutput
- type AddUseCase
- type ApplyInput
- type ApplyOutput
- type ApplyResultEntry
- type ApplyResultStatus
- type ApplyUseCase
- type BaselineInput
- type BaselineOutput
- type DeleteInput
- type DeleteOutput
- type DeleteUseCase
- type DiffEntry
- type DiffEntryType
- type DiffInput
- type DiffOutput
- type DiffUseCase
- type DraftInput
- type DraftOutput
- type EditInput
- type EditOutput
- type EditUseCase
- type ResetInput
- type ResetOutput
- type ResetResultType
- type ResetUseCase
- type StatusEntry
- type StatusInput
- type StatusOutput
- type StatusUseCase
- type TagInput
- type TagOutput
- type TagUseCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddOutput ¶
type AddOutput struct {
Name string
}
AddOutput holds the result of the add use case.
type AddUseCase ¶
type AddUseCase struct {
Strategy staging.Parser
Store staging.StoreReadWriter
}
AddUseCase executes add operations.
func (*AddUseCase) Draft ¶
func (u *AddUseCase) Draft(_ context.Context, input DraftInput) (*DraftOutput, error)
Draft returns the currently staged create value (draft) for re-editing.
type ApplyInput ¶
type ApplyInput struct {
Name string // Optional: apply only this item
IgnoreConflicts bool // Skip conflict detection
}
ApplyInput holds input for the apply use case.
type ApplyOutput ¶
type ApplyOutput struct {
ServiceName string
ItemName string
Results []ApplyResultEntry
Conflicts []string
Succeeded int
Failed int
}
ApplyOutput holds the result of the apply use case.
type ApplyResultEntry ¶
type ApplyResultEntry struct {
Name string
Status ApplyResultStatus
Error error
Tags map[string]string // Tags that were applied
UntagKeys maputil.Set[string] // Tag keys that were removed
}
ApplyResultEntry represents the result of applying a single entry.
type ApplyResultStatus ¶
type ApplyResultStatus int
ApplyResultStatus represents the status of an apply operation.
const ( ApplyResultCreated ApplyResultStatus = iota ApplyResultUpdated ApplyResultDeleted ApplyResultFailed )
type ApplyUseCase ¶
type ApplyUseCase struct {
Strategy staging.ApplyStrategy
Store staging.StoreReadWriter
}
ApplyUseCase executes apply operations.
func (*ApplyUseCase) Execute ¶
func (u *ApplyUseCase) Execute(ctx context.Context, input ApplyInput) (*ApplyOutput, error)
Execute runs the apply use case.
type BaselineInput ¶
type BaselineInput struct {
Name string
}
BaselineInput holds input for getting baseline value.
type BaselineOutput ¶
type BaselineOutput struct {
Value string
}
BaselineOutput holds the baseline value for editing.
type DeleteInput ¶
type DeleteInput struct {
Name string
Force bool // For Secrets Manager: force immediate deletion
RecoveryWindow int // For Secrets Manager: days before permanent deletion (7-30)
}
DeleteInput holds input for the delete use case.
type DeleteOutput ¶
type DeleteOutput struct {
Name string
Unstaged bool // True if a staged CREATE was removed instead of staging DELETE
HasDeleteOptions bool
Force bool
RecoveryWindow int
ShowDeleteOptions bool
}
DeleteOutput holds the result of the delete use case.
type DeleteUseCase ¶
type DeleteUseCase struct {
Strategy staging.DeleteStrategy
Store staging.StoreReadWriter
}
DeleteUseCase executes delete staging operations.
func (*DeleteUseCase) Execute ¶
func (u *DeleteUseCase) Execute(ctx context.Context, input DeleteInput) (*DeleteOutput, error)
Execute runs the delete use case.
type DiffEntry ¶
type DiffEntry struct {
Name string
Type DiffEntryType
Operation staging.Operation
AWSValue string
AWSIdentifier string
StagedValue string
Description *string
Tags map[string]string
UntagKeys maputil.Set[string]
Warning string // For warnings like "already deleted in AWS"
}
DiffEntry represents a single diff result.
type DiffEntryType ¶
type DiffEntryType int
DiffEntryType represents the type of diff entry.
const ( DiffEntryNormal DiffEntryType = iota DiffEntryCreate DiffEntryAutoUnstaged DiffEntryWarning )
type DiffInput ¶
type DiffInput struct {
Name string // Optional: diff only this item
}
DiffInput holds input for the diff use case.
type DiffOutput ¶
DiffOutput holds the result of the diff use case.
type DiffUseCase ¶
type DiffUseCase struct {
Strategy staging.DiffStrategy
Store staging.StoreReadWriter
}
DiffUseCase executes diff operations.
func (*DiffUseCase) Execute ¶
func (u *DiffUseCase) Execute(ctx context.Context, input DiffInput) (*DiffOutput, error)
Execute runs the diff use case.
type DraftInput ¶
type DraftInput struct {
Name string
}
DraftInput holds input for getting draft (staged create) value.
type DraftOutput ¶
DraftOutput holds the draft value if any.
type EditOutput ¶
type EditOutput struct {
Name string
}
EditOutput holds the result of the edit use case.
type EditUseCase ¶
type EditUseCase struct {
Strategy staging.EditStrategy
Store staging.StoreReadWriter
}
EditUseCase executes edit operations.
func (*EditUseCase) Baseline ¶
func (u *EditUseCase) Baseline(ctx context.Context, input BaselineInput) (*BaselineOutput, error)
Baseline returns the baseline value for editing (staged value if exists, otherwise from AWS).
func (*EditUseCase) Execute ¶
func (u *EditUseCase) Execute(ctx context.Context, input EditInput) (*EditOutput, error)
Execute runs the edit use case.
type ResetInput ¶
type ResetInput struct {
Spec string // Name with optional version spec
All bool // Reset all staged items for this service
}
ResetInput holds input for the reset use case.
type ResetOutput ¶
type ResetOutput struct {
Type ResetResultType
Name string
VersionLabel string
Count int // Number of items unstaged (for UnstagedAll)
ServiceName string
ItemName string
}
ResetOutput holds the result of the reset use case.
type ResetResultType ¶
type ResetResultType int
ResetResultType represents the type of reset result.
const ( ResetResultUnstaged ResetResultType = iota ResetResultUnstagedAll ResetResultRestored ResetResultNotStaged ResetResultNothingStaged )
type ResetUseCase ¶
type ResetUseCase struct {
Parser staging.Parser
Fetcher staging.ResetStrategy
Store staging.StoreReadWriter
}
ResetUseCase executes reset operations.
func (*ResetUseCase) Execute ¶
func (u *ResetUseCase) Execute(ctx context.Context, input ResetInput) (*ResetOutput, error)
Execute runs the reset use case.
type StatusEntry ¶
type StatusEntry struct {
Name string
Operation staging.Operation
Value *string
Description *string
Tags map[string]string
UntagKeys maputil.Set[string]
DeleteOptions *staging.DeleteOptions
StagedAt time.Time
ShowDeleteOptions bool
}
StatusEntry represents a single staged entry.
type StatusInput ¶
type StatusInput struct {
Name string // Optional: if set, show only this item
}
StatusInput holds input for the status use case.
type StatusOutput ¶
type StatusOutput struct {
Service staging.Service
ServiceName string
ItemName string
Entries []StatusEntry
}
StatusOutput holds the result of the status use case.
type StatusUseCase ¶
type StatusUseCase struct {
Strategy staging.ServiceStrategy
Store staging.StoreReader
}
StatusUseCase executes status operations.
func (*StatusUseCase) Execute ¶
func (u *StatusUseCase) Execute(_ context.Context, input StatusInput) (*StatusOutput, error)
Execute runs the status use case.
type TagInput ¶ added in v0.2.0
type TagInput struct {
Name string
AddTags map[string]string // Tags to add or update
RemoveTags maputil.Set[string] // Tag keys to remove
CancelAddTags maputil.Set[string] // Cancel staged tag additions (remove from Tags only)
CancelRemoveTags maputil.Set[string] // Cancel staged tag removals (remove from UntagKeys only)
}
TagInput holds input for the tag staging use case.
type TagOutput ¶ added in v0.2.0
type TagOutput struct {
Name string
}
TagOutput holds the result of the tag staging use case.
type TagUseCase ¶ added in v0.2.0
type TagUseCase struct {
Strategy staging.EditStrategy
Store staging.StoreReadWriter
}
TagUseCase executes tag staging operations.