sandbox

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsolateRoot = getEnv("ISOLATE_ROOT", "/var/local/lib/isolate/")

Functions

func NewIsolate

func NewIsolate(id int) language.Sandbox

Types

type Dummy

type Dummy struct {
	// contains filtered or unexported fields
}

func NewDummy

func NewDummy() *Dummy

func (*Dummy) AddArg

func (s *Dummy) AddArg(string) language.Sandbox

func (*Dummy) Cleanup

func (s *Dummy) Cleanup() error

func (*Dummy) CreateFile

func (s *Dummy) CreateFile(name string, r io.Reader) error

func (*Dummy) Env

func (s *Dummy) Env() language.Sandbox

func (Dummy) GetFile

func (s Dummy) GetFile(name string) (io.Reader, error)

func (Dummy) Id

func (s Dummy) Id() string

func (*Dummy) Init

func (s *Dummy) Init(logger *log.Logger) error

func (Dummy) MakeExecutable

func (s Dummy) MakeExecutable(name string) error

func (*Dummy) MapDir

func (s *Dummy) MapDir(x string, y string, i []string, b bool) language.Sandbox

func (*Dummy) MemoryLimit

func (s *Dummy) MemoryLimit(int) language.Sandbox

func (Dummy) Pwd

func (s Dummy) Pwd() string

func (*Dummy) Run

func (s *Dummy) Run(prg string, needStatus bool) (language.Status, error)

func (*Dummy) SetEnv

func (s *Dummy) SetEnv(env string) language.Sandbox

func (*Dummy) SetMaxProcesses

func (s *Dummy) SetMaxProcesses(i int) language.Sandbox

func (*Dummy) Stderr

func (s *Dummy) Stderr(writer io.Writer) language.Sandbox

func (*Dummy) Stdin

func (s *Dummy) Stdin(reader io.Reader) language.Sandbox

func (*Dummy) Stdout

func (s *Dummy) Stdout(writer io.Writer) language.Sandbox

func (*Dummy) TimeLimit

func (s *Dummy) TimeLimit(tl time.Duration) language.Sandbox

func (*Dummy) Verbose

func (s *Dummy) Verbose() language.Sandbox

func (*Dummy) WorkingDirectory

func (s *Dummy) WorkingDirectory(dir string) language.Sandbox

type Isolate

type Isolate struct {
	// contains filtered or unexported fields
}

func (*Isolate) AddArg

func (s *Isolate) AddArg(a string) language.Sandbox

func (*Isolate) Cleanup

func (s *Isolate) Cleanup() error

func (*Isolate) ClearArguments

func (s *Isolate) ClearArguments()

func (*Isolate) CreateFile

func (s *Isolate) CreateFile(name string, r io.Reader) error

func (*Isolate) Env

func (s *Isolate) Env() language.Sandbox

func (*Isolate) GetFile

func (s *Isolate) GetFile(name string) (io.Reader, error)

func (*Isolate) Id

func (s *Isolate) Id() string

func (*Isolate) Init

func (s *Isolate) Init(l *log.Logger) error

func (*Isolate) MakeExecutable

func (s *Isolate) MakeExecutable(name string) error

func (*Isolate) MapDir

func (s *Isolate) MapDir(src string, dest string, opts []string, checkExists bool) language.Sandbox

func (*Isolate) MemoryLimit

func (s *Isolate) MemoryLimit(ml int) language.Sandbox

func (*Isolate) Pwd

func (s *Isolate) Pwd() string

func (*Isolate) Run

func (s *Isolate) Run(args string, needStatus bool) (language.Status, error)

func (*Isolate) SetEnv

func (s *Isolate) SetEnv(e string) language.Sandbox

func (*Isolate) SetMaxProcesses

func (s *Isolate) SetMaxProcesses(num int) language.Sandbox

func (*Isolate) Stderr

func (s *Isolate) Stderr(writer io.Writer) language.Sandbox

func (*Isolate) Stdin

func (s *Isolate) Stdin(reader io.Reader) language.Sandbox

func (*Isolate) Stdout

func (s *Isolate) Stdout(writer io.Writer) language.Sandbox

func (*Isolate) TimeLimit

func (s *Isolate) TimeLimit(tl time.Duration) language.Sandbox

func (*Isolate) Verbose

func (s *Isolate) Verbose() language.Sandbox

func (*Isolate) WorkingDirectory

func (s *Isolate) WorkingDirectory(wd string) language.Sandbox

type PrefixBuffer added in v0.2.0

type PrefixBuffer struct {
	io.Writer
	// contains filtered or unexported fields
}

func NewPrefixBuffer added in v0.2.0

func NewPrefixBuffer(w io.Writer, len int) *PrefixBuffer

func (*PrefixBuffer) Prefix added in v0.2.0

func (pb *PrefixBuffer) Prefix() []byte

func (*PrefixBuffer) Write added in v0.2.0

func (pb *PrefixBuffer) Write(bs []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL