env

package
v0.0.0-...-ed43dd5 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package env provides a unified method to create environment for envexec.

For linux, the env creates container & cgroup sandbox.

For windows, the env creates low mandatory level sandbox.

For macOS, the env creates sandbox_init sandbox.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuilder

func NewBuilder(c Config) (pool.EnvBuilder, map[string]any, error)

NewBuilder build a environment builder

Types

type Config

type Config struct {
	ContainerInitPath  string
	TmpFsParam         string
	NetShare           bool
	MountConf          string
	SeccompConf        string
	CgroupPrefix       string
	Cpuset             string
	ContainerCredStart int
	EnableCPURate      bool
	CPUCfsPeriod       time.Duration
	Logger
}

Config defines parameters to create environment builder

type Link struct {
	LinkPath string `yaml:"linkPath"`
	Target   string `yaml:"target"`
}

Link defines symlinks to be created after mounts

type Logger

type Logger interface {
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
}

Logger defines logger to print logs

type Mount

type Mount struct {
	Type     string `yaml:"type"`
	Source   string `yaml:"source"`
	Target   string `yaml:"target"`
	Readonly bool   `yaml:"readonly"`
	Data     string `yaml:"data"`
}

Mount defines single mount point configuration. type could be bind / tmpfs

type Mounts

type Mounts struct {
	Mount      []Mount  `yaml:"mount"`
	SymLinks   []Link   `yaml:"symLink"`
	MaskPaths  []string `yaml:"maskPath"`
	WorkDir    string   `yaml:"workDir"`
	HostName   string   `yaml:"hostName"`
	DomainName string   `yaml:"domainName"`
	UID        int      `yaml:"uid"`
	GID        int      `yaml:"gid"`
	Proc       bool     `yaml:"proc"`
}

Mounts defines mount points for the container.

Directories

Path Synopsis
Package pool provides reference implementation for envexec.EnvironmentPool from EnvBuilder
Package pool provides reference implementation for envexec.EnvironmentPool from EnvBuilder

Jump to

Keyboard shortcuts

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