filters

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package filters provides batchers and filters to analyze and simplify sync events

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EchoFilter

type EchoFilter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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 NewEchoFilter

func NewEchoFilter() *EchoFilter

NewEchoFilter creates a new EchoFilter

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

func (*SelectiveRootsFilter) Pipe

func (s *SelectiveRootsFilter) Pipe(in chan model.EventInfo) chan model.EventInfo

Jump to

Keyboard shortcuts

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