fshelper

package
v0.0.0-...-a532a67 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: LGPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(srcfs, destfs filesystem.Filespace, filterFN filesystem.LoopFilter) (err error)

Copy clone files from sourcefs to destfs

func NewReadonlyFS

func NewReadonlyFS(fs filesystem.Filespace) filesystem.Filespace

NewReadonlyFS create readonly mask for filespace

func NewSubFS

func NewSubFS(fs filesystem.Filespace, basePath string) filesystem.Filespace

NewSubFS create new sub filesystem. Related to parent filesystem and path.

func StreamCopy

func StreamCopy(sourcefs, destfs filesystem.Filespace, subPath string) (err error)

StreamCopy copy file from source filesystem to destination filesystem with a stream loop

Types

type Copier

type Copier struct {
	SrcFS    filesystem.Filespace
	SrcPath  string
	DestFS   filesystem.Filespace
	DestPath string
}

Copier is helper to copy data bettwent two filesystem

func (Copier) Do

func (c Copier) Do() (err error)

Do clone files from sourcefs to destfs

type ROFilespace

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

ROFilespace is a readonly filespace

func (ROFilespace) Copy

func (ro ROFilespace) Copy(src, dest string) error

Copy method is unavailable

func (ROFilespace) CopyDirectory

func (ro ROFilespace) CopyDirectory(src, dest string) error

CopyDirectory is unavailable

func (ROFilespace) CopyFile

func (ro ROFilespace) CopyFile(src, dest string) error

CopyFile method is unavailable

func (ROFilespace) Filespace

func (ro ROFilespace) Filespace(src string) (filesystem.Filespace, error)

Filespace create new filespace

func (ROFilespace) IsDir

func (ro ROFilespace) IsDir(src string) bool

IsDir method run IsDir method of parent filespace

func (ROFilespace) IsExist

func (ro ROFilespace) IsExist(src string) bool

IsExist method run IsExist method of parent filespace

func (ROFilespace) IsFile

func (ro ROFilespace) IsFile(src string) bool

IsFile method run IsFile method of parent filespace

func (ROFilespace) Lstat

func (ro ROFilespace) Lstat(src string) (os.FileInfo, error)

Lstat method run Lstat method of parent filespace

func (ROFilespace) MkdirAll

func (ro ROFilespace) MkdirAll(dest string, filemode os.FileMode) error

MkdirAll method is unavailable

func (ROFilespace) ReadDir

func (ro ROFilespace) ReadDir(src string) ([]os.FileInfo, error)

ReadDir method run ReadDir method of parent filespace

func (ROFilespace) ReadFile

func (ro ROFilespace) ReadFile(src string) ([]byte, error)

ReadFile method run ReadFile method of parent filespace

func (ROFilespace) Reader

func (ro ROFilespace) Reader(src string) (filesystem.Reader, error)

Reader method run Reader method of parent filespace

func (ROFilespace) Remove

func (ro ROFilespace) Remove(dest string) error

Remove method is unavailable

func (ROFilespace) RemoveAll

func (ro ROFilespace) RemoveAll(dest string) error

RemoveAll method is unavailable

func (ROFilespace) WriteFile

func (ro ROFilespace) WriteFile(dest string, data []byte, perm os.FileMode) error

WriteFile method is unavailable

func (ROFilespace) Writer

func (ro ROFilespace) Writer(dest string) (filesystem.Writer, error)

Writer method is unavailable

type SubFS

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

SubFS is a filespace related to a base path in other filespace

func (SubFS) Copy

func (sub SubFS) Copy(src, dest string) error

Copy method run Copy method of parent filesystem but in relative base path

func (SubFS) CopyDirectory

func (sub SubFS) CopyDirectory(src, dest string) error

CopyDirectory method run CopyDirectory method of parent filesystem but in relative base path

func (SubFS) CopyFile

func (sub SubFS) CopyFile(src, dest string) error

CopyFile method run CopyFile method of parent filesystem but in relative base path

func (SubFS) Filespace

func (sub SubFS) Filespace(src string) (filesystem.Filespace, error)

Filespace create new filespace

func (SubFS) IsDir

func (sub SubFS) IsDir(src string) bool

IsDir method run IsDir method of parent filesystem but in relative base path

func (SubFS) IsExist

func (sub SubFS) IsExist(src string) bool

IsExist method run IsExist method of parent filesystem but in relative base path

func (SubFS) IsFile

func (sub SubFS) IsFile(src string) bool

IsFile method run IsFile method of parent filesystem but in relative base path

func (SubFS) Lstat

func (sub SubFS) Lstat(src string) (os.FileInfo, error)

Lstat method run Lstat method of parent filesystem but in relative base path

func (SubFS) MkdirAll

func (sub SubFS) MkdirAll(dest string, filemode os.FileMode) error

MkdirAll method run MkdirAll method of parent filesystem but in relative base path

func (SubFS) ReadDir

func (sub SubFS) ReadDir(src string) ([]os.FileInfo, error)

ReadDir method run ReadDir method of parent filesystem but in relative base path

func (SubFS) ReadFile

func (sub SubFS) ReadFile(src string) ([]byte, error)

ReadFile method run ReadFile method of parent filesystem but in relative base path

func (SubFS) Reader

func (sub SubFS) Reader(src string) (filesystem.Reader, error)

Reader method run Reader method of parent filesystem but in relative base path

func (SubFS) Remove

func (sub SubFS) Remove(dest string) error

Remove method run Remove method of parent filesystem but in relative base path

func (SubFS) RemoveAll

func (sub SubFS) RemoveAll(dest string) error

RemoveAll method run RemoveAll method of parent filesystem but in relative base path

func (SubFS) WriteFile

func (sub SubFS) WriteFile(dest string, data []byte, perm os.FileMode) error

WriteFile method run WriteFile method of parent filesystem but in relative base path

func (SubFS) Writer

func (sub SubFS) Writer(dest string) (filesystem.Writer, error)

Writer method run Writer method of parent filesystem but in relative base path

Jump to

Keyboard shortcuts

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