cmd

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintDiff

func PrintDiff(w io.Writer, r *DiffResult, showValues bool)

PrintDiff writes a human-readable diff to the given writer. When showValues is false, changed keys show "(changed)" instead of actual values.

func Pull

func Pull(ctx context.Context, client *sm.Client, opts PullOptions) error

Pull fetches a secret from Secrets Manager and writes it as a dotenv file.

func Push

func Push(ctx context.Context, client *sm.Client, opts PushOptions) error

Push reads a dotenv file and stores it as a JSON secret in Secrets Manager.

Types

type DiffOptions

type DiffOptions struct {
	SecretID string
	Input    string // file path; required
}

DiffOptions holds configuration for the diff command.

type DiffResult

type DiffResult struct {
	Added   []string             // keys in local but not in remote
	Removed []string             // keys in remote but not in local
	Changed map[string][2]string // key → [remote, local]
}

DiffResult represents the result of comparing local and remote secrets.

func ComputeDiff

func ComputeDiff(remote, local map[string]string) *DiffResult

ComputeDiff compares two maps and returns the differences.

func Diff

func Diff(ctx context.Context, client *sm.Client, opts DiffOptions) (*DiffResult, error)

Diff compares a local dotenv file with a remote Secrets Manager secret.

func (DiffResult) HasDiff

func (d DiffResult) HasDiff() bool

HasDiff returns true if there are any differences.

type PullOptions

type PullOptions struct {
	SecretID string
	Output   string // file path; empty or "-" means stdout
}

PullOptions holds configuration for the pull command.

type PushOptions

type PushOptions struct {
	SecretID string
	Input    string // file path; required
	DryRun   bool
}

PushOptions holds configuration for the push command.

Jump to

Keyboard shortcuts

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