task

package
v3.0.0-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: AGPL-3.0 Imports: 18 Imported by: 11

Documentation

Overview

Package task defines a synchronization task

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sync

type Sync struct {
	Source           model.Endpoint
	Target           model.Endpoint
	Direction        model.DirectionType
	Roots            []string
	Ignores          []glob.Glob
	SkipTargetChecks bool
	FailsafeDeletes  bool
	// contains filtered or unexported fields
}

func NewSync

func NewSync(left model.Endpoint, right model.Endpoint, direction model.DirectionType) *Sync

NewSync creates a new sync task

func (*Sync) BroadcastCloseSession

func (s *Sync) BroadcastCloseSession(sessionUuid string)

BroadcastCloseSession forwards session id to underlying batchers

func (*Sync) Capture

func (s *Sync) Capture(ctx context.Context, targetFolder string) error

func (*Sync) Pause

func (s *Sync) Pause(ctx context.Context)

Pause should pause the sync

func (*Sync) ReApplyPatch

func (s *Sync) ReApplyPatch(ctx context.Context, patch merger.Patch)

func (*Sync) Resume

func (s *Sync) Resume(ctx context.Context)

Resume should resume the sync

func (*Sync) RootStats

func (s *Sync) RootStats(ctx context.Context, useSnapshots bool) (map[string]*model.EndpointRootStat, error)

func (*Sync) Run

func (s *Sync) Run(ctx context.Context, dryRun bool, force bool) (model.Stater, error)

Run runs the sync with panic recovery

func (*Sync) SetFilters

func (s *Sync) SetFilters(roots []string, excludes []string)

SetFilters allows passing selective roots (includes) and ignores (excludes). Ignores are a list of patterns conforming to the glob standard, with support for double star

func (*Sync) SetPatchListener

func (s *Sync) SetPatchListener(listener merger.PatchListener)

SetPatchListener adds a listener on the Patch channel to do something with patches before they are processed

func (*Sync) SetSnapshotFactory

func (s *Sync) SetSnapshotFactory(factory model.SnapshotFactory)

SetSnapshotFactory set up a factory for loading/saving snapshots

func (*Sync) SetupCmd

func (s *Sync) SetupCmd(cmd *model.Command)

func (*Sync) SetupEventsChan

func (s *Sync) SetupEventsChan(statusChan chan model.Status, batchDone chan interface{}, events chan interface{})

SetupEventsChan wires internal sync event to external status channels

func (*Sync) Shutdown

func (s *Sync) Shutdown()

Shutdown closes channels

func (*Sync) Start

func (s *Sync) Start(ctx context.Context, withWatches bool)

Start makes a first sync and setup watchers

Jump to

Keyboard shortcuts

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