filesystem

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInterface

type FileInterface interface {
	Read([]byte) (int, error)
	Write([]byte) (int, error)
	Close() error
}

type FileSystem

type FileSystem interface {
	IsNotExist(err error) bool
	MkdirAll(path string, perm os.FileMode) error
	Stat(name string) (fs.FileInfo, error)
	Remove(path string) error
	OpenFile(name string, flag int, perm os.FileMode) (FileInterface, error)
	Open(name string) (FileInterface, error)
	Glob(pattern string) ([]string, error)
	EvalSymlinks(path string) (string, error)
}

FileSystem defines the methods for file system operations.

func NewFileSystem

func NewFileSystem() FileSystem

type OSFileSystem

type OSFileSystem struct{}

OSFileSystem implements FileSystemInterface using the os package.

func (OSFileSystem) EvalSymlinks(path string) (string, error)

func (OSFileSystem) Glob

func (OSFileSystem) Glob(pattern string) ([]string, error)

func (OSFileSystem) IsNotExist

func (OSFileSystem) IsNotExist(err error) bool

func (OSFileSystem) MkdirAll

func (OSFileSystem) MkdirAll(path string, perm os.FileMode) error

func (OSFileSystem) Open

func (OSFileSystem) Open(name string) (FileInterface, error)

func (OSFileSystem) OpenFile

func (OSFileSystem) OpenFile(name string, flag int, perm os.FileMode) (FileInterface, error)

func (OSFileSystem) Remove

func (OSFileSystem) Remove(path string) error

func (OSFileSystem) Stat

func (OSFileSystem) Stat(name string) (fs.FileInfo, error)

Jump to

Keyboard shortcuts

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