export

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CopyAction   = "export:copy"
	DeleteAction = "export:delete"
	TouchAction  = "export:touch"
	DoneAction   = "export:done"
)

Variables

View Source
var (
	ErrMissingColumns = errors.New("missing columns in differences result")
	ErrConflict       = errors.New("cannot generate task for conflict in diff")
)

Functions

func GenerateTasksFromDiffs

func GenerateTasksFromDiffs(exportID string, dstPrefix string, diffs catalog.Differences, generateSuccessFor func(path string) bool) ([]parade.TaskData, error)

GenerateTasksFromDiffs converts diffs into many tasks that depend on startTaskID, with a "generate success" task after generating all files in each directory that matches generateSuccessFor.

Types

type CopyData

type CopyData struct {
	From string `json:"from"`
	To   string `json:"to"`
	ETag string `json:"etag"` // Empty for now :-(
}

type DeleteData

type DeleteData struct {
	File string `json:"file"`
}

type DirMatchCache

type DirMatchCache struct {
	// contains filtered or unexported fields
}

func NewDirMatchCache

func NewDirMatchCache(pred func(path string) bool) *DirMatchCache

func (*DirMatchCache) Lookup

func (dmc *DirMatchCache) Lookup(filename string) (string, bool)

type SuccessData

type SuccessData struct {
	File string `json:"file"`
}

type SuccessTasksTreeGenerator

type SuccessTasksTreeGenerator struct {
	// contains filtered or unexported fields
}

SuccessTasksTreeGenerator accumulates success tasks during task generator. It is exported (only) for testing.

func NewSuccessTasksTreeGenerator

func NewSuccessTasksTreeGenerator(exportID string, generateSuccessFor func(path string) bool, makeDestination func(string) string) SuccessTasksTreeGenerator

func (*SuccessTasksTreeGenerator) AddFor

func (s *SuccessTasksTreeGenerator) AddFor(path string) (parade.TaskID, error)

AddFor adds a dependency task for path (there will always be exactly one, either to create a success file after path, or to finish everything), and returns its task ID for the caller to signal when done.

func (*SuccessTasksTreeGenerator) GenerateTasksTo

func (s *SuccessTasksTreeGenerator) GenerateTasksTo(tasks []parade.TaskData) []parade.TaskData

GenerateTasksTo generates and appends all success tasks and the finished task to tasks, returning a new tasks slice.

Jump to

Keyboard shortcuts

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