filesystem

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

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