instance

package
v3.0.3-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckName

func CheckName(name string) error

CheckName checks if name is a valid instance name

func ExtractName

func ExtractName(name string) string

ExtractName extracts instance name from an instance:// URI

func ProcName

func ProcName(name string, username string) string

ProcName returns processus name based on instance name and username

func SetLogFile

func SetLogFile(name string, uid int) (*os.File, *os.File, error)

SetLogFile replaces stdout/stderr streams and redirect content to log file

Types

type File

type File struct {
	Path       string `json:"-"`
	Pid        int    `json:"pid"`
	PPid       int    `json:"ppid"`
	Name       string `json:"name"`
	User       string `json:"user"`
	Image      string `json:"image"`
	Privileged bool   `json:"privileged"`
	Config     []byte `json:"config"`
}

File represents an instance file storing instance information

func Add

func Add(name string, privileged bool) (*File, error)

Add creates an instance file for a named instance in a privileged or unprivileged path

func Get

func Get(name string) (*File, error)

Get returns the instance file corresponding to instance name

func List

func List(username string, name string) ([]*File, error)

List returns instance files matching username and/or name pattern

func (*File) Delete

func (i *File) Delete() error

Delete deletes instance file

func (*File) PrivilegedPath

func (i *File) PrivilegedPath() bool

PrivilegedPath returns if instance file is stored in privileged path or not

func (*File) Update

func (i *File) Update() error

Update stores instance information in associated instance file

Jump to

Keyboard shortcuts

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