Help us shape the future of Go! Take the 2026 Go Developer Survey

os

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDriverInstanceDiscovery = errors.New("Driver Instance discovery failed")
)

Functions

func Register

func Register(name string, initFunc InitFunc)

Types

type Driver

type Driver interface {
	// Name returns the name of the driver
	Name() string

	// Shows the existing mount points
	GetMounts(string, string) ([]*mount.Info, error)

	// Check whether path is mounted or not
	Mounted(string) (bool, error)

	// Unmount based on a path
	Unmount(string) error

	// Mount based on a device, target, options, label
	Mount(string, string, string, string) error

	// Format a device with a FS type
	Format(string, string, bool) error
}

type InitFunc

type InitFunc func(conf *config.Config) (Driver, error)

type OSDriverManager

type OSDriverManager struct {
	Drivers map[string]Driver
	Config  *config.Config
}

func NewOSDriverManager

func NewOSDriverManager(conf *config.Config) (*OSDriverManager, error)

func (*OSDriverManager) Format

func (osdm *OSDriverManager) Format(deviceName, fsType string, overwriteFs bool) error

func (*OSDriverManager) GetMounts

func (osdm *OSDriverManager) GetMounts(deviceName, mountPoint string) ([]*mount.Info, error)

func (*OSDriverManager) IsDrivers

func (osdm *OSDriverManager) IsDrivers() bool

func (*OSDriverManager) Mount

func (osdm *OSDriverManager) Mount(device, target, mountOptions, mountLabel string) error

func (*OSDriverManager) Mounted

func (osdm *OSDriverManager) Mounted(mountPoint string) (bool, error)

func (*OSDriverManager) Unmount

func (osdm *OSDriverManager) Unmount(mountPoint string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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