Documentation
¶
Overview ¶
Package staging provides use cases for staging operations.
Index ¶
- type AddInput
- type AddOutput
- type AddUseCase
- type ApplyEntryResult
- type ApplyInput
- type ApplyOutput
- type ApplyResultStatus
- type ApplyTagResult
- type ApplyUseCase
- type BaselineInput
- type BaselineOutput
- type DeleteInput
- type DeleteOutput
- type DeleteUseCase
- type DiffEntry
- type DiffEntryType
- type DiffInput
- type DiffOutput
- type DiffTagEntry
- 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 StatusTagEntry
- type StatusUseCase
- type TagInput
- type TagOutput
- type TagUseCase
- type UntagInput
- type UntagOutput
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.EditStrategy
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 ApplyEntryResult ¶ added in v0.3.0
type ApplyEntryResult struct {
Name string
Status ApplyResultStatus
Error error
}
ApplyEntryResult represents the result of applying a single entry.
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
// Entry results
EntryResults []ApplyEntryResult
EntrySucceeded int
EntryFailed int
// Tag results
TagResults []ApplyTagResult
TagSucceeded int
TagFailed int
// Conflicts
Conflicts []string
}
ApplyOutput holds the result of the apply use case.
type ApplyResultStatus ¶
type ApplyResultStatus int
ApplyResultStatus represents the status of an apply operation.
const ( ApplyResultCreated ApplyResultStatus = iota ApplyResultUpdated ApplyResultDeleted ApplyResultFailed )
type ApplyTagResult ¶ added in v0.3.0
type ApplyTagResult struct {
Name string
AddTags map[string]string // Tags that were added/updated
RemoveTag maputil.Set[string] // Tag keys that were removed
Error error
}
ApplyTagResult represents the result of applying tag changes.
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
IsStagedEdit bool // True if the baseline is from a staged edit (not AWS)
}
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
ShowDeleteOptions bool // True if delete options (Force/RecoveryWindow) should be shown
Force bool
RecoveryWindow int
}
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
Warning string // For warnings like "already deleted in AWS"
}
DiffEntry represents a single diff result for entries.
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 ¶
type DiffOutput struct {
ItemName string
Entries []DiffEntry
TagEntries []DiffTagEntry
}
DiffOutput holds the result of the diff use case.
type DiffTagEntry ¶ added in v0.3.0
type DiffTagEntry struct {
Name string
Add map[string]string // Tags to add or update
Remove maputil.Set[string] // Tag keys to remove
}
DiffTagEntry represents a single diff result for tag changes.
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
Skipped bool // True if the edit was skipped because value matches AWS
Unstaged bool // True if the entry was auto-unstaged
}
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 ResetResultSkipped // Restore was skipped because value matches current AWS )
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
DeleteOptions *staging.DeleteOptions
StagedAt time.Time
ShowDeleteOptions bool
}
StatusEntry represents a single staged entry (create/update/delete).
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
TagEntries []StatusTagEntry
}
StatusOutput holds the result of the status use case.
type StatusTagEntry ¶ added in v0.3.0
type StatusTagEntry struct {
Name string
Add map[string]string // Tags to add or update
Remove maputil.Set[string] // Tag keys to remove
StagedAt time.Time
}
StatusTagEntry represents staged tag changes for an entity.
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 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.
func (*TagUseCase) Untag ¶ added in v0.4.5
func (u *TagUseCase) Untag(ctx context.Context, input UntagInput) (*UntagOutput, error)
Untag removes tags from a staged resource.
type UntagInput ¶ added in v0.4.5
UntagInput holds input for the untag staging use case.
type UntagOutput ¶ added in v0.4.5
type UntagOutput struct {
Name string
}
UntagOutput holds the result of the untag staging use case.