Documentation
¶
Index ¶
- Variables
- func New(id int, memQuota int64, logger *zap.SugaredLogger) (eval.Sandbox, error)
- func NewStupid(boxID int, memoryQuota int64, logger *zap.SugaredLogger) (eval.Sandbox, error)
- type IsolateBox
- func (b *IsolateBox) Close() error
- func (b *IsolateBox) FileExists(fpath string) bool
- func (b *IsolateBox) GetID() int
- func (b *IsolateBox) MemoryQuota() int64
- func (b *IsolateBox) ReadFile(fpath string, w io.Writer) error
- func (b *IsolateBox) RunCommand(ctx context.Context, command []string, conf *eval.RunConfig) (*eval.RunStats, error)
- func (b *IsolateBox) WriteFile(fpath string, r io.Reader, mode fs.FileMode) error
- type StupidSandbox
- func (b *StupidSandbox) Close() error
- func (b *StupidSandbox) FileExists(fpath string) bool
- func (b *StupidSandbox) GetID() int
- func (b *StupidSandbox) MemoryQuota() int64
- func (b *StupidSandbox) ReadFile(fpath string, w io.Writer) error
- func (b *StupidSandbox) RunCommand(ctx context.Context, command []string, conf *eval.RunConfig) (*eval.RunStats, error)
- func (b *StupidSandbox) WriteFile(fpath string, r io.Reader, mode fs.FileMode) error
Constants ¶
This section is empty.
Variables ¶
View Source
var CGTiming = config.GenFlag[bool]("feature.grader.use_cg_timing", false, "Use --cg-timing flag in grader. Should not be necessary.")
Functions ¶
Types ¶
type IsolateBox ¶
type IsolateBox struct {
// contains filtered or unexported fields
}
IsolateBox is the struct for the current box
func (*IsolateBox) Close ¶
func (b *IsolateBox) Close() error
func (*IsolateBox) FileExists ¶
func (b *IsolateBox) FileExists(fpath string) bool
FileExists returns if a file exists or not
func (*IsolateBox) GetID ¶
func (b *IsolateBox) GetID() int
func (*IsolateBox) MemoryQuota ¶
func (b *IsolateBox) MemoryQuota() int64
func (*IsolateBox) RunCommand ¶
type StupidSandbox ¶
type StupidSandbox struct {
// contains filtered or unexported fields
}
StupidSandbox can be used for testing. NOTE: should not be used in a proper environment. It has no proper memory limit And time limits are based on manually killing the program
func (*StupidSandbox) Close ¶
func (b *StupidSandbox) Close() error
func (*StupidSandbox) FileExists ¶
func (b *StupidSandbox) FileExists(fpath string) bool
func (*StupidSandbox) GetID ¶
func (b *StupidSandbox) GetID() int
func (*StupidSandbox) MemoryQuota ¶
func (b *StupidSandbox) MemoryQuota() int64
func (*StupidSandbox) RunCommand ¶
Click to show internal directories.
Click to hide internal directories.