Documentation ¶
Index ¶
- Constants
- Variables
- type Billy
- func (b *Billy) Capabilities() billy.Capability
- func (b *Billy) Chmod(name string, mode os.FileMode) error
- func (b *Billy) Chown(name string, uid, gid int) error
- func (b *Billy) Chroot(path string) (billy.Filesystem, error)
- func (b *Billy) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (b *Billy) Create(filename string) (billy.File, error)
- func (b *Billy) Join(elem ...string) string
- func (b *Billy) Lchown(name string, uid, gid int) error
- func (b *Billy) Lstat(filename string) (os.FileInfo, error)
- func (b *Billy) MkdirAll(filename string, perm os.FileMode) error
- func (b *Billy) Open(filename string) (billy.File, error)
- func (b *Billy) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error)
- func (b *Billy) ReadDir(path string) ([]os.FileInfo, error)
- func (b *Billy) Readlink(link string) (string, error)
- func (b *Billy) Remove(filename string) error
- func (b *Billy) Rename(oldpath, newpath string) error
- func (b *Billy) Root() string
- func (b *Billy) Stat(filename string) (os.FileInfo, error)
- func (b *Billy) Symlink(target, link string) error
- func (b *Billy) TempFile(dir, prefix string) (billy.File, error)
- type BillyFile
- func (bf *BillyFile) Close() error
- func (bf *BillyFile) Lock() error
- func (bf *BillyFile) Read(buf []byte) (n int, err error)
- func (bf *BillyFile) ReadAt(buf []byte, offset int64) (n int, err error)
- func (bf *BillyFile) Seek(offset int64, whence int) (int64, error)
- func (bf *BillyFile) Truncate(size int64) error
- func (bf *BillyFile) Unlock() error
- func (bf *BillyFile) Write(buf []byte) (n int, err error)
- func (bf *BillyFile) WriteAt(buf []byte, offset int64) (n int, err error)
- type DirMeta
- type File
- type FileContent
- type Placer
- func (p *Placer) BasePath() fs.AbsolutePath
- func (p *Placer) Chmod(path fs.RelPath, perms fs.Perms) error
- func (p *Placer) LStat(path fs.RelPath) (*fs.Metadata, error)
- func (p *Placer) Lchown(path fs.RelPath, uid uint32, gid uint32) error
- func (p *Placer) MkdevBlock(path fs.RelPath, major int64, minor int64, perms fs.Perms) error
- func (p *Placer) MkdevChar(path fs.RelPath, major int64, minor int64, perms fs.Perms) error
- func (p *Placer) Mkdir(path fs.RelPath, perms fs.Perms) error
- func (p *Placer) Mkfifo(path fs.RelPath, perms fs.Perms) error
- func (p *Placer) Mklink(path fs.RelPath, target string) error
- func (p *Placer) OpenFile(path fs.RelPath, flag int, perms fs.Perms) (fs.File, error)
- func (p *Placer) ReadDirNames(path fs.RelPath) ([]string, error)
- func (p *Placer) Readlink(path fs.RelPath) (target string, isSymlink bool, err error)
- func (p *Placer) ResolveLink(symlink string, startingAt fs.RelPath) (fs.RelPath, error)
- func (p *Placer) SetTimesLNano(path fs.RelPath, mtime time.Time, atime time.Time) error
- func (p *Placer) SetTimesNano(path fs.RelPath, mtime time.Time, atime time.Time) error
- func (p *Placer) Stat(path fs.RelPath) (*fs.Metadata, error)
- type Tree
- func (t *Tree) AsBillyFS(euid, egid uint32) *Billy
- func (t *Tree) Create(name string, euid, egid uint32, perm os.FileMode) *File
- func (t *Tree) CreateDir(name string, euid, egid uint32, perm os.FileMode) *Tree
- func (t *Tree) Get(p []string, followSymlinks bool) (*File, *Tree, error)
- func (t *Tree) WalkDir(p []string) *Tree
- type TruncatableContents
Constants ¶
const Separator = "/"
Separator provides a stable path separator the memphis FS expects.
Variables ¶
var ErrExists = errors.New("EExists")
ErrExists indicates a file already exists at a location
var ErrNotDir = errors.New("ENotDir")
ErrNotDir indicates the proposed location is not a directory
Functions ¶
This section is empty.
Types ¶
type Billy ¶
type Billy struct {
// contains filtered or unexported fields
}
Billy wraps a filesystem subtree in the billy filesystem interface
func (*Billy) Capabilities ¶
func (b *Billy) Capabilities() billy.Capability
Capabilities tells billy what this FS can do
type BillyFile ¶
type BillyFile struct { *File // contains filtered or unexported fields }
BillyFile is a wrapper to file contents implementing the implicit position cursor for read/write
type DirMeta ¶
type DirMeta struct { *Tree // contains filtered or unexported fields }
DirMeta is a struct of metadata about a directory
type File ¶
type File struct {
// contains filtered or unexported fields
}
File holds the metadata of a FS object
func FileFromOS ¶
FileFromOS creates a file representing an underlying OS file. writes will transition the file contents to a memory buffer.
type FileContent ¶
FileContent represents the actual data of a file.
func MemBufferFrom ¶
func MemBufferFrom(fc FileContent) FileContent
MemBufferFrom copies a file contents into a memoryContents format where it can be truncated
func NewEmptyFileContents ¶
func NewEmptyFileContents() FileContent
NewEmptyFileContents creates a new memoryContents buffer
type Placer ¶
type Placer struct {
// contains filtered or unexported fields
}
Placer conforms a memphis directory tree to the rio FS interface
func (*Placer) BasePath ¶
func (p *Placer) BasePath() fs.AbsolutePath
BasePath is the root of this FS - always '/'
func (*Placer) MkdevBlock ¶
MkdevBlock makes a block device at path
func (*Placer) ReadDirNames ¶
ReadDirNames lists files in a directory
func (*Placer) ResolveLink ¶
ResolveLink resolves a symlink
func (*Placer) SetTimesLNano ¶
SetTimesLNano sets modification/access times of path
func (*Placer) SetTimesNano ¶
SetTimesNano sets modification/access times of path
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree represents a directory
func (*Tree) AsBillyFS ¶
AsBillyFS provides a billy-comptatible view of the current memphis directory tree
type TruncatableContents ¶
TruncatableContents is an optional FileContent interface for efficiency