mountfs

package
v1.4.1-rc3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MountDir

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

MountDir represents the root of a mountfs filesystem. As such, it is always a directory with name ".".

It implements fs.FS, fs.File, fs.ReadDirFile and fs.FileInfo.

func New

func New() *MountDir

New returns an empty filesystem with no mounts.

func (*MountDir) Close

func (m *MountDir) Close() error

func (*MountDir) IsDir

func (m *MountDir) IsDir() bool

abbreviation for Mode().IsDir()

func (*MountDir) ModTime

func (m *MountDir) ModTime() time.Time

modification time

func (*MountDir) Mode

func (*MountDir) Mode() fs.FileMode

file mode bits

func (*MountDir) Mount

func (m *MountDir) Mount(path string, filesystem fs.FS) error

Mount makes the files available in filesystem available under the "/prefix"

func (*MountDir) Name

func (*MountDir) Name() string

type FileInfo base name of the file

func (*MountDir) Open

func (m *MountDir) Open(name string) (fs.File, error)

func (*MountDir) Read

func (m *MountDir) Read([]byte) (int, error)

func (*MountDir) ReadDir

func (m *MountDir) ReadDir(n int) ([]fs.DirEntry, error)

type ReadDirFile

func (*MountDir) Size

func (*MountDir) Size() int64

length in bytes for regular files; system-dependent for others

func (*MountDir) Stat

func (m *MountDir) Stat() (fs.FileInfo, error)

type File

func (*MountDir) Sys

func (m *MountDir) Sys() any

underlying data source (can return nil)

func (*MountDir) Unmount

func (m *MountDir) Unmount(prefix string) error

Unmount makes a previously existing "/prefix" no longer serve files

Jump to

Keyboard shortcuts

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