Documentation ¶
Index ¶
- type CopyEvent
- type CopyOverEvent
- type CreateFileEvent
- type DeleteDirEvent
- type DeleteFileEvent
- type Digest
- type Error
- type Event
- type File
- type FileEvent
- type Listener
- type Path
- func (p *Path) Append() (File, error)
- func (p *Path) AppendMode(mode os.FileMode) (file File, err error)
- func (p *Path) Base() string
- func (p *Path) BytesAreEqual(other *Path) (isEqual bool, err error)
- func (p *Path) BytesAreEqualToBytes(other []byte) (isEqual bool, err error)
- func (p *Path) BytesIfExistsAreEqual(other *Path) (isEqual bool, err error)
- func (p *Path) BytesIfExistsAreEqualToBytes(other []byte) (isEqual bool, err error)
- func (p *Path) Children() (paths Paths, err error)
- func (p *Path) ChildrenIfIsDir() (Paths, error)
- func (p *Path) Chmod(mode os.FileMode) error
- func (p *Path) CopyTo(target *Path) error
- func (p *Path) Create() (File, error)
- func (p *Path) CreateMode(mode os.FileMode) (file File, err error)
- func (p *Path) Delete() (err error)
- func (p *Path) DeleteIfExists() error
- func (p *Path) Digest(hash hash.Hash) (d Digest, err error)
- func (p *Path) DigestIfExists(hash hash.Hash) (d Digest, err error)
- func (p *Path) Exists() bool
- func (p *Path) Extension() string
- func (p *Path) Glob(pattern string) (paths Paths, err error)
- func (p *Path) IsDir() bool
- func (p *Path) IsEmpty() (isEmpty bool, err error)
- func (p *Path) IsNonDir() bool
- func (p *Path) Join(a ...string) *Path
- func (p *Path) KeepChildren(childNames ...string) (err error)
- func (p *Path) Make() error
- func (p *Path) MakeMode(mode os.FileMode) error
- func (p *Path) MustAppend() File
- func (p *Path) MustAppendMode(mode os.FileMode) File
- func (p *Path) MustBytesAreEqual(other *Path) bool
- func (p *Path) MustBytesAreEqualToBytes(other []byte) bool
- func (p *Path) MustBytesIfExistsAreEqual(other *Path) bool
- func (p *Path) MustBytesIfExistsAreEqualToBytes(other []byte) bool
- func (p *Path) MustChildren() Paths
- func (p *Path) MustChildrenIfIsDir() Paths
- func (p *Path) MustChmod(mode os.FileMode)
- func (p *Path) MustCreate() File
- func (p *Path) MustCreateMode(mode os.FileMode) File
- func (p *Path) MustDelete()
- func (p *Path) MustDeleteIfExists()
- func (p *Path) MustDigest(hash hash.Hash) Digest
- func (p *Path) MustDigestIfExists(hash hash.Hash) Digest
- func (p *Path) MustGlob(pattern string) Paths
- func (p *Path) MustIsEmpty() bool
- func (p *Path) MustKeepChildren(childNames ...string)
- func (p *Path) MustMake() *Path
- func (p *Path) MustMakeMode(mode os.FileMode) *Path
- func (p *Path) MustOpen() File
- func (p *Path) MustReadBytes() []byte
- func (p *Path) MustReadBytesIfExists() []byte
- func (p *Path) MustReadLink() *Path
- func (p *Path) MustReadString() string
- func (p *Path) MustReadStringIfExists() string
- func (p *Path) MustReadTo(writer io.Writer)
- func (p *Path) MustReadToIfExists(writer io.Writer)
- func (p *Path) MustRemoveEmptyDirs() (removed Paths)
- func (p *Path) MustRemoveEmptyDirsAndSelf() (removed Paths)
- func (p *Path) MustRemoveEmptyDirsRecursive() (removed Paths)
- func (p *Path) MustRemoveEmptyDirsRecursiveAndSelf() (removed Paths)
- func (p *Path) MustRename(target *Path)
- func (p *Path) MustSha1Digest() Digest
- func (p *Path) MustSha1DigestIfExists() Digest
- func (p *Path) MustSha224Digest() Digest
- func (p *Path) MustSha224DigestIfExists() Digest
- func (p *Path) MustSha256Digest() Digest
- func (p *Path) MustSha256DigestIfExists() Digest
- func (p *Path) MustSha384Digest() Digest
- func (p *Path) MustSha384DigestIfExists() Digest
- func (p *Path) MustSha512Digest() Digest
- func (p *Path) MustSha512DigestIfExists() Digest
- func (p *Path) MustSize() int64
- func (p *Path) MustSizeIfExists() int64
- func (p *Path) MustStat() os.FileInfo
- func (p *Path) MustSymlinkTo(target *Path)
- func (p *Path) MustTouch() *Path
- func (p *Path) MustWd() *Path
- func (p *Path) MustWriteBytes(b []byte)
- func (p *Path) MustWriteBytesUnlessEqual(b []byte)
- func (p *Path) MustWriteFrom(reader io.Reader)
- func (p *Path) MustWriteString(s string)
- func (p *Path) MustWriteStringUnlessEqual(s string)
- func (p *Path) Open() (File, error)
- func (p *Path) Parent() *Path
- func (p *Path) ReadBytes() (b []byte, err error)
- func (p *Path) ReadBytesIfExists() (b []byte, err error)
- func (p *Path) ReadLink() (*Path, error)
- func (p *Path) ReadString() (string, error)
- func (p *Path) ReadStringIfExists() (str string, err error)
- func (p *Path) ReadTo(writer io.Writer) (err error)
- func (p *Path) ReadToIfExists(writer io.Writer) error
- func (p *Path) RemoveEmptyDirs() (removed Paths, err error)
- func (p *Path) RemoveEmptyDirsAndSelf() (removed Paths, err error)
- func (p *Path) RemoveEmptyDirsRecursive() (removed Paths, err error)
- func (p *Path) RemoveEmptyDirsRecursiveAndSelf() (removed Paths, err error)
- func (p *Path) Rename(target *Path) (err error)
- func (p *Path) Sha1Digest() (Digest, error)
- func (p *Path) Sha1DigestIfExists() (Digest, error)
- func (p *Path) Sha224Digest() (Digest, error)
- func (p *Path) Sha224DigestIfExists() (Digest, error)
- func (p *Path) Sha256Digest() (Digest, error)
- func (p *Path) Sha256DigestIfExists() (Digest, error)
- func (p *Path) Sha384Digest() (Digest, error)
- func (p *Path) Sha384DigestIfExists() (Digest, error)
- func (p *Path) Sha512Digest() (Digest, error)
- func (p *Path) Sha512DigestIfExists() (Digest, error)
- func (p *Path) Size() (int64, error)
- func (p *Path) SizeIfExists() (int64, error)
- func (p *Path) Stat() (os.FileInfo, error)
- func (p *Path) String() string
- func (p *Path) SymlinkTo(target *Path) error
- func (p *Path) Touch() error
- func (p *Path) UserHome() (*Path, error)
- func (p *Path) Wd() (*Path, error)
- func (p *Path) WriteBytes(b []byte) error
- func (p *Path) WriteBytesUnlessEqual(b []byte) error
- func (p *Path) WriteCloser() io.WriteCloser
- func (p *Path) WriteFrom(reader io.Reader) (err error)
- func (p *Path) WriteString(s string) error
- func (p *Path) WriteStringUnlessEqual(s string) error
- type Paths
- type RenameEvent
- type RewriteFileEvent
- type SymlinkEvent
- type System
- type TargetEvent
- type Tree
- type VirtualSystem
- func (v *VirtualSystem) Chmod(name string, mode os.FileMode) error
- func (v *VirtualSystem) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (v *VirtualSystem) CurrentUser() (*user.User, error)
- func (v *VirtualSystem) Getwd() (dir string, err error)
- func (v *VirtualSystem) Glob(pattern string) (matches []string, err error)
- func (v *VirtualSystem) Join(elem ...string) string
- func (v *VirtualSystem) Lstat(name string) (os.FileInfo, error)
- func (v *VirtualSystem) MkdirAll(path string, perm os.FileMode) error
- func (v *VirtualSystem) OpenFile(name string, flag int, perm os.FileMode) (File, error)
- func (v *VirtualSystem) ReadDir(name string) (entries []os.DirEntry, err error)
- func (v *VirtualSystem) ReadFile(name string) (b []byte, err error)
- func (v *VirtualSystem) Readlink(name string) (string, error)
- func (v *VirtualSystem) Remove(name string) error
- func (v *VirtualSystem) RemoveAll(path string) error
- func (v *VirtualSystem) Rename(oldpath, newpath string) error
- func (v *VirtualSystem) Root() string
- func (v *VirtualSystem) SupportsSymlinks() bool
- func (v *VirtualSystem) Symlink(oldname, newname string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CopyEvent ¶
type CopyEvent struct{ TargetEvent }
type CopyOverEvent ¶
type CopyOverEvent struct{ TargetEvent }
type CreateFileEvent ¶
type CreateFileEvent struct{ FileEvent }
type DeleteDirEvent ¶
type DeleteDirEvent struct{ Event }
type DeleteFileEvent ¶
type DeleteFileEvent struct{ FileEvent }
type Error ¶
type Error string
const ( ErrDirectory Error = "file is a directory" ErrNonDirectory Error = "not a directory" ErrNonLink Error = "not a link" ErrPathNotFound Error = "path not found" ErrFileExists Error = "path already exists" ErrBrokenLink Error = "broken link" ErrNotWritable Error = "not writable" ErrInvalid Error = "invalid" )
type File ¶
type File interface { io.ReadCloser io.WriteSeeker }
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
func (*Path) BytesAreEqualToBytes ¶
func (*Path) BytesIfExistsAreEqual ¶
func (*Path) BytesIfExistsAreEqualToBytes ¶
func (*Path) ChildrenIfIsDir ¶
func (*Path) DeleteIfExists ¶
func (*Path) KeepChildren ¶
func (*Path) MustAppend ¶
func (*Path) MustBytesAreEqual ¶
func (*Path) MustBytesAreEqualToBytes ¶
func (*Path) MustBytesIfExistsAreEqual ¶
func (*Path) MustBytesIfExistsAreEqualToBytes ¶
func (*Path) MustChildren ¶
func (*Path) MustChildrenIfIsDir ¶
func (*Path) MustCreate ¶
func (*Path) MustDelete ¶
func (p *Path) MustDelete()
func (*Path) MustDeleteIfExists ¶
func (p *Path) MustDeleteIfExists()
func (*Path) MustIsEmpty ¶
func (*Path) MustKeepChildren ¶
func (*Path) MustReadBytes ¶
func (*Path) MustReadBytesIfExists ¶
func (*Path) MustReadLink ¶
func (*Path) MustReadString ¶
func (*Path) MustReadStringIfExists ¶
func (*Path) MustReadTo ¶
func (*Path) MustReadToIfExists ¶
func (*Path) MustRemoveEmptyDirs ¶
func (*Path) MustRemoveEmptyDirsAndSelf ¶
func (*Path) MustRemoveEmptyDirsRecursive ¶
func (*Path) MustRemoveEmptyDirsRecursiveAndSelf ¶
func (*Path) MustRename ¶
func (*Path) MustSha1Digest ¶
func (*Path) MustSha1DigestIfExists ¶
func (*Path) MustSha224Digest ¶
func (*Path) MustSha224DigestIfExists ¶
func (*Path) MustSha256Digest ¶
func (*Path) MustSha256DigestIfExists ¶
func (*Path) MustSha384Digest ¶
func (*Path) MustSha384DigestIfExists ¶
func (*Path) MustSha512Digest ¶
func (*Path) MustSha512DigestIfExists ¶
func (*Path) MustSizeIfExists ¶
func (*Path) MustSymlinkTo ¶
func (*Path) MustWriteBytes ¶
func (*Path) MustWriteBytesUnlessEqual ¶
func (*Path) MustWriteFrom ¶
func (*Path) MustWriteString ¶
func (*Path) MustWriteStringUnlessEqual ¶
func (*Path) ReadBytesIfExists ¶
func (*Path) ReadString ¶
func (*Path) ReadStringIfExists ¶
func (*Path) RemoveEmptyDirs ¶
func (*Path) RemoveEmptyDirsAndSelf ¶
func (*Path) RemoveEmptyDirsRecursive ¶
func (*Path) RemoveEmptyDirsRecursiveAndSelf ¶
func (*Path) Sha1Digest ¶
func (*Path) Sha1DigestIfExists ¶
func (*Path) Sha224Digest ¶
func (*Path) Sha224DigestIfExists ¶
func (*Path) Sha256Digest ¶
func (*Path) Sha256DigestIfExists ¶
func (*Path) Sha384Digest ¶
func (*Path) Sha384DigestIfExists ¶
func (*Path) Sha512Digest ¶
func (*Path) Sha512DigestIfExists ¶
func (*Path) SizeIfExists ¶
func (*Path) WriteBytes ¶
func (*Path) WriteBytesUnlessEqual ¶
func (*Path) WriteCloser ¶
func (p *Path) WriteCloser() io.WriteCloser
func (*Path) WriteString ¶
func (*Path) WriteStringUnlessEqual ¶
type RenameEvent ¶
type RenameEvent struct{ TargetEvent }
type RewriteFileEvent ¶
type RewriteFileEvent struct{ FileEvent }
type SymlinkEvent ¶
type SymlinkEvent struct{ TargetEvent }
type System ¶
type System interface { Chmod(name string, mode os.FileMode) error Chtimes(name string, atime time.Time, mtime time.Time) error CurrentUser() (*user.User, error) Getwd() (dir string, err error) Glob(pattern string) (matches []string, err error) Join(elem ...string) string Lstat(name string) (os.FileInfo, error) MkdirAll(path string, perm os.FileMode) error OpenFile(name string, flag int, perm os.FileMode) (File, error) ReadDir(name string) ([]os.DirEntry, error) ReadFile(name string) ([]byte, error) Readlink(name string) (string, error) Remove(name string) error RemoveAll(path string) error Rename(oldpath, newpath string) error Root() string SupportsSymlinks() bool Symlink(oldname, newname string) error }
var LocalSystem System = local{}
type TargetEvent ¶
type Tree ¶
type Tree struct { *Path // contains filtered or unexported fields }
func NewTreeWithSystem ¶
type VirtualSystem ¶
type VirtualSystem struct {
// contains filtered or unexported fields
}
func NewVirtualSystem ¶
func NewVirtualSystem() *VirtualSystem
func (*VirtualSystem) CurrentUser ¶
func (v *VirtualSystem) CurrentUser() (*user.User, error)
func (*VirtualSystem) Getwd ¶
func (v *VirtualSystem) Getwd() (dir string, err error)
func (*VirtualSystem) Glob ¶
func (v *VirtualSystem) Glob(pattern string) (matches []string, err error)
func (*VirtualSystem) Join ¶
func (v *VirtualSystem) Join(elem ...string) string
func (*VirtualSystem) MkdirAll ¶
func (v *VirtualSystem) MkdirAll(path string, perm os.FileMode) error
func (*VirtualSystem) ReadDir ¶
func (v *VirtualSystem) ReadDir(name string) (entries []os.DirEntry, err error)
func (*VirtualSystem) ReadFile ¶
func (v *VirtualSystem) ReadFile(name string) (b []byte, err error)
func (*VirtualSystem) Remove ¶
func (v *VirtualSystem) Remove(name string) error
func (*VirtualSystem) RemoveAll ¶
func (v *VirtualSystem) RemoveAll(path string) error
func (*VirtualSystem) Rename ¶
func (v *VirtualSystem) Rename(oldpath, newpath string) error
func (*VirtualSystem) Root ¶
func (v *VirtualSystem) Root() string
func (*VirtualSystem) SupportsSymlinks ¶
func (v *VirtualSystem) SupportsSymlinks() bool
func (*VirtualSystem) Symlink ¶
func (v *VirtualSystem) Symlink(oldname, newname string) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.