Documentation
¶
Index ¶
- type Manager
- func (m *Manager) AddDir(path string) error
- func (m *Manager) AddFile(path string, content []byte) error
- func (m *Manager) AddSymlink(path string, target string) error
- func (m *Manager) Chmod(path string, mode os.FileMode) error
- func (m *Manager) Chown(path string, uid, gid int) error
- func (m *Manager) Create() error
- func (m *Manager) GetPath(path string) (string, error)
- func (m *Manager) HasOverride(layoutPath string) bool
- func (m *Manager) PathResolvesOutsideOverride(path, resolvedPath string) bool
- func (m *Manager) Update() error
- type RootedVFS
- func (v *RootedVFS) Chown(name string, uid, gid int) error
- func (v *RootedVFS) Close() error
- func (v *RootedVFS) Lchown(name string, uid, gid int) error
- func (v *RootedVFS) Mkdir(name string, perm os.FileMode) error
- func (v *RootedVFS) ReadDir(dir string) ([]iofs.DirEntry, error)
- func (v *RootedVFS) Readlink(name string) (string, error)
- func (v *RootedVFS) Stat(name string) (os.FileInfo, error)
- func (v *RootedVFS) Symlink(oldname, newname string) error
- func (v *RootedVFS) WriteFile(filename string, data []byte, perm os.FileMode) error
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// VFS is the virtual filesystem used to create the layout. It is rooted at
// the session directory. Note that nested bind targets are created using
// an os.Root rooted at the parent of the bind source target.
VFS *RootedVFS
// DirMode and FileMode are the default permissions for directories and
// files created by the manager.
DirMode os.FileMode
FileMode os.FileMode
// contains filtered or unexported fields
}
Manager constructs a container filesystem layout in the session directory.
func NewManager ¶ added in v4.5.0
NewManager returns a new layout manager with the provided path as its root.
func (*Manager) AddDir ¶
AddDir adds a directory in layout, will recursively add parent directories if they don't exist
func (*Manager) AddFile ¶
AddFile adds a file in layout, will recursively add parent directories if they don't exist
func (*Manager) AddSymlink ¶
AddSymlink adds a symlink in layout, will recursively add parent directories if they don't exist
func (*Manager) HasOverride ¶ added in v4.5.0
HasOverride returns true if the provided layout path is overridden by a bind, false otherwise.
func (*Manager) PathResolvesOutsideOverride ¶ added in v4.5.0
PathResolvesOutsideOverride reports whether resolvedPath falls outside the deepest bind source that overrides path. This catches symlinked paths that look like they are below a bind in the container layout, but resolve to a different host tree that cannot be reached through that bind target.
type RootedVFS ¶ added in v4.5.0
type RootedVFS struct {
// contains filtered or unexported fields
}
func NewRootedVFS ¶ added in v4.5.0
type Session ¶
type Session struct {
*Manager
Layer layer
}
Session directory layout manager
func NewSession ¶
func NewSession(path string, fstype string, size int, system *mount.System, layer layer) (*Session, error)
NewSession creates and returns a session directory layout manager
func (*Session) OverrideDir ¶
OverrideDir overrides a path in the session directory, it simulates a bind mount.
func (*Session) RootFsPath ¶
RootFsPath returns the full path to session rootfs directory