filesync

package
v0.0.0-...-87fc49a Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package exporter provides a filesystem watcher that mirrors changes between the cluster file system and a local directory for OS-level sharing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Printf(format string, v ...any)
}

Logger captures the logging functionality required by the exporter.

type Syncer

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

Syncer mirrors files/directories from the cluster FS to a local directory so the OS can share them via SMB/CIFS or other means.

func NewFileSyncer

func NewFileSyncer(exportDir string, importDir string, clusterDir string, excludeDirs string, logger *log.Logger, fs types.FileSystemLike) (*Syncer, error)

NewFileSyncer creates a new syncer with export and import directories.

func (*Syncer) Mkdir

func (e *Syncer) Mkdir(clusterPath string) error

func (*Syncer) MkdirWithModTime

func (e *Syncer) MkdirWithModTime(clusterPath string, modTime time.Time) error

func (*Syncer) RemoveDir

func (e *Syncer) RemoveDir(clusterPath string) error

func (*Syncer) RemoveFile

func (e *Syncer) RemoveFile(clusterPath string) error

func (*Syncer) Run

func (e *Syncer) Run(ctx context.Context)

Run performs export and import operations based on configuration.

func (*Syncer) SetCurrentFileCallback

func (e *Syncer) SetCurrentFileCallback(fn func(string))

SetCurrentFileCallback sets the callback to update current file for monitoring

func (*Syncer) WriteFile

func (e *Syncer) WriteFile(clusterPath string, data []byte, modTime time.Time) error

Jump to

Keyboard shortcuts

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