Documentation
¶
Index ¶
Constants ¶
View Source
const ( FORMAT_INI = "ini" FORMAT_YAML = "yaml" FORMAT_TOML = "toml" FORMAT_JSON = "json" FORMAT_XML = "xml" )
File format constants
View Source
const ( PKG_CMD = "cmd" APP_NAME = "confedit" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApplyCmd ¶
type ApplyCmd struct {
Targets []string `arg:"" optional:"" help:"Rest of the arguments are a list of target names"`
Force bool `help:"Force apply even if validation fails"`
Backup bool `help:"Create backup of files before modification" default:"true"`
}
ApplyCmd performs edit operations on given files
type CLI ¶
type CLI struct {
Globals `kong:"embed"`
Version VersionCmd `cmd:"" help:"Show version information"`
Apply ApplyCmd `cmd:"" help:"Apply changes to target system"`
Status StatusCmd `cmd:"" help:"Check status on target system"`
List ListCmd `cmd:"" help:"List defined targets"`
Generate GenerateCmd `cmd:"" help:"Generate CUE data from diff between source and target of specified type"`
}
CLI represents the main CLI structure
type CommandContext ¶
type CommandContext struct {
StateManager *state.Manager
Reconciler reconciler.Reconciler
Loader *loader.CueDataLoader
SystemConfig *types.SystemConfig
Targets []types.AnyTarget
HookExecutor *reconciler.HookExecutor
}
CommandContext holds the shared initialization components for apply and status commands
func InitializeCommand ¶
func InitializeCommand(cli *CLI, currentTargets []string, dryRunOverride *bool, backupOverride *bool) (*CommandContext, error)
InitializeCommand performs common initialization for apply and status commands
type GenerateCmd ¶
type GenerateCmd struct {
Source []string `arg:"" help:"Source and target executor specifications (format: type:path)"`
Type string `short:"t" required:"" help:"Type of the target executor" enum:"file,dconf,systemd,sed"`
Name string `short:"n" help:"Name for the generated target"`
Output string `short:"o" help:"Output file path for the generated .cue data"`
Identifiers string `help:"Target identifiers in flattened format (e.g., options.use_spacing=true,backup=false,metadata.custom=value)"`
FileFormat string `` /* 132-byte string literal not displayed */
// contains filtered or unexported fields
}
GenerateCmd generates a .cue data file from the diff between two executor targets
type Globals ¶
type Globals struct {
LogLevel string `help:"Log level (trace,debug,info,warn,error)" default:"info"`
LogFormat string `help:"Log format (console,json)" default:"console"`
DryRun bool `help:"Show what would be deleted without actually editing" default:"false"`
Config string `short:"c" help:"Path to CUE data file or directory" default:"config/"`
Schema string `help:"Path to alternative CUE schema file. This will override the embedded schema. Use mainly for developing schema changes."`
StateDir string `help:"Directory for state storage. Not yet used." default:".state/"`
}
type ListCmd ¶
type ListCmd struct {
Long bool `short:"l" help:"Show detailed information about targets"`
Format string `short:"f" default:"table" enum:"table,json,yaml" help:"Output format (table, json, yaml)"`
}
ListCmd lists targets
type StatusCmd ¶
type StatusCmd struct {
Targets []string `arg:"" optional:"" help:"Rest of the arguments are a list of target names"`
}
StatusCmd performs status checks on the target system
type VersionCmd ¶
type VersionCmd struct{}
VersionCmd shows version information
func (*VersionCmd) Run ¶
func (v *VersionCmd) Run(name, version string) error
Click to show internal directories.
Click to hide internal directories.