sandbox

package
v0.0.0-...-016edcc Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MAX_ARG_STRLEN = 131072

Functions

func AddPathEnv

func AddPathEnv(env map[string]string, binDir string, isolatePath bool)

func FilterLongEnv

func FilterLongEnv(env map[string]string, args []string) error

func LookPath

func LookPath(file, path string) (string, error)

LookPath searches for an executable named file in the directories named by the PATH environment variable. If file contains a slash, it is tried directly and the PATH is not consulted. Otherwise, on success, the result is an absolute path.

In older versions of Go, LookPath could return a path relative to the current directory. As of Go 1.19, LookPath will instead return that path along with an error satisfying errors.Is(err, ErrDot). See the package documentation for more details.

func Make

func Make(ctx context.Context, cfg MakeConfig) error

func MakeBin

func MakeBin(cfg MakeBinConfig) error

Types

type Cmd

type Cmd struct {
	*exec.Cmd
	SoftContext context.Context
}

func Exec

func Exec(cfg ExecConfig) *Cmd

func (*Cmd) Run

func (c *Cmd) Run() error

func (*Cmd) Start

func (c *Cmd) Start() error

type ExecConfig

type ExecConfig struct {
	IOConfig
	SoftContext context.Context
	Context     context.Context
	BinDir      string
	Dir         string
	Env         map[string]string
	ExecArgs    []string
}

type File

type File = tar.File

type IOConfig

type IOConfig struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

type MakeBinConfig

type MakeBinConfig struct {
	Dir string
	Bin map[string]string
}

type MakeConfig

type MakeConfig struct {
	Dir           string
	BinDir        string
	Bin           map[string]string
	Files         []File
	FilesTar      []TarFile
	LinkFiles     []File
	ProgressFiles func(percent float64)
	ProgressTars  func(percent float64)
	ProgressLinks func(percent float64)
}

type TarFile

type TarFile struct {
	Path string
	Size int64
}

Jump to

Keyboard shortcuts

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