Documentation
¶
Index ¶
- Constants
- Variables
- func ExportBranchDone(parade parade.Parade, cataloger catalog.Cataloger, ...) error
- func ExportBranchRepair(cataloger catalog.Cataloger, repo, branch string) error
- func ExportBranchStart(parade parade.Parade, cataloger catalog.Cataloger, repo, branch string) (string, error)
- func GetStartTasks(repo, branch, fromCommitRef, toCommitRef, exportID string, ...) ([]parade.TaskData, error)
- func PathToPointer(path string) (block.ObjectPointer, error)
- type CopyData
- type DeleteData
- type DirMatchCache
- type FinishData
- type Handler
- type StartData
- type SuccessData
- type SuccessTasksTreeGenerator
- type TaskBody
- type TaskIDGenerator
- type TasksGenerator
Constants ¶
const ( StartAction = "export:start" CopyAction = "export:copy" DeleteAction = "export:delete" TouchAction = "export:touch" DoneAction = "export:done" )
Variables ¶
var ( ErrExportInProgress = errors.New("export currently in progress") ErrNothingToExport = errors.New("nothing to export") )
var ( ErrConflictingRefs = errors.New("conflicting references") ErrWrongStatus = errors.New("incorrect status") )
var ( ErrMissingColumns = errors.New("missing columns in differences result") ErrConflict = errors.New("cannot generate task for conflict in diff") )
Functions ¶
func ExportBranchDone ¶ added in v0.16.0
func ExportBranchDone(parade parade.Parade, cataloger catalog.Cataloger, status catalog.CatalogBranchExportStatus, statusMsg *string, repo, branch, commitRef string) error
ExportBranchDone ends the export branch process by changing the status
func ExportBranchRepair ¶ added in v0.17.0
ExportBranchRepair changes state from Failed To Repair and starts a new export. It fails if the current state is not ExportStatusFailed.
func ExportBranchStart ¶ added in v0.16.0
func ExportBranchStart(parade parade.Parade, cataloger catalog.Cataloger, repo, branch string) (string, error)
ExportBranchStart inserts a start task on branch, sets branch export state to pending. It returns ErrExportInProgress if an export is already in progress.
func GetStartTasks ¶ added in v0.16.0
func PathToPointer ¶ added in v0.15.0
func PathToPointer(path string) (block.ObjectPointer, error)
Types ¶
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
type FinishData ¶ added in v0.16.0
type Handler ¶ added in v0.15.0
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶ added in v0.15.0
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 (*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 TaskIDGenerator ¶ added in v0.16.0
type TaskIDGenerator string
taskIdGenerator generates IDs for export tasks based on its exportID.
func (TaskIDGenerator) CopyTaskID ¶ added in v0.16.0
func (exportID TaskIDGenerator) CopyTaskID(path string) parade.TaskID
func (TaskIDGenerator) DeleteTaskID ¶ added in v0.16.0
func (exportID TaskIDGenerator) DeleteTaskID(path string) parade.TaskID
type TasksGenerator ¶ added in v0.16.0
type TasksGenerator struct {
ExportID string
DstPrefix string
GenerateSuccessFor func(path string) bool
NumTries int
// contains filtered or unexported fields
}
TasksGenerator generates tasks from diffs iteratively.
func NewTasksGenerator ¶ added in v0.16.0
func NewTasksGenerator(exportID string, dstPrefix string, generateSuccessFor func(path string) bool, finishBody *string, storageNamespace string) *TasksGenerator
NewTasksGenerator returns a generator that exports tasks from diffs to file operations under dstPrefix. It generates success files for files in directories matched by "generateSuccessFor".
func (*TasksGenerator) Add ¶ added in v0.16.0
func (e *TasksGenerator) Add(diffs catalog.Differences) ([]parade.TaskData, error)
Add translates diffs into many tasks and remembers "generate success" tasks for Finish. It returns some tasks that can already be added.