Documentation
¶
Overview ¶
Package backupcmd provides the "admin backup" command, which creates a JSONL backup of the entire issue database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RunInput ¶
type RunInput struct {
// DiscoverFunc locates the database file, returning its absolute path.
// In production this is Factory.DatabasePath (workspace-aware); tests
// provide a stub. Only called when Output is empty — the discovered
// .np/ directory determines the default backup location.
DiscoverFunc func() (string, error)
// BackupFunc performs the actual backup, writing issue data to the
// provided writer and returning the number of issues written. In
// production this wraps svc.Backup; tests provide a stub. The
// writer is a gzip.Writer that the caller manages — BackupFunc
// should not close it.
BackupFunc func(w io.WriteCloser) (int, error)
// Output is the user-specified destination path. When empty, the
// backup file is written to the discovered .np/ directory with a
// timestamp-based filename.
Output string
// JSON enables machine-readable JSON output.
JSON bool
// WriteTo receives the command's human-readable or JSON output.
WriteTo io.Writer
// SuccessIcon returns a colored or plain success indicator for
// human-readable output. When nil, a default "[ok]" is used.
SuccessIcon func() string
}
RunInput holds the parameters for the backup command's core logic, decoupled from CLI flag parsing so it can be tested directly.
Click to show internal directories.
Click to hide internal directories.