staging

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package staging provides use cases for staging operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddInput

type AddInput struct {
	Name        string
	Value       string
	Description string
	Tags        map[string]string
}

AddInput holds input for the add use case.

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.

func (*AddUseCase) Execute

func (u *AddUseCase) Execute(_ context.Context, input AddInput) (*AddOutput, error)

Execute runs the add use case.

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
}

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
	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.StoreWriter
}

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
	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

type DiffOutput struct {
	ItemName string
	Entries  []DiffEntry
}

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

type DraftOutput struct {
	Value    string
	IsStaged bool
}

DraftOutput holds the draft value if any.

type EditInput

type EditInput struct {
	Name        string
	Value       string
	Description string
	Tags        map[string]string
}

EditInput holds input for the edit use case.

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
	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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL