Documentation ¶
Index ¶
- type Provider
- func (p *Provider) ClearMountpoint(mntpt string) error
- func (p *Provider) IsMounted(target string) (bool, error)
- func (p *Provider) MakeMountPath(path string, tgtUID, tgtGID int) error
- func (p *Provider) Mount(req storage.MountRequest) (*storage.MountResponse, error)
- func (p *Provider) Unmount(req storage.MountRequest) (*storage.MountResponse, error)
- type SystemProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider provides methods to interact with a generic storage device.
func DefaultProvider ¶
DefaultProvider returns an initialized *Provider suitable for use with production code.
func NewProvider ¶
func NewProvider(log logging.Logger, sys SystemProvider) *Provider
NewProvider returns an initialized *Provider.
func (*Provider) ClearMountpoint ¶
ClearMountpoint unmounts and removes a mountpoint.
func (*Provider) MakeMountPath ¶
MakeMountPath will build the target path by creating any non-existent subdirectories and setting ownership to target uid/gid to ensure that the target user is able to access the created mount point if multiple layers deep. If subdirectories in path already exist, their permissions will not be modified.
func (*Provider) Mount ¶
func (p *Provider) Mount(req storage.MountRequest) (*storage.MountResponse, error)
Mount mounts a given device with a set of arguments.
func (*Provider) Unmount ¶
func (p *Provider) Unmount(req storage.MountRequest) (*storage.MountResponse, error)
Unmount unmounts a device from a mount point.
type SystemProvider ¶
type SystemProvider interface { system.IsMountedProvider system.MountProvider system.UnmountProvider Chmod(string, os.FileMode) error Chown(string, int, int) error Getegid() int Geteuid() int Mkdir(string, os.FileMode) error RemoveAll(string) error Stat(string) (os.FileInfo, error) }
SystemProvider provides operating system capabilities.