vfs

package
v0.0.0-...-00062ea Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: 0BSD Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotImplementedError error = fmt.Errorf("requested functionality is not implemented")

Functions

This section is empty.

Types

type CreateFS

type CreateFS interface {
	stdlib_fs.FS
	Create(name string) (File, error)
}

CreateFS is the interface that wraps the Create method. It should behave similarly to the os.Create function.

type File

type File interface {
	stdlib_fs.File
	io.Writer
	io.Seeker
}

A File interface. It is acceptable for any implementation which doesn't implement a given method to simply return NotImplementedError for that method.

type OSFS

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

An implemententation of `ReadWriteFS` to interact with a real filesystem on the present operating system.

func NewOSFS

func NewOSFS(root string) (*OSFS, error)

func (*OSFS) Open

func (osfs *OSFS) Open(name string) (stdlib_fs.File, error)

func (*OSFS) OpenFile

func (osfs *OSFS) OpenFile(name string, flag int, perm os.FileMode) (File, error)

func (*OSFS) ReadDir

func (osfs *OSFS) ReadDir(name string) ([]stdlib_fs.DirEntry, error)

func (*OSFS) Rel

func (osfs *OSFS) Rel(name string) (string, error)

func (*OSFS) Remove

func (osfs *OSFS) Remove(name string) error

func (*OSFS) Rename

func (osfs *OSFS) Rename(oldpath, newpath string) error

func (*OSFS) Stat

func (osfs *OSFS) Stat(name string) (stdlib_fs.FileInfo, error)

type OpenFileFS

type OpenFileFS interface {
	stdlib_fs.FS
	OpenFile(name string, flag int, perm os.FileMode) (File, error)
}

OpenFileFS is the interface that wraps the OpenFile method. It need not be able to implement all flags that os.OpenFile supports.

type RemoveFS

type RemoveFS interface {
	stdlib_fs.FS
	Remove(name string) error
}

RemoveFS is the interface that wraps the Remove method. If a file system cannot remove (i.e. unlink) files under any circumstances, then it should not implment this interface.

type RenameFS

type RenameFS interface {
	stdlib_fs.FS
	Rename(oldpath, newpath string) error
}

RenameFS is the interface that wraps the Rename method. If a file system cannot rename (i.e. move) files under any circumstances, then it should not implment this interface.

Jump to

Keyboard shortcuts

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