Documentation ¶
Index ¶
- Constants
- func AttachLoopbackDevice(file string, readonly bool) (string, error)
- func CheckBinaryVersion(binaryName, minVersion string, args []string) error
- func CheckName(name string) error
- func CheckUUID(uuid string) error
- func CompressData(data []byte) (io.ReadSeeker, error)
- func CompressDir(sourceDir, targetFile string) error
- func CompressFile(filePath string) error
- func ConfigExists(fileName string) bool
- func Copy(src, dst string) error
- func DecompressAndVerify(src io.Reader, checksum string) (io.Reader, error)
- func DecompressDir(sourceFile, targetDir string) error
- func DecompressFile(filePath string) error
- func DetachLoopbackDevice(file, dev string) error
- func EncodeData(v interface{}) (*bytes.Buffer, error)
- func Execute(binary string, args []string) (string, error)
- func ExtractUUIDs(names []string, prefix, suffix string) ([]string, error)
- func GetChecksum(data []byte) string
- func GetFileChecksum(filePath string) (string, error)
- func GetFlag(v interface{}, key string, required bool, err error) (string, error)
- func GetName(v interface{}, key string, required bool, err error) (string, error)
- func GetUUID(v interface{}, key string, required bool, err error) (string, error)
- func InitMountNamespace(fd string) error
- func ListConfigIDs(root, prefix, suffix string) ([]string, error)
- func LoadConfig(fileName string, v interface{}) error
- func LockFile(fileName string) (*os.File, error)
- func MkdirIfNotExists(path string) error
- func MountPointPrepareBlockDevice(mp string, dev string) error
- func MountPointPrepareImageFile(mp string, size int64) error
- func MountPointRemoveFile(file string) error
- func Now() string
- func ObjectConfig(obj interface{}) (string, error)
- func ObjectDelete(obj interface{}) error
- func ObjectExists(obj interface{}) (bool, error)
- func ObjectLoad(obj interface{}) error
- func ObjectSave(obj interface{}) error
- func ParseSize(size string) (int64, error)
- func RemoveConfig(fileName string) error
- func RequiredMissingError(name string) error
- func SaveConfig(fileName string, v interface{}) error
- func SliceToMap(slices []string) map[string]string
- func UnescapeURL(url string) string
- func UnlockFile(f *os.File) error
- func ValidNetworkAddr(addr string) bool
- func ValidateName(name string) bool
- func ValidateUUID(s string) bool
- func VolumeMount(v interface{}, mountPoint string, remount bool) (string, error)
- func VolumeMountPointDirectoryCreate(v interface{}, dirName string) error
- func VolumeMountPointDirectoryRemove(v interface{}, dirName string) error
- func VolumeMountPointFileExists(v interface{}, file string, expectType string) bool
- func VolumeUmount(v interface{}) error
- type Index
- type ObjectOperations
- type VolumeHelper
Constants ¶
View Source
const ( MOUNT_BINARY = "mount" UMOUNT_BINARY = "umount" NSENTER_BINARY = "nsenter" IMAGE_FILE_NAME = "disk.img" BLOCK_DEV_NAME = "disk.dev" FILE_TYPE_REGULAR = "regular file" FILE_TYPE_DIRECTORY = "directory" FILE_TYPE_BLOCKDEVICE = "block special file" FILE_STAT_FORMAT_SIZE = "%s" FILE_STAT_FORMAT_TYPE = "%F" FILE_STAT_FORMAT_MAJOR_MINOR = "%t %T" )
View Source
const (
PRESERVED_CHECKSUM_LENGTH = 64
)
Variables ¶
This section is empty.
Functions ¶
func CheckBinaryVersion ¶
func CompressData ¶
func CompressData(data []byte) (io.ReadSeeker, error)
func CompressDir ¶
func CompressFile ¶
func ConfigExists ¶
func DecompressAndVerify ¶
func DecompressDir ¶
If sourceFile is inside targetDir, it would be deleted automatically
func DecompressFile ¶
func DetachLoopbackDevice ¶
func EncodeData ¶
func GetChecksum ¶
func GetFileChecksum ¶
func InitMountNamespace ¶ added in v0.4.1
func ListConfigIDs ¶
func LoadConfig ¶
func MkdirIfNotExists ¶
func MountPointPrepareBlockDevice ¶ added in v0.4.1
func MountPointPrepareImageFile ¶ added in v0.4.1
func MountPointRemoveFile ¶ added in v0.4.1
func ObjectConfig ¶
func ObjectDelete ¶
func ObjectDelete(obj interface{}) error
func ObjectExists ¶
func ObjectLoad ¶
func ObjectLoad(obj interface{}) error
func ObjectSave ¶
func ObjectSave(obj interface{}) error
func RemoveConfig ¶
func RequiredMissingError ¶
func SaveConfig ¶
func SliceToMap ¶
func UnescapeURL ¶ added in v0.4.1
func UnlockFile ¶
func ValidNetworkAddr ¶ added in v0.4.1
func ValidateName ¶
func ValidateUUID ¶
func VolumeMount ¶ added in v0.4.1
func VolumeMountPointDirectoryCreate ¶ added in v0.4.1
func VolumeMountPointDirectoryRemove ¶ added in v0.4.1
func VolumeMountPointFileExists ¶ added in v0.4.1
func VolumeUmount ¶ added in v0.4.1
func VolumeUmount(v interface{}) error
Types ¶
type ObjectOperations ¶
Click to show internal directories.
Click to hide internal directories.