Documentation ¶
Overview ¶
Package osexec implements subprocess execution functions
Index ¶
- Variables
- func Execute(cmd string, args []string, env []string) ([]byte, error)
- func ExecuteAs(cmd string, args []string, uid int, gid int, env []string) ([]byte, error)
- func ExecuteAsContext(ctx context.Context, cmd string, args []string, uid int, gid int, env []string) ([]byte, error)
- func ExecuteAsWithTimeout(cmd string, args []string, uid int, gid int, timeout int, env []string) ([]byte, error)
- func ExecuteContext(ctx context.Context, cmd string, args []string, env []string) ([]byte, error)
- func ExecuteWithTimeout(cmd string, args []string, timeout int, env []string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidUID = errors.New("invalid UID") ErrInvalidGID = errors.New("invalid GID") )
Custom errors.
Functions ¶
func ExecuteAsContext ¶ added in v0.2.0
func ExecuteAsContext( ctx context.Context, cmd string, args []string, uid int, gid int, env []string, ) ([]byte, error)
ExecuteAsContext executes a command as a given UID and GID with context and return stdout/stderr.
func ExecuteAsWithTimeout ¶
func ExecuteAsWithTimeout( cmd string, args []string, uid int, gid int, timeout int, env []string, ) ([]byte, error)
ExecuteAsWithTimeout executes a command with timeout as a given UID and GID and return stdout/stderr.
func ExecuteContext ¶ added in v0.2.0
ExecuteContext executes a command with context and return stdout/stderr.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.