Documentation ¶
Overview ¶
Package proc provides actual actions to be performed once the sync has filtered all events
Index ¶
- type ConnectedProcessor
- func (pr *ConnectedProcessor) LockFile(operation merger.Operation, path string, operationId string)
- func (pr *ConnectedProcessor) ProcessPatches()
- func (pr *ConnectedProcessor) SetLocksChan(locks chan model.LockEvent)
- func (pr *ConnectedProcessor) Start()
- func (pr *ConnectedProcessor) Stop()
- func (pr *ConnectedProcessor) UnlockFile(operation merger.Operation, path string)
- type ProcessFunc
- type Processor
- type ProcessorLocker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectedProcessor ¶
type ConnectedProcessor struct { Processor PatchChan chan merger.Patch LocksChan chan model.LockEvent Cmd *model.Command }
ConnectedProcessor is an extended flavour of Processor that listens to a PatchChan and sends LockEvents and Requeue Scan Events
func NewConnectedProcessor ¶
func NewConnectedProcessor(ctx context.Context, cmd *model.Command) *ConnectedProcessor
NewConnectedProcessor creates a new connected processor
func (*ConnectedProcessor) LockFile ¶
func (pr *ConnectedProcessor) LockFile(operation merger.Operation, path string, operationId string)
LockFile implements Connector func
func (*ConnectedProcessor) ProcessPatches ¶
func (pr *ConnectedProcessor) ProcessPatches()
ProcessPatches listens to PatchChan for processing
func (*ConnectedProcessor) SetLocksChan ¶
func (pr *ConnectedProcessor) SetLocksChan(locks chan model.LockEvent)
SetLocksChan sets the locks event channel
func (*ConnectedProcessor) Start ¶
func (pr *ConnectedProcessor) Start()
Start starts listening for Patch channel
func (*ConnectedProcessor) Stop ¶
func (pr *ConnectedProcessor) Stop()
Stop closes Patch Channel and Interrupt Channel
func (*ConnectedProcessor) UnlockFile ¶
func (pr *ConnectedProcessor) UnlockFile(operation merger.Operation, path string)
UnlockFile implements Connector func
type ProcessFunc ¶
type ProcessFunc func(canceler context.Context, event merger.Operation, operationId string, progress chan int64) error
ProcessFunc is a generic function signature for applying an operation
type Processor ¶
type Processor struct { GlobalContext context.Context Locker ProcessorLocker QueueSize int Silent bool SkipTargetChecks bool Ignores []glob.Glob PatchListener merger.PatchListener }
Processor is a simple processor without external connections
func NewProcessor ¶
NewProcessor creates a new processor
type ProcessorLocker ¶
type ProcessorLocker interface { // LockFile sends LockEvent for Echo Filtering LockFile(operation merger.Operation, path string, operationId string) // UnlockFile sends UnlockEvent for Echo Filtering UnlockFile(operation merger.Operation, path string) }
ProcessorLocker defines a set of event based functions that can be called during processing