Versions in this module Expand all Collapse all v0 v0.2.0 Aug 28, 2026 v0.1.0 Aug 27, 2026 Changes in this version + const EndOfOptions + const MaxOutputBytes + var BlockedEnvVars = map[string]bool + var ErrBackendUnavailable = errors.New("backend unavailable") + var ErrBlockedEnvVar = errors.New("env var blocked by hijack-prevention allowlist") + var ErrEscalationDenied = errors.New("escalation requires a password") + var ErrEscalationUnavailable = errors.New("escalation tool not installed") + var ErrInvalidEnvVar = errors.New("invalid env entry") + var ErrReservedEnvVar = errors.New("env var reserved by the SDK for deterministic output") + var ErrRunnerRequired = errors.New("runner is required") + var ErrSecretContainsNewline = errors.New("secret contains a newline or carriage return") + var ErrUnknownBackend = errors.New("unknown privilege backend") + var ValidEnvVarName = regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_]*$`) + func IsAllowedEnvVar(name string) bool + func SeparatePositionals(flags []string, positionals ...string) []string + func ValidateCommandEnv(env []string) error + type Command struct + Args []string + ChildPath string + Dir string + Env []string + Escalate bool + Name string + Stdin io.Reader + type CommandError struct + Err error + ExitCode int + Name string + Stderr string + func (e *CommandError) Error() string + func (e *CommandError) Unwrap() error + type OutputCallback func(streamType StreamType, line string, seq int64) + type PrivilegeBackend int + const Direct + const Doas + const Sudo + func Detect(ctx context.Context) []PrivilegeBackend + type Result struct + ExitCode int + Stderr string + Stdout string + type Runner interface + Backend func() PrivilegeBackend + Run func(ctx context.Context, c Command) (Result, error) + Stream func(ctx context.Context, c Command, onLine OutputCallback) (Result, error) + func NewRunner(b PrivilegeBackend) (Runner, error) + type Secret struct + func NewMultilineSecret(v string) Secret + func NewSecret(v string) (Secret, error) + func (s Secret) GoString() string + func (s Secret) HasNewline() bool + func (s Secret) IsZero() bool + func (s Secret) Reveal() string + func (s Secret) String() string + type StreamType int + const StreamStderr + const StreamStdout