execenv

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCommand

func ValidateCommand(command []string) error

ValidateCommand checks if a command is safe and accessible

Types

type ExecOptions

type ExecOptions struct {
	Command           []string                        // Command and arguments to run
	Environment       map[string]string               // Plaintext environment (for backward compat + display)
	SecureEnvironment map[string]*secure.SecureBuffer // Secure environment (preferred for execution)
	AllowOverride     bool                            // Allow existing env vars to override dsops values
	PrintVars         bool                            // Print resolved variables (names only, values masked)
	WorkingDir        string                          // Working directory for the command
	Timeout           int                             // Timeout in seconds (0 for no timeout)
}

ExecOptions configures command execution

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor handles running commands with ephemeral environment variables

func New

func New(logger *logging.Logger) *Executor

New creates a new executor

func (*Executor) Exec

func (e *Executor) Exec(ctx context.Context, options ExecOptions) error

Exec runs a command with the provided environment variables

Jump to

Keyboard shortcuts

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