storage

package
v0.0.0-...-6cb77cc Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MSReadOnly equals unix.MS_RDONLY
	MSReadOnly = unix.MS_RDONLY
)

Variables

This section is empty.

Functions

func Unmount

func Unmount(trg string) (e error)

Unmount unmounts given directory.

Types

type Config

type Config struct {
	Size uint64 // Size of sotrage to create in KiB.
}

Config holds the configuration for the storage.

type Storage

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

Storage describes storage.

func Bind

func Bind(trg string, src string, flag uintptr) (s Storage, e error)

Bind mounts `src` direcotry to `trg`.

func NewStorage

func NewStorage(config Config) (s Storage, e error)

NewStorage creates a new storage based on the given configuration and returns its descriptor.

func (Storage) Path

func (s Storage) Path() string

Path returns the path of this storage.

func (Storage) PathOnHost

func (s Storage) PathOnHost() string

PathOnHost returns the path of this storage on host.

func (Storage) Remove

func (s Storage) Remove() (e error)

Remove removes a storage.

func (Storage) RemoveDetach

func (s Storage) RemoveDetach()

RemoveDetach removes a storage and warns if failed not return error.

Jump to

Keyboard shortcuts

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