Documentation
¶
Overview ¶
Package azure provides use cases for the two Azure adapters (Key Vault secrets and App Configuration params).
The use cases are written against the provider-neutral Reader/Writer/Store interfaces. Unlike the Google Cloud use cases they take a pre-reconstructed version suffix string (e.g. "#abc123", "~2", or "") rather than a typed spec: the two Azure services use different version grammars (Key Vault has opaque version ids; App Configuration has none), so decoupling the use cases from the spec type lets a single package serve both CLI groups. The CLI presenters own the typed spec and hand the suffix here.
Index ¶
- Variables
- type CreateInput
- type CreateOutput
- type CreateUseCase
- type DeleteInput
- type DeleteOutput
- type DeleteUseCase
- type DiffInput
- type DiffOutput
- type DiffUseCase
- type ListEntry
- type ListInput
- type ListOutput
- type ListUseCase
- type LogEntry
- type LogInput
- type LogOutput
- type LogUseCase
- type ShowInput
- type ShowOutput
- type ShowTag
- type ShowUseCase
- type UpdateInput
- type UpdateOutput
- type UpdateUseCase
Constants ¶
This section is empty.
Variables ¶
var ErrEntryNotFound = errors.New("entry not found")
ErrEntryNotFound is returned by the update use case when the target entry does not exist.
Functions ¶
This section is empty.
Types ¶
type CreateInput ¶
type CreateInput struct {
Name string
Value string
ValueType domain.ValueType // secret (Key Vault) or plaintext (App Configuration)
}
CreateInput holds input for the create use case.
type CreateOutput ¶
type CreateOutput struct {
Name string
Version string // opaque version id (Key Vault), or "" (App Configuration)
}
CreateOutput holds the result of the create use case.
type CreateUseCase ¶
CreateUseCase executes create operations.
func (*CreateUseCase) Execute ¶
func (u *CreateUseCase) Execute(ctx context.Context, input CreateInput) (*CreateOutput, error)
Execute runs the create use case. It creates a new entry via the provider; if the entry already exists the provider returns a wrapped provider.ErrAlreadyExists and no overwrite occurs.
type DeleteInput ¶
type DeleteInput struct {
Name string
}
DeleteInput holds input for the delete use case.
type DeleteOutput ¶
type DeleteOutput struct {
Name string
}
DeleteOutput holds the result of the delete use case.
type DeleteUseCase ¶
DeleteUseCase executes delete operations.
func (*DeleteUseCase) Execute ¶
func (u *DeleteUseCase) Execute(ctx context.Context, input DeleteInput) (*DeleteOutput, error)
Execute runs the delete use case.
func (*DeleteUseCase) GetCurrentValue ¶
GetCurrentValue fetches the current value for preview. A non-existent entry yields an empty value with no error; any other read failure is propagated.
type DiffInput ¶
DiffInput holds input for the diff use case. Each side carries its own name so that unversioned stores (App Configuration) can compare two distinct keys.
type DiffOutput ¶
type DiffOutput struct {
OldName string
OldVersion string
OldValue string
NewName string
NewVersion string
NewValue string
}
DiffOutput holds the result of the diff use case.
type DiffUseCase ¶
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 ListInput ¶
type ListInput struct {
Prefix string // Name prefix filter (case-sensitive)
Filter string // Regex filter pattern (client-side)
WithValue bool // Include values
}
ListInput holds input for the list use case.
type ListOutput ¶
type ListOutput struct {
Entries []ListEntry
}
ListOutput holds the result of the list use case.
type ListUseCase ¶
ListUseCase executes list operations.
func (*ListUseCase) Execute ¶
func (u *ListUseCase) Execute(ctx context.Context, input ListInput) (*ListOutput, error)
Execute runs the list use case. The provider returns every name; the name prefix filter and the client-side regex filter are applied here.
type LogEntry ¶
type LogEntry struct {
Version string
State string // enabled/disabled, may be ""
Value string
CreatedDate *time.Time
Error error // Error from fetching value, if any (e.g. disabled versions)
}
LogEntry represents a single version entry.
type LogInput ¶
type LogInput struct {
Name string
MaxResults int32
Since *time.Time
Until *time.Time
Reverse bool
}
LogInput holds input for the log use case.
type LogUseCase ¶
LogUseCase executes log operations.
func (*LogUseCase) Execute ¶
Execute runs the log use case: fetch the version history (newest first), cap to MaxResults, optionally reverse, apply date filters, then retrieve each surviving version's value.
Providers without version history (Azure App Configuration) return an error from History; that error is propagated here so the generic log command surfaces it cleanly instead of crashing.
type ShowInput ¶
type ShowInput struct {
Name string
Suffix string // reconstructed version suffix ("#id", "~2", or "")
}
ShowInput holds input for the show use case.
type ShowOutput ¶
type ShowOutput struct {
Name string
Value string
Version string // opaque version id (Key Vault), or "" (App Configuration / latest)
State string // enabled/disabled (Key Vault, best-effort), may be ""
CreatedDate *time.Time
Tags []ShowTag
}
ShowOutput holds the result of the show use case.
type ShowUseCase ¶
ShowUseCase executes show operations.
func (*ShowUseCase) Execute ¶
func (u *ShowUseCase) Execute(ctx context.Context, input ShowInput) (*ShowOutput, error)
Execute runs the show use case. Version resolution (opaque ids and ~shift for Key Vault; latest-only for App Configuration) is provided by the adapter behind provider.Reader.
type UpdateInput ¶
type UpdateInput struct {
Name string
Value string
ValueType domain.ValueType // secret (Key Vault) or plaintext (App Configuration)
}
UpdateInput holds input for the update use case.
type UpdateOutput ¶
type UpdateOutput struct {
Name string
Version string // opaque version id (Key Vault), or "" (App Configuration)
}
UpdateOutput holds the result of the update use case.
type UpdateUseCase ¶
UpdateUseCase executes update operations.
func (*UpdateUseCase) Execute ¶
func (u *UpdateUseCase) Execute(ctx context.Context, input UpdateInput) (*UpdateOutput, error)
Execute runs the update use case. It updates an existing entry; if the entry doesn't exist it returns ErrEntryNotFound. A read failure other than not-found is propagated unchanged.
func (*UpdateUseCase) GetCurrentValue ¶
GetCurrentValue fetches the current value for preview. A non-existent entry yields an empty value with no error; any other read failure is propagated.