action

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	// Name returns the name of the action
	Name() string

	// Init initializes the action with configuration
	Init(cfg interface{}) error

	// SetBasePath sets the base path for the action
	SetBasePath(path string)

	// Execute performs the action on a file change event
	Execute(event fsnotify.Event) error

	// Close performs any cleanup needed
	Close() error
}

Action interface defines methods that all sync actions must implement

func NewFTPAction

func NewFTPAction() Action

NewFTPAction creates a new FTP action

func NewRsyncAction

func NewRsyncAction() Action

NewRsyncAction creates a new Rsync action

func NewSFTPAction

func NewSFTPAction() Action

NewSFTPAction creates a new SFTP action

type FTPAction

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

FTPAction implements the Action interface for FTP uploads

func (*FTPAction) Close

func (a *FTPAction) Close() error

Close closes the FTP connection

func (*FTPAction) Execute

func (a *FTPAction) Execute(event fsnotify.Event) error

Execute performs the FTP upload for a file change event

func (*FTPAction) Init

func (a *FTPAction) Init(cfg interface{}) error

Init initializes the FTP action with configuration

func (*FTPAction) Name

func (a *FTPAction) Name() string

Name returns the name of the action

func (*FTPAction) SetBasePath

func (a *FTPAction) SetBasePath(path string)

SetBasePath sets the base path for the action

type Manager

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

Manager handles multiple actions

func NewManager

func NewManager(basePath string, filters config.FileFilters, verbose bool) *Manager

NewManager creates a new action manager

func (*Manager) AddAction

func (m *Manager) AddAction(action Action)

AddAction adds an action to the manager

func (*Manager) Close

func (m *Manager) Close()

Close closes all actions

func (*Manager) HandleEvent

func (m *Manager) HandleEvent(event fsnotify.Event)

HandleEvent processes a file event with all actions

type RsyncAction

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

RsyncAction implements the Action interface for Rsync uploads

func (*RsyncAction) Close

func (a *RsyncAction) Close() error

Close performs cleanup for the Rsync action

func (*RsyncAction) Execute

func (a *RsyncAction) Execute(event fsnotify.Event) error

Execute performs the Rsync upload for a file change event

func (*RsyncAction) Init

func (a *RsyncAction) Init(cfg interface{}) error

Init initializes the Rsync action with configuration

func (*RsyncAction) Name

func (a *RsyncAction) Name() string

Name returns the name of the action

func (*RsyncAction) SetBasePath

func (a *RsyncAction) SetBasePath(path string)

SetBasePath sets the base path for the action

type SFTPAction

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

SFTPAction implements the Action interface for SFTP uploads

func (*SFTPAction) Close

func (a *SFTPAction) Close() error

Close closes the SFTP connection

func (*SFTPAction) Execute

func (a *SFTPAction) Execute(event fsnotify.Event) error

Execute performs the SFTP upload for a file change event

func (*SFTPAction) Init

func (a *SFTPAction) Init(cfg interface{}) error

Init initializes the SFTP action with configuration

func (*SFTPAction) Name

func (a *SFTPAction) Name() string

Name returns the name of the action

func (*SFTPAction) SetBasePath

func (a *SFTPAction) SetBasePath(path string)

SetBasePath sets the base path for the action

Jump to

Keyboard shortcuts

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