xfs

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File = interface {
	io.Writer
	io.Closer
	Stat() (fs.FileInfo, error)
	Cancel() error
}

File provides I/O access to individual object on the file system.

type FileSystem

type FileSystem interface {
	fs.FS
	Create(path string, attr *struct{}) (File, error)
	Remove(path string) error
}

A FileSystem provides access to a hierarchical file system. The abstraction support I/O to local file system or AWS S3. Use it with https://github.com/fogfish/stream

type Worker

type Worker struct {
	Reader FileSystem
	Writer FileSystem
}

File system worker

func NewWorker

func NewWorker(reader, writer FileSystem) *Worker

func (*Worker) ReadFile

func (lib *Worker) ReadFile(path string) ([]byte, error)

func (*Worker) Walk

func (lib *Worker) Walk(ctx context.Context, dir string, f func(context.Context, *Worker, string) error) error

func (*Worker) WriteFile

func (lib *Worker) WriteFile(path string, data []byte) error

Jump to

Keyboard shortcuts

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