diff

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package diff provides the global diff command for viewing staged changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(cfg stgcli.GlobalConfig) *cli.Command

Command returns the diff command for the given provider config.

Types

type Options

type Options struct {
	ParseJSON bool
	NoPager   bool
}

Options holds the options for the diff command.

type Runner

type Runner struct {
	// Services lists the configured provider services (with staged changes) in
	// stable display order, each carrying its own store.
	Services []ServiceStrategy
	// ProviderLabel is the human-readable provider name (e.g. "AWS").
	ProviderLabel string
	Stdout        io.Writer
	Stderr        io.Writer
}

Runner executes the diff command.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, opts Options) error

Run executes the diff command over the pre-gathered per-service stores.

type ServiceStrategy added in v0.8.1

type ServiceStrategy struct {
	Service staging.Service
	// Store is this service's own working store (App Configuration and Key Vault
	// live in separate buckets).
	Store store.ReadWriteOperator
	// Strategy is the default (namespace-agnostic) diff strategy.
	Strategy staging.DiffStrategy
	// StrategyFor, when set, resolves a strategy per namespace so each App
	// Configuration entry is diffed under its own namespace. Nil elsewhere.
	StrategyFor func(namespace string) (staging.DiffStrategy, error)
	// Entries/Tags are this service's staged changes, pre-listed from its store,
	// keyed by the (name, namespace) EntryKey.
	Entries map[staging.EntryKey]staging.Entry
	Tags    map[staging.EntryKey]staging.TagEntry
}

ServiceStrategy pairs a service with its (possibly nil) diff strategy. The strategy is nil when no changes are staged for that service and thus no provider client was initialized.

Jump to

Keyboard shortcuts

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