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) GetOverridePath(path string) (string, error)
- func (m *Manager) GetPath(path string) (string, error)
- func (m *Manager) SetRootPath(path string) error
- func (m *Manager) Update() error
- type Session
- type VFS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct { VFS VFS DirMode os.FileMode FileMode os.FileMode // contains filtered or unexported fields }
Manager manages a filesystem layout in a given path
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) GetOverridePath ¶
GetOverridePath returns the real path for the session path
func (*Manager) SetRootPath ¶
SetRootPath sets layout root path
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
type VFS ¶
type VFS interface { Chown(string, int, int) error EvalRelative(string, string) string Lchown(string, int, int) error Mkdir(string, os.FileMode) error Readlink(string) (string, error) ReadDir(string) ([]iofs.DirEntry, error) Stat(string) (os.FileInfo, error) Symlink(string, string) error Umask(int) int WriteFile(string, []byte, os.FileMode) error }
var DefaultVFS VFS = &defaultVFS{}
DefaultVFS is the default VFS.