diff

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(result *Result, showSecrets bool) string

Format renders a diff Result as human-readable text. When showSecrets is false, live values of sensitive variables are masked.

Types

type Action

type Action int

Action represents the type of change.

const (
	ActionCreate Action = iota
	ActionUpdate
	ActionDelete
)

func (Action) String

func (a Action) String() string

String returns a human-readable label.

type Change

type Change struct {
	Key          string
	Action       Action
	LiveValue    string // current value in Railway (empty for Create)
	DesiredValue string // desired value from config (empty for Delete)
}

Change represents a single variable or setting change.

type Result

type Result struct {
	Shared   *SectionDiff
	Services map[string]*SectionDiff // keyed by service name
}

Result holds the complete diff between desired config and live state.

func Compute

func Compute(desired *config.DesiredConfig, live *config.LiveConfig) *Result

Compute calculates the additive-only diff between desired and live config.

func (*Result) IsEmpty

func (r *Result) IsEmpty() bool

IsEmpty returns true if there are no changes.

type SectionDiff

type SectionDiff struct {
	Variables []Change
	Settings  []Change
}

SectionDiff holds diffs for one scope (shared or a service).

Jump to

Keyboard shortcuts

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