lfs

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 9 Imported by: 1

Documentation

Index

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.

func (*FileSystem) Remove

func (fsys *FileSystem) Remove(path string) error

Remove object

func (*FileSystem) Stat

func (fsys *FileSystem) Stat(path string) (fs.FileInfo, error)

Stat returns a FileInfo describing the file.

func (*FileSystem) Wait

func (fsys *FileSystem) Wait(path string, timeout time.Duration) error

Wait for timeout until path exists

Jump to

Keyboard shortcuts

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