syncfs

package
v0.0.0-...-4cb4b50 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexFS

type IndexFS interface {
	fs.FS
	Index(ctx context.Context, name string) (fs.FS, error)
}

type PatchFS

type PatchFS interface {
	fs.FS
	Patch(ctx context.Context, name string, tarBuf bytes.Buffer) error
}

type RemoteFS

type RemoteFS interface {
	IndexFS
	PatchFS
}

type SyncFS

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

SyncFS provides a filesystem that syncs between local and remote filesystems. All operations are applied to local first, then synced to remote.

func New

func New(local fs.FS, remote RemoteFS, delay time.Duration) *SyncFS

New creates a new SyncFS with the given local and remote filesystems

func (*SyncFS) Chmod

func (sfs *SyncFS) Chmod(name string, mode fs.FileMode) error

func (*SyncFS) Chown

func (sfs *SyncFS) Chown(name string, uid, gid int) error

func (*SyncFS) Chtimes

func (sfs *SyncFS) Chtimes(name string, atime, mtime time.Time) error

func (*SyncFS) Close

func (sfs *SyncFS) Close() error

Close shuts down the SyncFS and waits for all operations to complete

func (*SyncFS) Create

func (sfs *SyncFS) Create(name string) (fs.File, error)

Create creates a new file

func (*SyncFS) Mkdir

func (sfs *SyncFS) Mkdir(name string, perm fs.FileMode) error

Mkdir creates a directory

func (*SyncFS) Open

func (sfs *SyncFS) Open(name string) (fs.File, error)

Open opens a file for reading from local

func (*SyncFS) OpenContext

func (sfs *SyncFS) OpenContext(ctx context.Context, name string) (f fs.File, err error)

OpenContext opens a file with context from local

func (*SyncFS) OpenFile

func (sfs *SyncFS) OpenFile(name string, flag int, perm fs.FileMode) (f fs.File, err error)

OpenFile opens a file with flags

func (*SyncFS) ReadDir

func (sfs *SyncFS) ReadDir(name string) (entries []fs.DirEntry, err error)

ReadDir reads directory entries from local

func (sfs *SyncFS) Readlink(name string) (string, error)

Readlink reads the target of a symbolic link

func (*SyncFS) Remove

func (sfs *SyncFS) Remove(name string) error

func (*SyncFS) Rename

func (sfs *SyncFS) Rename(oldname, newname string) error

func (*SyncFS) Stat

func (sfs *SyncFS) Stat(name string) (fs.FileInfo, error)

Stat returns file info from local

func (*SyncFS) StatContext

func (sfs *SyncFS) StatContext(ctx context.Context, name string) (info fs.FileInfo, err error)

StatContext returns file info with context from local

func (sfs *SyncFS) Symlink(oldname, newname string) error

Symlink creates a symbolic link

func (*SyncFS) Sync

func (sfs *SyncFS) Sync() error

Jump to

Keyboard shortcuts

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