util

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src string, dst string) error

func CreateDirectories

func CreateDirectories() error

Creates the /var/lib/firecracker/{vm,image,kernel} directories

func DirExists

func DirExists(dirname string) bool

func ExecForeground

func ExecForeground(command string, args ...string) (int, error)

func ExecuteCommand

func ExecuteCommand(command string, args ...string) (string, error)

func FileExists

func FileExists(filename string) bool

func FileIsEmpty

func FileIsEmpty(file string) (bool, error)

FileIsEmpty returns true if the file is empty

func IsEmptyString

func IsEmptyString(input string) bool

func MatchPrefix

func MatchPrefix(prefix string, fields ...string) []string

func NewMAC

func NewMAC(buffer *[]string) error

Fills the given string slice with unique MAC addresses

func NewOutput

func NewOutput() *output

func PathExists

func PathExists(path string) (bool, os.FileInfo)

func RandomName

func RandomName() string

Types

type IDHandler

type IDHandler struct {
	ID string
	// contains filtered or unexported fields
}

func NewID

func NewID(baseDir string) (*IDHandler, error)

Creates a new 8-byte ID and handles directory creation/deletion

func (*IDHandler) Remove

func (i *IDHandler) Remove() error

func (*IDHandler) Success

func (i *IDHandler) Success()

type MountPoint

type MountPoint struct {
	Path string
}

func Mount

func Mount(volume string) (*MountPoint, error)

func (*MountPoint) Umount

func (mp *MountPoint) Umount() error

Jump to

Keyboard shortcuts

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