Documentation ¶
Overview ¶
Package filters provides batchers and filters to analyze and simplify sync events
Index ¶
- type EchoFilter
- type EventsBatcher
- func (ev *EventsBatcher) Batch(in chan model.EventInfo, out chan merger.Patch)
- func (ev *EventsBatcher) Done(info interface{})
- func (ev *EventsBatcher) ForceCloseSession(sessionUuid string)
- func (ev *EventsBatcher) MonitorActivity()
- func (ev *EventsBatcher) SetEndpointStatusChan(c chan *model.EndpointStatus)
- func (ev *EventsBatcher) SetupChannels(status chan model.Status, done chan interface{}, cmd *model.Command)
- func (ev *EventsBatcher) Status(s model.Status)
- type SelectiveRootsFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EchoFilter ¶
EchoFilter tries to detect events that are linked to an operation that has just been performed by a processor. It listen to two Lock and Unlock events channels to maintain an internal list of events that have been performed. It's the mission of the processor to actually unlock after a given time.
func (*EchoFilter) GetLocksChan ¶
func (f *EchoFilter) GetLocksChan() chan model.LockEvent
func (*EchoFilter) Pipe ¶
func (f *EchoFilter) Pipe(in chan model.EventInfo) (out chan model.EventInfo)
func (*EchoFilter) Start ¶
func (f *EchoFilter) Start()
func (*EchoFilter) Stop ¶
func (f *EchoFilter) Stop()
type EventsBatcher ¶
type EventsBatcher struct { Source model.PathSyncSource Target model.PathSyncTarget // contains filtered or unexported fields }
EventsBatcher will batch incoming events and process them after a certain idle time. If incoming events have a SessionUuid, events are batched separately in-memory and processed once a close-session event is received
func NewEventsBatcher ¶
func NewEventsBatcher(ctx context.Context, source model.PathSyncSource, target model.PathSyncTarget, ignores []glob.Glob, debounce ...time.Duration) *EventsBatcher
NewEventsBatcher creates a new EventsBatcher
func (*EventsBatcher) Batch ¶
func (ev *EventsBatcher) Batch(in chan model.EventInfo, out chan merger.Patch)
Batch starts processing incoming events and turn them into Patch
func (*EventsBatcher) Done ¶
func (ev *EventsBatcher) Done(info interface{})
func (*EventsBatcher) ForceCloseSession ¶
func (ev *EventsBatcher) ForceCloseSession(sessionUuid string)
ForceCloseSession makes sure an in-memory session is always flushed
func (*EventsBatcher) MonitorActivity ¶
func (ev *EventsBatcher) MonitorActivity()
func (*EventsBatcher) SetEndpointStatusChan ¶
func (ev *EventsBatcher) SetEndpointStatusChan(c chan *model.EndpointStatus)
func (*EventsBatcher) SetupChannels ¶
func (ev *EventsBatcher) SetupChannels(status chan model.Status, done chan interface{}, cmd *model.Command)
func (*EventsBatcher) Status ¶
func (ev *EventsBatcher) Status(s model.Status)
type SelectiveRootsFilter ¶
type SelectiveRootsFilter struct {
// contains filtered or unexported fields
}
SelectiveRootsFilter is a Pipe filtering events that are outside of the selective roots
func NewSelectiveRootsFilter ¶
func NewSelectiveRootsFilter(roots []string) *SelectiveRootsFilter
NewSelectiveRoots creates a new SelectiveRootsFilter and starts listening to events
func (*SelectiveRootsFilter) Close ¶
func (s *SelectiveRootsFilter) Close()
Close stops the filter from listening
func (*SelectiveRootsFilter) GetOutput ¶
func (s *SelectiveRootsFilter) GetOutput() chan model.EventInfo
GetOutput returns the output chan