Documentation
¶
Index ¶
- func AptGet() func(context.Context) *exec.Cmd
- func Ip() func(context.Context) *exec.Cmd
- func MachineRun(ctx context.Context, log *slog.Logger, machine string, args ...string) (string, error)
- func Machinectl() func(context.Context) *exec.Cmd
- func OutputCmd(ctx context.Context, logger *slog.Logger, name string, args ...string) (string, error)
- func RunCmd(ctx context.Context, logger *slog.Logger, ...) error
- func Sysctl() func(context.Context) *exec.Cmd
- func Systemctl() func(context.Context) *exec.Cmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MachineRun ¶
func MachineRun(ctx context.Context, log *slog.Logger, machine string, args ...string) (string, error)
MachineRun executes a command inside the named nspawn machine using systemd-run --machine=<machine> --pipe --wait. It streams stdout at Debug and stderr at Error, and returns the captured stdout.
func Machinectl ¶
Machinectl returns a command factory for machinectl.
func OutputCmd ¶
func OutputCmd(ctx context.Context, logger *slog.Logger, name string, args ...string) (string, error)
OutputCmd runs the command specified by name and args, streams stdout at Debug and stderr at Error, and returns the captured stdout as a string. Unlike RunCmd it does not require a command factory - just a binary path.
func RunCmd ¶
func RunCmd(ctx context.Context, logger *slog.Logger, newCmd func(context.Context) *exec.Cmd, args ...string) error
RunCmd creates a command from the given factory, appends args, streams stdout at Debug and stderr at Error, and waits for it to finish.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.