Documentation ¶
Overview ¶
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Index ¶
- Variables
- type FileLoader
- type FileSystem
- func (f *FileSystem) Clone() FileLoader
- func (f *FileSystem) CopyFile(src string, tgt string) error
- func (f *FileSystem) CopyRecursive(src string, tgt string, ignore []string) error
- func (f *FileSystem) CreateDirectory(path string) error
- func (f *FileSystem) Exists(path string) bool
- func (f *FileSystem) IsDir(path string) bool
- func (f *FileSystem) ListDirectories(path string, ign []string) []string
- func (f *FileSystem) ListExtension(path string, ext string, ign []string, trimExtension bool) []string
- func (f *FileSystem) ListFiles(path string, ign []string) []os.DirEntry
- func (f *FileSystem) ListFilesRecursive(path string, ign []string) ([]string, error)
- func (f *FileSystem) ListJSON(path string, ign []string, trimExtension bool) []string
- func (f *FileSystem) Move(src string, tgt string) error
- func (f *FileSystem) PeekFile(path string, maxSize int) ([]byte, error)
- func (f *FileSystem) ReadFile(path string) ([]byte, error)
- func (f *FileSystem) Remove(path string) error
- func (f *FileSystem) RemoveRecursive(path string) error
- func (f *FileSystem) Root() string
- func (f *FileSystem) SetMode(path string, mode os.FileMode) error
- func (f *FileSystem) Stat(path string) (os.FileInfo, error)
- func (f *FileSystem) Walk(path string, ign []string, ...) error
- func (f *FileSystem) WriteFile(path string, content []byte, mode os.FileMode, overwrite bool) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DirectoryMode = os.FileMode(0o755) DefaultMode = os.FileMode(0o644) )
Functions ¶
This section is empty.
Types ¶
type FileLoader ¶
type FileLoader interface { Root() string Clone() FileLoader PeekFile(path string, maxSize int) ([]byte, error) ReadFile(path string) ([]byte, error) CreateDirectory(path string) error WriteFile(path string, content []byte, mode os.FileMode, overwrite bool) error CopyFile(src string, tgt string) error CopyRecursive(src string, tgt string, ignore []string) error Move(src string, tgt string) error ListFiles(path string, ignore []string) []os.DirEntry ListFilesRecursive(path string, ignore []string) ([]string, error) ListJSON(path string, ignore []string, trimExtension bool) []string ListExtension(path string, ext string, ignore []string, trimExtension bool) []string ListDirectories(path string, ignore []string) []string Walk(path string, ign []string, fn func(fp string, info os.FileInfo, err error) error) error Stat(path string) (os.FileInfo, error) SetMode(path string, mode os.FileMode) error Exists(path string) bool IsDir(path string) bool Remove(path string) error RemoveRecursive(pt string) error }
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
func NewFileSystem ¶
func NewFileSystem(root string, logger util.Logger) *FileSystem
func (*FileSystem) Clone ¶
func (f *FileSystem) Clone() FileLoader
func (*FileSystem) CopyRecursive ¶
func (f *FileSystem) CopyRecursive(src string, tgt string, ignore []string) error
func (*FileSystem) CreateDirectory ¶
func (f *FileSystem) CreateDirectory(path string) error
func (*FileSystem) Exists ¶
func (f *FileSystem) Exists(path string) bool
func (*FileSystem) IsDir ¶
func (f *FileSystem) IsDir(path string) bool
func (*FileSystem) ListDirectories ¶
func (f *FileSystem) ListDirectories(path string, ign []string) []string
func (*FileSystem) ListExtension ¶
func (*FileSystem) ListFiles ¶
func (f *FileSystem) ListFiles(path string, ign []string) []os.DirEntry
func (*FileSystem) ListFilesRecursive ¶
func (f *FileSystem) ListFilesRecursive(path string, ign []string) ([]string, error)
func (*FileSystem) ListJSON ¶
func (f *FileSystem) ListJSON(path string, ign []string, trimExtension bool) []string
func (*FileSystem) PeekFile ¶
func (f *FileSystem) PeekFile(path string, maxSize int) ([]byte, error)
func (*FileSystem) Remove ¶
func (f *FileSystem) Remove(path string) error
func (*FileSystem) RemoveRecursive ¶
func (f *FileSystem) RemoveRecursive(path string) error
func (*FileSystem) Root ¶
func (f *FileSystem) Root() string
func (*FileSystem) SetMode ¶ added in v0.2.27
func (f *FileSystem) SetMode(path string, mode os.FileMode) error
Click to show internal directories.
Click to hide internal directories.