Documentation ¶
Index ¶
- func NewCopyOnWriteFs(base afero.Fs, layer afero.Fs) afero.Fs
- type CopyOnWriteFs
- func (u *CopyOnWriteFs) Chmod(name string, mode os.FileMode) error
- func (u *CopyOnWriteFs) Chown(name string, uid, gid int) error
- func (u *CopyOnWriteFs) Chtimes(name string, atime, mtime time.Time) error
- func (u *CopyOnWriteFs) Create(name string) (afero.File, error)
- func (u *CopyOnWriteFs) LstatIfPossible(name string) (os.FileInfo, bool, error)
- func (u *CopyOnWriteFs) Mkdir(name string, perm os.FileMode) error
- func (u *CopyOnWriteFs) MkdirAll(name string, perm os.FileMode) error
- func (u *CopyOnWriteFs) Name() string
- func (u *CopyOnWriteFs) Open(name string) (afero.File, error)
- func (u *CopyOnWriteFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)
- func (u *CopyOnWriteFs) ReadlinkIfPossible(name string) (string, error)
- func (u *CopyOnWriteFs) Remove(name string) error
- func (u *CopyOnWriteFs) RemoveAll(name string) error
- func (u *CopyOnWriteFs) Rename(oldname, newname string) error
- func (u *CopyOnWriteFs) Stat(name string) (os.FileInfo, error)
- func (u *CopyOnWriteFs) SymlinkIfPossible(oldname, newname string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CopyOnWriteFs ¶
type CopyOnWriteFs struct {
// contains filtered or unexported fields
}
The CopyOnWriteFs is a union filesystem: a read only base file system with a possibly writeable layer on top. Changes to the file system will only be made in the overlay: Changing an existing file in the base layer which is not present in the overlay will copy the file to the overlay ("changing" includes also calls to e.g. Chtimes(), Chmod() and Chown()).
Reading directories is currently only supported via Open(), not OpenFile().
func (*CopyOnWriteFs) Chtimes ¶
func (u *CopyOnWriteFs) Chtimes(name string, atime, mtime time.Time) error
func (*CopyOnWriteFs) LstatIfPossible ¶
func (*CopyOnWriteFs) MkdirAll ¶
func (u *CopyOnWriteFs) MkdirAll(name string, perm os.FileMode) error
func (*CopyOnWriteFs) Name ¶
func (u *CopyOnWriteFs) Name() string
func (*CopyOnWriteFs) Open ¶
func (u *CopyOnWriteFs) Open(name string) (afero.File, error)
This function handles the 9 different possibilities caused by the union which are the intersection of the following...
layer: doesn't exist, exists as a file, and exists as a directory base: doesn't exist, exists as a file, and exists as a directory
func (*CopyOnWriteFs) ReadlinkIfPossible ¶
func (u *CopyOnWriteFs) ReadlinkIfPossible(name string) (string, error)
func (*CopyOnWriteFs) Remove ¶
func (u *CopyOnWriteFs) Remove(name string) error
Removing files present only in the base layer is not permitted. If a file is present in the base layer and the overlay, only the overlay will be removed.
func (*CopyOnWriteFs) RemoveAll ¶
func (u *CopyOnWriteFs) RemoveAll(name string) error
func (*CopyOnWriteFs) Rename ¶
func (u *CopyOnWriteFs) Rename(oldname, newname string) error
Renaming files present only in the base layer is not permitted
func (*CopyOnWriteFs) SymlinkIfPossible ¶
func (u *CopyOnWriteFs) SymlinkIfPossible(oldname, newname string) error