overlayfs

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir

type Dir struct {
	// contains filtered or unexported fields
}

Dir is an afero.File that represents list of directories that will be merged in Readdir and Readdirnames.

func (*Dir) Close

func (d *Dir) Close() error

Close implements afero.File.Close. Note that d must not be used after it is closed, as the object may be reused.

func (*Dir) Name

func (d *Dir) Name() string

Name implements afero.File.name.

func (*Dir) Read

func (d *Dir) Read(p []byte) (n int, err error)

Read is not supported.

func (*Dir) ReadAt

func (d *Dir) ReadAt(p []byte, off int64) (n int, err error)

ReadAt is not supported.

func (*Dir) Readdir

func (d *Dir) Readdir(n int) ([]os.FileInfo, error)

Readdir implements afero.File.Readdir. If n > 0, Readdir returns at most n.

func (*Dir) Readdirnames

func (d *Dir) Readdirnames(n int) ([]string, error)

Readdirnames implements afero.File.Readdirnames. If n > 0, Readdirnames returns at most n.

func (*Dir) Seek

func (d *Dir) Seek(offset int64, whence int) (int64, error)

Seek is not supported.

func (*Dir) Stat

func (d *Dir) Stat() (os.FileInfo, error)

Stat implements afero.File.Stat.

func (*Dir) Sync

func (d *Dir) Sync() error

Sync is not supported.

func (*Dir) Truncate

func (d *Dir) Truncate(size int64) error

Truncate is not supported.

func (*Dir) Write

func (d *Dir) Write(p []byte) (n int, err error)

Write is not supported.

func (*Dir) WriteAt

func (d *Dir) WriteAt(p []byte, off int64) (n int, err error)

WriteAt is not supported.

func (*Dir) WriteString

func (d *Dir) WriteString(s string) (ret int, err error)

WriteString is not supported.

type DirsMerger

type DirsMerger func(lofi, bofi []os.FileInfo) []os.FileInfo

DirsMerger is used to merge two directories.

type File

type File struct {
	fs.File
}

func (File) Name

func (f File) Name() string

func (File) ReadAt

func (f File) ReadAt(p []byte, off int64) (n int, err error)

func (File) Readdir

func (f File) Readdir(count int) ([]os.FileInfo, error)

func (File) Readdirnames

func (f File) Readdirnames(n int) ([]string, error)

func (File) Seek

func (f File) Seek(offset int64, whence int) (int64, error)

func (File) Sync

func (f File) Sync() error

func (File) Truncate

func (f File) Truncate(size int64) error

func (File) Write

func (f File) Write(p []byte) (n int, err error)

func (File) WriteAt

func (f File) WriteAt(p []byte, off int64) (n int, err error)

func (File) WriteString

func (f File) WriteString(s string) (ret int, err error)

type OverlayFs

type OverlayFs struct {
	// contains filtered or unexported fields
}

OverlayFs is a filesystem that overlays multiple filesystems. It's by default a read-only filesystem. For all operations, the filesystems are checked in order until found.

func New

func New(fss []afero.Fs) *OverlayFs

New creates a new OverlayFs with the given options.

func (*OverlayFs) Append

func (ofs *OverlayFs) Append(fss ...afero.Fs) *OverlayFs

func (*OverlayFs) Chmod

func (ofs *OverlayFs) Chmod(name string, mode os.FileMode) error

func (*OverlayFs) Chown

func (ofs *OverlayFs) Chown(name string, uid, gid int) error

func (*OverlayFs) Chtimes

func (ofs *OverlayFs) Chtimes(name string, atime time.Time, mtime time.Time) error

func (*OverlayFs) Create

func (ofs *OverlayFs) Create(name string) (afero.File, error)

func (*OverlayFs) LstatIfPossible

func (ofs *OverlayFs) LstatIfPossible(name string) (os.FileInfo, bool, error)

func (*OverlayFs) Mkdir

func (ofs *OverlayFs) Mkdir(name string, perm os.FileMode) error

func (*OverlayFs) MkdirAll

func (ofs *OverlayFs) MkdirAll(path string, perm os.FileMode) error

func (*OverlayFs) Name

func (ofs *OverlayFs) Name() string

func (*OverlayFs) Open

func (ofs *OverlayFs) Open(name string) (afero.File, error)

Open opens a file, returning it or an error, if any happens. If name is a directory, a *Dir is returned representing all directories matching name. Note that a *Dir must not be used after it's closed.

func (*OverlayFs) OpenFile

func (ofs *OverlayFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)

func (*OverlayFs) Remove

func (ofs *OverlayFs) Remove(name string) error

func (*OverlayFs) RemoveAll

func (ofs *OverlayFs) RemoveAll(path string) error

func (*OverlayFs) Rename

func (ofs *OverlayFs) Rename(oldname, newname string) error

func (*OverlayFs) Stat

func (ofs *OverlayFs) Stat(name string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL