vfs

package
v0.0.0-...-df06595 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultFS

type DefaultFS struct {
}

func NewFS

func NewFS() *DefaultFS

func (*DefaultFS) ChDir

func (fs *DefaultFS) ChDir(dir string) error

func (*DefaultFS) Mkdir

func (fs *DefaultFS) Mkdir(name string) error

func (*DefaultFS) Open

func (fs *DefaultFS) Open(name string) (File, error)

func (*DefaultFS) ReadDir

func (fs *DefaultFS) ReadDir(name string) ([]os.DirEntry, error)

func (*DefaultFS) ReadFile

func (fs *DefaultFS) ReadFile(name string) ([]byte, error)

func (*DefaultFS) Remove

func (fs *DefaultFS) Remove(name string) error

func (*DefaultFS) Stat

func (fs *DefaultFS) Stat(name string) (os.FileInfo, error)

func (*DefaultFS) WriteFile

func (fs *DefaultFS) WriteFile(name string, data []byte) error

type FS

type FS interface {
	ChDir(dir string) error
	Mkdir(name string) error
	// Remove removes the named file or directory and any children
	// it contains. It removes evertyhing it can but returns the
	// first error it encounters. If the path does not exist, Remove
	// returns nil (no error).
	Remove(name string) error
	// Open opens the named file for reading and writing, If the
	// file does not exist, it creates an empty file.
	Open(name string) (File, error)
	Stat(name string) (os.FileInfo, error)
	ReadDir(name string) ([]os.DirEntry, error)

	ReadFile(name string) ([]byte, error)
	WriteFile(name string, data []byte) error
}

func NewMemFS

func NewMemFS() FS

type File

type File interface {
	Fd() uintptr
	Sync() error
	Close() error
	Stat() (os.FileInfo, error)
	Read(p []byte) (n int, err error)
	ReadAt(p []byte, off int64) (n int, err error)
	Write(p []byte) (n int, err error)
	WriteAt(p []byte, off int64) (n int, err error)
}

Jump to

Keyboard shortcuts

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