config

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeString string
	TypeInt    int
	TypeUint   uint
)
View Source
var (
	// Main folder for all container related files
	Workdir    string = "/var/lib/sandal"
	Containers string = ""
)
View Source
var Namespaces []string = []string{"pid", "net", "user", "uts", "ipc", "cgroup", "mnt", "time", "ns"}

Functions

func GenerateContainerId

func GenerateContainerId() string

Types

type ALocFor

type ALocFor uint8
const (
	ALocForHost ALocFor = iota
	ALocForHostPod
	ALocForPod
)

type Config

type Config struct {
	Name string

	Created   int64
	HostPid   int
	ContPid   int
	LoopDevNo int
	TmpSize   uint

	SquashfsFile string
	RootfsDir    string
	ReadOnly     bool
	Remove       bool
	EnvAll       bool
	Background   bool
	Startup      bool
	NS           map[string]*StringWrapper
	ChangeDir    string
	Exec         string
	Devtmpfs     string
	Resolv       string
	Hosts        string
	Status       string
	Dir          string
	Volumes      StringFlags
	HostArgs     []string
	PodArgs      []string
	LowerDirs    StringFlags
	RunPreExec   StringFlags
	RunPrePivot  StringFlags
	PassEnv      StringFlags

	Ifaces []NetIface
}

func AllContainers

func AllContainers() ([]Config, error)

func GetByName added in v1.3.0

func GetByName(conts *[]Config, name string) (Config, error)

func LoadConfig

func LoadConfig(name string) (Config, error)

func NewContainer

func NewContainer() Config

func (*Config) ConfigFileLoc

func (c *Config) ConfigFileLoc() string

func (*Config) ContDir

func (c *Config) ContDir() string

ContDir returns the work directory for curret container

func (Config) Json

func (c Config) Json() []byte

func (*Config) SaveConftoDisk

func (c *Config) SaveConftoDisk() error

type NetIface

type NetIface struct {
	Name    string
	Type    string
	IP      string
	ALocFor ALocFor // host, host-pod (aka veth), pod
	Main    []NetIface
}

type StringFlags added in v1.5.0

type StringFlags []string

func (*StringFlags) Set added in v1.5.0

func (f *StringFlags) Set(value string) error

func (*StringFlags) String added in v1.5.0

func (f *StringFlags) String() string

type StringWrapper added in v1.5.0

type StringWrapper struct {
	Value string
}

Jump to

Keyboard shortcuts

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