Documentation
¶
Index ¶
- func Clearenv()
- func Command(name string, args ...string) *exec.Cmd
- func CommandContext(ctx context.Context, name string, args ...string) *exec.Cmd
- func Do(scope Scope, fn func() error) error
- func Environ() []string
- func ExpandEnv(s string) string
- func Getenv(key string) string
- func LookupEnv(key string) (string, bool)
- func Println(a ...any) (int, error)
- func Run(cmd *exec.Cmd) error
- func Setenv(key, value string) error
- func Unsetenv(key string) error
- type Middleware
- type Request
- type Scope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clearenv ¶ added in v0.3.2
func Clearenv()
Clearenv removes all variables from the active command scope. Without a scope, it has the same behavior as os.Clearenv.
func CommandContext ¶
CommandContext is the brokered equivalent of exec.CommandContext.
func Environ ¶ added in v0.3.2
func Environ() []string
Environ returns a copy of the active command scope environment. Without a scope, it has the same behavior as os.Environ.
func ExpandEnv ¶ added in v0.3.2
ExpandEnv expands variables using the active command scope environment.
func Getenv ¶ added in v0.3.2
Getenv returns the value of key from the active command scope. Without a scope, it has the same behavior as os.Getenv.
func LookupEnv ¶ added in v0.3.2
LookupEnv returns the value of key and whether it is present in the active command scope. Without a scope, it has the same behavior as os.LookupEnv.
func Run ¶
Run applies the active scope to an existing command and runs it. This is used by runtimes such as gsh that construct exec.Cmd internally.
Types ¶
type Middleware ¶
Middleware may rewrite a command before execution. Returning an error prevents the command from starting.