Documentation
¶
Index ¶
- func New(fs billy.Basic, base string) billy.Filesystem
- type ChrootHelper
- func (fs *ChrootHelper) Capabilities() billy.Capability
- func (fs *ChrootHelper) Chmod(path string, mode fs.FileMode) error
- func (fs *ChrootHelper) Chroot(path string) (billy.Filesystem, error)
- func (fs *ChrootHelper) Create(filename string) (billy.File, error)
- func (fs *ChrootHelper) Join(elem ...string) string
- func (fs *ChrootHelper) Lstat(filename string) (os.FileInfo, error)
- func (fs *ChrootHelper) MkdirAll(filename string, perm fs.FileMode) error
- func (fs *ChrootHelper) Open(filename string) (billy.File, error)
- func (fs *ChrootHelper) OpenFile(filename string, flag int, mode fs.FileMode) (billy.File, error)
- func (fs *ChrootHelper) ReadDir(path string) ([]fs.DirEntry, error)
- func (fs *ChrootHelper) Readlink(link string) (string, error)
- func (fs *ChrootHelper) Remove(path string) error
- func (fs *ChrootHelper) Rename(from, to string) error
- func (fs *ChrootHelper) Root() string
- func (fs *ChrootHelper) Stat(filename string) (os.FileInfo, error)
- func (fs *ChrootHelper) Symlink(target, link string) error
- func (fs *ChrootHelper) TempFile(dir, prefix string) (billy.File, error)
- func (fs *ChrootHelper) Underlying() billy.Basic
- type FileDescriptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChrootHelper ¶
type ChrootHelper struct {
// contains filtered or unexported fields
}
ChrootHelper is a helper to implement billy.Chroot. It is not a security boundary; callers that need containment should use a filesystem implementation that enforces paths at the OS boundary instead.
func (*ChrootHelper) Capabilities ¶
func (fs *ChrootHelper) Capabilities() billy.Capability
Capabilities implements the Capable interface.
func (*ChrootHelper) Chroot ¶
func (fs *ChrootHelper) Chroot(path string) (billy.Filesystem, error)
func (*ChrootHelper) Join ¶
func (fs *ChrootHelper) Join(elem ...string) string
func (*ChrootHelper) MkdirAll ¶
func (fs *ChrootHelper) MkdirAll(filename string, perm fs.FileMode) error
func (*ChrootHelper) Readlink ¶
func (fs *ChrootHelper) Readlink(link string) (string, error)
Readlink returns the target stored for link.
Relative targets are returned unchanged, preserving the original separators as written by ChrootHelper.Symlink or the underlying filesystem. Absolute targets that resolve under the chroot base are translated back to be absolute relative to the chroot (using the host path separator), so callers see paths in the chroot's coordinate system rather than the underlying filesystem's. Absolute targets that resolve outside the base are returned as written.
func (*ChrootHelper) Remove ¶
func (fs *ChrootHelper) Remove(path string) error
func (*ChrootHelper) Rename ¶
func (fs *ChrootHelper) Rename(from, to string) error
func (*ChrootHelper) Root ¶
func (fs *ChrootHelper) Root() string
func (*ChrootHelper) Symlink ¶
func (fs *ChrootHelper) Symlink(target, link string) error
Symlink creates link with the given target. Slashes in target are normalised to the host separator. Absolute targets are rewritten to be rooted under the chroot base before being stored, so that the link is resolvable when the chroot is reopened from a different working directory. Relative targets are stored as provided.
func (*ChrootHelper) TempFile ¶
func (fs *ChrootHelper) TempFile(dir, prefix string) (billy.File, error)
func (*ChrootHelper) Underlying ¶
func (fs *ChrootHelper) Underlying() billy.Basic