Documentation ¶
Index ¶
- type Repository
- type Volume
- func (v *Volume) AddContainer(containerId string)
- func (v *Volume) Containers() []string
- func (v *Volume) FromDisk() error
- func (v *Volume) GetResourcePath(path string) (string, error)
- func (v *Volume) GetRootResourcePath(path string) (string, error)
- func (v *Volume) IsDir() (bool, error)
- func (v *Volume) RemoveContainer(containerId string)
- func (v *Volume) ToDisk() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(configPath string, driver graphdriver.Driver) (*Repository, error)
func (*Repository) Delete ¶
func (r *Repository) Delete(path string) error
func (*Repository) FindOrCreateVolume ¶
func (r *Repository) FindOrCreateVolume(path string, writable bool) (*Volume, error)
func (*Repository) Get ¶
func (r *Repository) Get(path string) *Volume
type Volume ¶
type Volume struct { ID string Path string IsBindMount bool Writable bool // contains filtered or unexported fields }
func (*Volume) AddContainer ¶
func (*Volume) Containers ¶
func (*Volume) GetResourcePath ¶
Evalutes `path` in the scope of the volume's root path, with proper path sanitisation. Symlinks are all scoped to the root of the volume, as though the volume's root was `/`.
The volume's root path is the host-facing path of the root of the volume's mountpoint inside a container.
NOTE: The returned path is *only* safely scoped inside the volume's root
if no component of the returned path changes (such as a component symlinking to a different path) between using this method and using the path. See symlink.FollowSymlinkInScope for more details.
func (*Volume) GetRootResourcePath ¶
Evalutes `path` in the scope of the volume's config path, with proper path sanitisation. Symlinks are all scoped to the root of the config path, as though the config path was `/`.
The config path of a volume is not exposed to the container and is just used to store volume configuration options and other internal information. If in doubt, you probably want to just use v.GetResourcePath.
NOTE: The returned path is *only* safely scoped inside the volume's config
path if no component of the returned path changes (such as a component symlinking to a different path) between using this method and using the path. See symlink.FollowSymlinkInScope for more details.