localfs

package
v6.7.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocalFS

func NewLocalFS() filesystem.FileSystem

Types

type LocalFS

type LocalFS struct {
}

LocalFS is wrapper around the OS file system used to read and write files. This implements fs.FS, fs.ReadFileFS, OpenFileFS, WriteFileFS.

func (*LocalFS) Chdir added in v6.2.1

func (lfs *LocalFS) Chdir(dir string) error

func (*LocalFS) Create added in v6.2.1

func (lfs *LocalFS) Create(name string) (filesystem.WritableFile, error)

func (*LocalFS) FileExists

func (lfs *LocalFS) FileExists(file string) bool

func (*LocalFS) Mkdir

func (lfs *LocalFS) Mkdir(name string, perm fs.FileMode) error

func (*LocalFS) MkdirAll added in v6.2.1

func (lfs *LocalFS) MkdirAll(path string, perm fs.FileMode) error

func (*LocalFS) Open

func (lfs *LocalFS) Open(name string) (fs.File, error)

func (*LocalFS) OpenFile

func (lfs *LocalFS) OpenFile(name string, flag int, perm os.FileMode) (filesystem.WritableFile, error)

func (*LocalFS) ReadDir

func (lfs *LocalFS) ReadDir(dir string) ([]fs.DirEntry, error)

func (*LocalFS) ReadFile

func (lfs *LocalFS) ReadFile(name string) ([]byte, error)

func (*LocalFS) Stat

func (lfs *LocalFS) Stat(name string) (fs.FileInfo, error)

func (*LocalFS) WriteFile

func (lfs *LocalFS) WriteFile(name string, data []byte, perm fs.FileMode) error

type LocalFile

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

LocalFile wraps an os.File struct. This implements WriableFile

func (LocalFile) Close

func (lf LocalFile) Close() error

func (LocalFile) Name

func (lf LocalFile) Name() string

func (LocalFile) Read

func (lf LocalFile) Read(b []byte) (int, error)

func (LocalFile) Stat

func (lf LocalFile) Stat() (fs.FileInfo, error)

func (LocalFile) Write

func (lf LocalFile) Write(b []byte) (int, error)

func (LocalFile) WriteString

func (lf LocalFile) WriteString(s string) (int, error)

Jump to

Keyboard shortcuts

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