fs

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 8 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 {
	CreateDir(dirPath string, permission os.FileMode, forceCreate bool) error
	DeleteDir(dirPath string) error
	CopyDir(srcPath, destPath string) error

	CreateFile(filePath string, forceCreate bool) error
	WriteFile(filePath string, permission os.FileMode, contents []byte) error
	ReadFile(filePath string) ([]byte, error)
	DeleteFile(filePath string) error
	CopyFile(sourcePath, destPath string) error

	SearchFiles(sourceDir string, excludeDirs []string, searchFile string) ([]string, error)
	SearchFileExtensions(sourceDir string, excludeDirs []string, extension string) ([]string, error)

	CreateSymLink(sourcePath string, destPath string) error

	Pwd() (string, error)
	Exists(filePath string) (bool, error)
	Cd(dir string) error
}

FileSystem interface

type LocalFileSystem

type LocalFileSystem struct {
}

LocalFileSystem ...

func (*LocalFileSystem) Cd

func (l *LocalFileSystem) Cd(dir string) error

Cd ...

func (*LocalFileSystem) CopyDir

func (l *LocalFileSystem) CopyDir(src, dest string) error

CopyDir ...

func (*LocalFileSystem) CopyFile

func (l *LocalFileSystem) CopyFile(sourcePath, destPath string) error

CopyFile ...

func (*LocalFileSystem) CreateDir

func (l *LocalFileSystem) CreateDir(dirPath string, permission os.FileMode, forceCreate bool) error

CreateDir ...

func (*LocalFileSystem) CreateFile

func (l *LocalFileSystem) CreateFile(filePath string, forceCreate bool) error

CreateFile ...

func (l *LocalFileSystem) CreateSymLink(sourcePath, destPath string) error

CreateSymLink ...

func (*LocalFileSystem) DeleteDir

func (l *LocalFileSystem) DeleteDir(dirPath string) error

DeleteDir ...

func (*LocalFileSystem) DeleteFile

func (l *LocalFileSystem) DeleteFile(filePath string) error

DeleteFile ...

func (*LocalFileSystem) Exists

func (l *LocalFileSystem) Exists(file string) (bool, error)

Exists ...

func (*LocalFileSystem) Pwd

func (l *LocalFileSystem) Pwd() (string, error)

Pwd ...

func (*LocalFileSystem) ReadFile

func (l *LocalFileSystem) ReadFile(filePath string) ([]byte, error)

ReadFile ...

func (*LocalFileSystem) SearchFileExtensions

func (l *LocalFileSystem) SearchFileExtensions(sourceDir string, excludeDirs []string, extension string) ([]string, error)

SearchFileExtensions ...

func (*LocalFileSystem) SearchFiles

func (l *LocalFileSystem) SearchFiles(sourceDir string, excludeDirs []string, searchFile string) ([]string, error)

SearchFiles ...

func (*LocalFileSystem) WriteFile

func (l *LocalFileSystem) WriteFile(filePath string, permission os.FileMode, contents []byte) error

WriteFile ...

Jump to

Keyboard shortcuts

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