monitor

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

type Monitor interface {
	// Start go to start the monitor to monitor the file change
	Start() (wait.Wait, error)
	// Close stop the monitor
	Close() error
	// SyncCron register sync cron task, if spec is empty then ignore it
	SyncCron(spec string) error
	// Shutdown exit the Start
	Shutdown() error
}

Monitor file system monitor

func NewFsNotifyMonitor

func NewFsNotifyMonitor(opt Option) (m Monitor, err error)

NewFsNotifyMonitor create an instance of fsNotifyMonitor to monitor the disk change

func NewMinIOPullClientMonitor added in v0.4.4

func NewMinIOPullClientMonitor(opt Option) (m Monitor, err error)

NewMinIOPullClientMonitor create an instance of minIOPullClientMonitor to pull the files from MinIO server

func NewMonitor

func NewMonitor(opt Option, run runFn) (Monitor, error)

NewMonitor create a monitor instance

func NewRemoteClientMonitor

func NewRemoteClientMonitor(opt Option) (Monitor, error)

NewRemoteClientMonitor create an instance of remoteClientMonitor to monitor the remote file change

func NewRemoteServerMonitor

func NewRemoteServerMonitor(opt Option) (m Monitor, err error)

NewRemoteServerMonitor create an instance of the fsNotifyMonitor

func NewSftpPullClientMonitor added in v0.4.4

func NewSftpPullClientMonitor(opt Option) (m Monitor, err error)

NewSftpPullClientMonitor create an instance of sftpPullClientMonitor to pull the files from sftp server

func NewTaskClientMonitor added in v0.7.0

func NewTaskClientMonitor(opt Option, run runFn) (Monitor, error)

NewTaskClientMonitor create an instance of taskClientMonitor to receive the task from remote server

type Option added in v0.5.1

type Option struct {
	SyncOnce            bool
	EnableTLS           bool
	TLSCertFile         string
	EnableSyncDelay     bool
	SyncDelayEvents     int
	SyncDelayTime       time.Duration
	SyncWorkers         int
	Users               []*auth.User
	EventWriter         io.Writer
	Syncer              sync.Sync
	Retry               retry.Retry
	PathIgnore          ignore.PathIgnore
	Reporter            report.Reporter
	EnableTaskClient    bool
	TaskClientLabels    []string
	TaskClientMaxWorker int
	Logger              *logger.Logger
}

Option the monitor component option

func NewMonitorOption added in v0.5.1

func NewMonitorOption(config conf.Config, syncer sync.Sync, retry retry.Retry, users []*auth.User, eventWriter io.Writer, pi ignore.PathIgnore, reporter report.Reporter, logger *logger.Logger) Option

NewMonitorOption create an instance of the Option, store all the monitor component options

Jump to

Keyboard shortcuts

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