action

package
v0.0.0-...-9021772 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Execute(stage *collector.Stage) error
}

type Factory

type Factory interface {
	Action(syncAction *meta.SyncAction, data *SyncMatchData) Action
	CheckExpr(when string) error
}

Factory is a factory for creating Action

func NewActionFactory

func NewActionFactory(cc *container.Container) Factory

NewActionFactory create a Factory

type SyncMatchData

type SyncMatchData struct {
	JobID            string
	FileNeedSyncs    meta.FileNeedSyncs // only available in file sync stage
	FileSyncGroup    meta.FileSyncGroup
	Units            []meta.SyncUnit
	DeleteUnits      []meta.SyncUnit
	SyncedFileCounts []int
	Err              error // only available in errors stage
}

SyncMatchData is a data holder for syncAction templates

func NewSyncMatchData

func NewSyncMatchData(jobID string, grp meta.FileSyncGroup, units []meta.SyncUnit, deleteUnits []meta.SyncUnit, fileNeedSyncs meta.FileNeedSyncs, syncedFileCounts []int, err error) *SyncMatchData

NewSyncMatchData create a new SyncMatchData

func (SyncMatchData) SyncedFileSum

func (sd SyncMatchData) SyncedFileSum() int

SyncedFileSum 本次同步的总文件数目

Jump to

Keyboard shortcuts

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