export

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: Apache-2.0 Imports: 9 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.

func PathToPointer added in v0.15.0

func PathToPointer(path string) (block.ObjectPointer, error)

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 Handler added in v0.15.0

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

func NewHandler added in v0.15.0

func NewHandler(adapter block.Adapter) *Handler

func (*Handler) Actions added in v0.15.0

func (h *Handler) Actions() []string

func (*Handler) ActorID added in v0.15.0

func (h *Handler) ActorID() parade.ActorID

func (*Handler) Handle added in v0.15.0

func (h *Handler) Handle(action string, body *string) parade.ActorResult

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.

type TaskBody added in v0.15.0

type TaskBody struct {
	DestinationNamespace string
	DestinationID        string
	SourceNamespace      string
	SourceID             string
}

Jump to

Keyboard shortcuts

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