Documentation
¶
Index ¶
- Constants
- func AddPath2Env(p string)
- func GetCallerAndOptions() (string, string)
- func GetConsoleCP() int
- func GetSysProcAttr() *syscall.SysProcAttr
- func NeedSearchToolchain(input *env.Sandbox) bool
- func RedirectStderror(f string) error
- func RunServer(command string) error
- type Sandbox
- func (s *Sandbox) ExecCommand(name string, arg ...string) (int, error)
- func (s *Sandbox) ExecCommandWithMessage(name string, arg ...string) (int, []byte, []byte, error)
- func (s *Sandbox) ExecScripts(src string) (int, error)
- func (s *Sandbox) ExecScriptsRaw(src string) (int, error)
- func (s *Sandbox) ExecScriptsWithMessage(src string) (int, []byte, []byte, error)
- func (s *Sandbox) Fork() *Sandbox
- func (s *Sandbox) GetAbsPath(path string) string
- func (s *Sandbox) GetDir() string
- func (s *Sandbox) LookPath(file string) (string, error)
- func (s *Sandbox) StartCommand(name string, arg ...string) (*exec.Cmd, error)
- func (s *Sandbox) StartScripts(src string) (*exec.Cmd, error)
Constants ¶
View Source
const ( ExitErrorCode = 99 DevOPSProcessTreeKillKey = "DEVOPS_DONT_KILL_PROCESS_TREE" )
Variables ¶
This section is empty.
Functions ¶
func GetCallerAndOptions ¶
GetCallerAndOptions return the caller and options in unix
func GetSysProcAttr ¶
func GetSysProcAttr() *syscall.SysProcAttr
GetSysProcAttr set process group id to a new id, in case of the signals sent to the caller affect the process as well
func NeedSearchToolchain ¶
func RedirectStderror ¶
Types ¶
type Sandbox ¶
type Sandbox struct { Ctx context.Context Env *env.Sandbox Dir string User user.User Stdout io.Writer Stderr io.Writer // contains filtered or unexported fields }
Sandbox describe the handler to build up an isolated execution environment
func (*Sandbox) ExecCommand ¶
ExecCommand run the origin commands
func (*Sandbox) ExecCommandWithMessage ¶
ExecCommandWithMessage run the commands and get the stdout and stderr
func (*Sandbox) ExecScripts ¶
ExecScripts run the scripts
func (*Sandbox) ExecScriptsWithMessage ¶
ExecScriptsWithMessage run the scripts and return the output
func (*Sandbox) GetAbsPath ¶
GetAbsPath return the abs path related to current running dir
func (*Sandbox) StartCommand ¶
StartCommand start the origin commands
Click to show internal directories.
Click to hide internal directories.