safeexec

package
v0.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(path, executionPath, cgroupName string) (*Manager, error)

func (*Manager) Create

func (m *Manager) Create(ctx context.Context, config ProcessConfig) (*Process, error)

type Process

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

func (*Process) Release

func (p *Process) Release() error

Release releases all associatet resources with process.

func (*Process) Start

func (p *Process) Start() error

func (*Process) UpperDir

func (p *Process) UpperDir() string

func (*Process) UpperPath

func (p *Process) UpperPath(path string) string

func (*Process) Wait

func (p *Process) Wait() (Report, error)

type ProcessConfig

type ProcessConfig struct {
	TimeLimit   time.Duration
	MemoryLimit int64
	Stdin       io.Reader
	Stdout      io.Writer
	Stderr      io.Writer
	Layers      []string
	Environ     []string
	Workdir     string
	Command     []string
}

type Report

type Report struct {
	Time     time.Duration
	RealTime time.Duration
	Memory   int64
	ExitCode int
}

Jump to

Keyboard shortcuts

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