filesys_interface

package
v1.3.5-alpha0828 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSystem

type FileSystem interface {
	ReadFile(name string) ([]byte, error)

	Open(name string) (fs.File, error)
	OpenFile(name string, flag int, perm os.FileMode) (fs.File, error)

	// Stat returns a FileInfo describing the file.
	// If there is an error, it should be of type *PathError.
	Stat(name string) (fs.FileInfo, error)
	// RelStat(name string) (fs.FileInfo, error)
	// ReadDir reads the named directory
	// and returns a list of directory entries sorted by filename.
	ReadDir(name string) ([]fs.DirEntry, error)

	Join(elem ...string) string

	GetSeparators() rune

	PathSplit(string) (string, string)
	Ext(string) string
	IsAbs(string) bool
	Getwd() (string, error)
	Exists(string) (bool, error)
	Rename(string, string) error
	Rel(string, string) (string, error)
	WriteFile(string, []byte, os.FileMode) error
	Delete(string) error
	MkdirAll(string, os.FileMode) error
	ExtraInfo(string) map[string]any
}

FileSystem defines the methods of an abstract filesystem.

type SyncFile

type SyncFile interface {
	Sync() error
}

type TrashFS

type TrashFS interface {
	Throw(filenames ...string) error
}

Jump to

Keyboard shortcuts

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