config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 9 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 = ""
)

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
	Keep         bool
	EnvAll       bool
	Background   bool
	NS           NS
	ChangeDir    string
	Exec         string
	Devtmpfs     string
	Resolv       string
	Hosts        string
	Status       string
	Volumes      Volumes
	HostArgs     []string

	Ifaces []NetIface
}

func AllContainers

func AllContainers() []Config

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 NS

type NS struct {
	Net    string
	Pid    string
	Uts    string
	User   string
	Ipc    string
	Cgroup string
	NS     string
	Mnt    string
	Time   string
}

type NetIface

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

type Volumes

type Volumes []string

func (*Volumes) Set

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

func (*Volumes) String

func (f *Volumes) String() string

Jump to

Keyboard shortcuts

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