Documentation
¶
Index ¶
- func Confirm(prompt string) (bool, error)
- func DiffAdd(line string) string
- func DiffHeader(client, path string) string
- func DiffNoChanges() string
- func DiffRemove(line string) string
- func HasSecretPathPrefix(secretPaths []string, serverName string) bool
- func MaskMapSecrets(m map[string]any, secretPaths []string) map[string]any
- func MaskSecret(_ string) string
- func ReadSecret(prompt string) (string, error)
- func RenderPlanResult(w io.Writer, v PlanView) bool
- type PlanView
- type Prompter
- type SecretReader
- type StatusWriter
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffHeader ¶
DiffHeader prints a colored header for a client's diff section.
func HasSecretPathPrefix ¶
HasSecretPathPrefix returns true if any secret path starts with the given server name prefix.
func MaskMapSecrets ¶
MaskMapSecrets returns a deep copy of m with values at secretPaths masked. secretPaths use dot-separated notation: "serverName.field.key".
func MaskSecret ¶
MaskSecret masks a secret value for display with a fixed placeholder.
func ReadSecret ¶
ReadSecret prompts for a secret value using the default reader.
Types ¶
type PlanView ¶
type PlanView struct {
DisplayName string
ConfigPath string
Errors []error
HasChanges bool
Added []string
Changed []string
Removed []string
Desired map[string]any
SecretPaths []string
OverridesApplied map[string][]string
RemoveUnmanaged bool
ProfileName string
}
PlanView bundles the data needed to render a single client's plan diff.
type Prompter ¶
Prompter handles interactive user prompts.
func DefaultPrompter ¶
func DefaultPrompter() *Prompter
DefaultPrompter returns a prompter using stdin/stdout.
type SecretReader ¶
SecretReader handles reading secret values with hidden input.
func DefaultSecretReader ¶
func DefaultSecretReader() *SecretReader
DefaultSecretReader returns a reader using stdin/stderr.
type StatusWriter ¶
type StatusWriter struct {
// contains filtered or unexported fields
}
StatusWriter writes ephemeral status lines to a writer (typically stderr). On a TTY it overwrites the current line using \r + ANSI clear; otherwise it prints each status on its own line.
func NewStatusWriter ¶
func NewStatusWriter(w io.Writer) *StatusWriter
NewStatusWriter creates a StatusWriter. If w is a TTY-backed *os.File, status lines are overwritten in place.
func NopStatusWriter ¶
func NopStatusWriter() *StatusWriter
NopStatusWriter returns a StatusWriter that discards all output.
func (*StatusWriter) Clear ¶
func (s *StatusWriter) Clear()
Clear removes the current status line (TTY only).
func (*StatusWriter) Status ¶
func (s *StatusWriter) Status(format string, args ...any)
Status writes an ephemeral status message. On a TTY the previous status line is overwritten; on a pipe each message gets its own line.