mount

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetFilePermissions

func SetFilePermissions(path string, p FilePermissions) error

SetFilePermissions handles configuring ownership and permissions settings on a given file. It takes a path and any struct implementing the FilePermissions interface. All permission/ownership settings are optional. If no user or group is specified, the current user/group will be used. Mode is optional, and has no default (the operation is not performed if absent). User may be specified by name or ID, but group may only be specified by ID.

Types

type DefaultDriver

type DefaultDriver struct {
	// contains filtered or unexported fields
}

DefaultDriver - default mount driver

func New

func New(deviceRootPath string) *DefaultDriver

New - creates new instance of default driver

func (*DefaultDriver) MountVolume

func (d *DefaultDriver) MountVolume(ctx context.Context, id, mountpoint, fsType string) error

MountVolume - mounts specified volume

func (*DefaultDriver) UnmountVolume

func (d *DefaultDriver) UnmountVolume(ctx context.Context, mountpoint string) error

UnmountVolume - unmounts specified mountpoint

type Driver

type Driver interface {
	MountVolume(ctx context.Context, id, mountpoint, fsType string) error
	UnmountVolume(ctx context.Context, mountpoint string) error
}

Driver - generic mount driver interface

type FilePermissions

type FilePermissions interface {
	// User returns a user ID or user name
	User() string

	// Group returns a group ID. Group names are not supported.
	Group() string

	// Mode returns a string of file mode bits e.g. "0644"
	Mode() string
}

FilePermissions is an interface which allows a struct to set ownership and permissions easily on a file it describes.

Jump to

Keyboard shortcuts

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