disk

package
Version: v0.0.0-...-9a89ba0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2014 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdMountsSearcher

func NewCmdMountsSearcher(runner boshsys.CmdRunner) cmdMountsSearcher

func NewDiskUtil

func NewDiskUtil(diskPath string, mounter Mounter, fs boshsys.FileSystem, logger boshlog.Logger) boshdevutil.DeviceUtil

func NewLinuxBindMounter

func NewLinuxBindMounter(delegateMounter Mounter) linuxBindMounter

func NewLinuxFormatter

func NewLinuxFormatter(runner boshsys.CmdRunner, fs boshsys.FileSystem) (formatter linuxFormatter)

func NewLinuxMounter

func NewLinuxMounter(
	runner boshsys.CmdRunner,
	mountsSearcher MountsSearcher,
	unmountRetrySleep time.Duration,
) (mounter linuxMounter)

func NewProcMountsSearcher

func NewProcMountsSearcher(fs boshsys.FileSystem) procMountsSearcher

func NewRootDevicePartitioner

func NewRootDevicePartitioner(logger boshlog.Logger, cmdRunner boshsys.CmdRunner, deltaInBytes uint64) rootDevicePartitioner

func NewSfdiskPartitioner

func NewSfdiskPartitioner(logger boshlog.Logger, cmdRunner boshsys.CmdRunner) (partitioner sfdiskPartitioner)

Types

type FileSystemType

type FileSystemType string
const (
	FileSystemSwap FileSystemType = "swap"
	FileSystemExt4 FileSystemType = "ext4"
)

type Formatter

type Formatter interface {
	Format(partitionPath string, fsType FileSystemType) (err error)
}

type Manager

type Manager interface {
	GetPartitioner() Partitioner
	GetRootDevicePartitioner() Partitioner
	GetFormatter() Formatter
	GetMounter() Mounter
	GetMountsSearcher() MountsSearcher
	GetDiskUtil(diskPath string) boshdevutil.DeviceUtil
}

func NewLinuxDiskManager

func NewLinuxDiskManager(
	logger boshlog.Logger,
	runner boshsys.CmdRunner,
	fs boshsys.FileSystem,
	bindMount bool,
) (manager Manager)

type Mount

type Mount struct {
	PartitionPath string
	MountPoint    string
}

type Mounter

type Mounter interface {
	Mount(partitionPath, mountPoint string, mountOptions ...string) (err error)
	Unmount(partitionOrMountPoint string) (didUnmount bool, err error)

	RemountAsReadonly(mountPoint string) (err error)
	Remount(fromMountPoint, toMountPoint string, mountOptions ...string) (err error)

	SwapOn(partitionPath string) (err error)

	IsMountPoint(path string) (result bool, err error)
	IsMounted(devicePathOrMountPoint string) (result bool, err error)
}

type MountsSearcher

type MountsSearcher interface {
	SearchMounts() ([]Mount, error)
}

type Partition

type Partition struct {
	SizeInBytes uint64
	Type        PartitionType
}

func (Partition) String

func (p Partition) String() string

type PartitionType

type PartitionType string
const (
	PartitionTypeSwap  PartitionType = "swap"
	PartitionTypeLinux PartitionType = "linux"
	PartitionTypeEmpty PartitionType = "empty"
)

type Partitioner

type Partitioner interface {
	Partition(devicePath string, partitions []Partition) (err error)
	GetDeviceSizeInBytes(devicePath string) (size uint64, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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