Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ExitCodeTimeLimitExceeded is error code that returned by child process when // the command is exceeding specified time limit. ExitCodeTimeLimitExceeded = 11 // ExitCodeMemoryLimitExceeded is error code that returned by child process when // the command is exceeding specified memory limit. ExitCodeMemoryLimitExceeded = 12 // ExitCodeInternalError is error code that returned by child process when // the command is failed to processed ExitCodeInternalError = 13 // ExitCodeRuntimeError is error code that returned by child process when // the command exit code is not zero ExitCodeRuntimeError = 14 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CGroup ¶
type CGroup interface { ThrottleMemory(bytes uint64) error LimitMemory(bytes uint64) error LimitCPU(duration time.Duration) error Put(process *os.Process) error Monitor(ctx context.Context) context.Context Usage() CGroupUsage Error() error }
CGroup limits processes's memory and cpu usage using linux cgroup.
type CGroupUsage ¶
CGroupUsage represent process usage monitored using cgroup.
type FS ¶
type FS interface { Load(imagePath string, uid, gid int) error Chroot(imagePath string) error Bind(imagePath string, bind ugrade.FSBind, uid, gid int) (FSUnbind, error) }
FS used to creating filesystem inside sandbox
type Guard ¶
Guard run `Command` and monitor system resource limit, and kill process when exceeding the limit.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.