filters

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2018 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 Batch

type Batch struct {
	CreateFiles            map[string]*BatchedEvent
	CreateFolders          map[string]*BatchedEvent
	Deletes                map[string]*BatchedEvent
	FileMoves              map[string]*BatchedEvent
	FolderMoves            map[string]*BatchedEvent
	SessionProvider        sync.SessionProvider
	SessionProviderContext context.Context
	StatusChan             chan BatchProcessStatus
}

func NewBatch

func NewBatch() (batch *Batch)

func (*Batch) String

func (b *Batch) String() string

func (*Batch) Zaps added in v1.2.1

func (b *Batch) Zaps() []zapcore.Field

type BatchProcessStatus

type BatchProcessStatus struct {
	IsError      bool
	StatusString string
	Progress     float32
}

type BatchedEvent

type BatchedEvent struct {
	EventInfo sync.EventInfo
	Node      *tree.Node
	Key       string
	Source    sync.PathSyncSource
	Target    sync.PathSyncTarget
}

type BidirectionalBatch

type BidirectionalBatch struct {
	Left  *Batch
	Right *Batch
}

type EchoFilter

type EchoFilter struct {
	LockEvents   chan LockEvent
	UnlockEvents chan UnlockEvent
	// contains filtered or unexported fields
}

func NewEchoFilter

func NewEchoFilter() (ef *EchoFilter)

func (*EchoFilter) CreateFilter

func (f *EchoFilter) CreateFilter() (in chan common.EventInfo, out chan common.EventInfo)

func (*EchoFilter) ListenLocksEvents

func (f *EchoFilter) ListenLocksEvents()

type EventsBatcher

type EventsBatcher struct {
	Source common.PathSyncSource
	Target common.PathSyncTarget
	// contains filtered or unexported fields
}

func NewEventsBatcher

func NewEventsBatcher(ctx context.Context, source common.PathSyncSource, target common.PathSyncTarget) *EventsBatcher

func (*EventsBatcher) BatchEvents

func (ev *EventsBatcher) BatchEvents(in chan common.EventInfo, out chan *Batch, duration time.Duration)

func (*EventsBatcher) FilterBatch

func (ev *EventsBatcher) FilterBatch(batch *Batch)

func (*EventsBatcher) ProcessEvents

func (ev *EventsBatcher) ProcessEvents(events []common.EventInfo)

func (*EventsBatcher) RegisterEventChannel

func (ev *EventsBatcher) RegisterEventChannel(out chan common.ProcessorEvent)

type LockEvent

type LockEvent struct {
	Source      common.PathSyncSource
	Path        string
	OperationId string
}

type UnlockEvent

type UnlockEvent struct {
	Source common.PathSyncSource
	Path   string
}

Jump to

Keyboard shortcuts

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