Documentation
¶
Index ¶
- type FileSystem
- func (fsys *FileSystem) Copy(source, target string) (err error)
- func (fsys *FileSystem) Create(path string, attr *struct{}) (stream.File, error)
- func (fsys *FileSystem) Glob(pattern string) ([]string, error)
- func (fsys *FileSystem) Open(path string) (fs.File, error)
- func (fsys *FileSystem) ReadDir(path string) ([]fs.DirEntry, error)
- func (fsys *FileSystem) Remove(path string) error
- func (fsys *FileSystem) Stat(path string) (fs.FileInfo, error)
- func (fsys *FileSystem) Wait(path string, timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystem ¶
type FileSystem struct {
Root string
// contains filtered or unexported fields
}
func New ¶
func New(root string) (*FileSystem, error)
Create local file system instance, mounting dir. It uses os.DirFS under the hood, making it compatible with streams extensions
func NewTempFS ¶
func NewTempFS(root string, pattern string) (*FileSystem, error)
Create temp file system
func (*FileSystem) Copy ¶
func (fsys *FileSystem) Copy(source, target string) (err error)
Copy object from source location to the target.
func (*FileSystem) Create ¶
func (fsys *FileSystem) Create(path string, attr *struct{}) (stream.File, error)
To open the file for writing use `Create` function giving the path. The path can be with or without a leading `/` - both are treated as paths relative to the mount point. The returned file descriptor is a composite of `io.Writer`, `io.Closer` and `stream.Stat`.
func (*FileSystem) Glob ¶
func (fsys *FileSystem) Glob(pattern string) ([]string, error)
Glob returns the names of all files matching pattern.
It assumes a directory if the path ends with `/`.
It return path relative to pattern for all found object.
The pattern consists of path prefix Golang regex. Its are split by `|`.
func (*FileSystem) Open ¶
func (fsys *FileSystem) Open(path string) (fs.File, error)
To open the file for reading use `Open` function giving the path. The path can be with or without a leading `/` - both are treated as paths relative to the mount point. The returned file descriptor is a composite of `io.Reader`, `io.Closer` and `stream.Stat`.
func (*FileSystem) ReadDir ¶
func (fsys *FileSystem) ReadDir(path string) ([]fs.DirEntry, error)
Reads the named directory or path prefix.
It assumes a directory if the path ends with `/`.
It return path relative to pattern for all found object.