Back to godoc.org

Package activities

v0.30.2
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/artefactual-labs/enduro

Overview

Package activities implements Enduro's workflow activities.

Index

Constants

const (
	AcquirePipelineActivityName  = "acquire-pipeline-activity"
	DownloadActivityName         = "download-activity"
	BundleActivityName           = "bundle-activity"
	TransferActivityName         = "transfer-activity"
	PollTransferActivityName     = "poll-transfer-activity"
	PollIngestActivityName       = "poll-ingest-activity"
	CleanUpActivityName          = "clean-up-activity"
	HidePackageActivityName      = "hide-package-activity"
	DeleteOriginalActivityName   = "delete-original-activity"
	ValidateTransferActivityName = "validate-transfer-activity"
)

type AcquirePipelineActivity

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

AcquirePipelineActivity acquires a lock in the weighted semaphore associated to a particular pipeline.

func NewAcquirePipelineActivity

func NewAcquirePipelineActivity(m *manager.Manager) *AcquirePipelineActivity

func (*AcquirePipelineActivity) Execute

func (a *AcquirePipelineActivity) Execute(ctx context.Context, pipelineName string) error

type BundleActivity

type BundleActivity struct{}

func NewBundleActivity

func NewBundleActivity() *BundleActivity

func (*BundleActivity) Bundle

func (a *BundleActivity) Bundle(ctx context.Context, unar archiver.Unarchiver, transferDir, key, tempFile string, stripTopLevelDir bool) (string, string, error)

Bundle a transfer with the contents found in the archive.

func (*BundleActivity) Copy

func (a *BundleActivity) Copy(ctx context.Context, transferDir, batchDir, key string, stripTopLevelDir bool) (string, string, error)

func (*BundleActivity) Execute

func (a *BundleActivity) Execute(ctx context.Context, params *BundleActivityParams) (*BundleActivityResult, error)

func (*BundleActivity) SingleFile

func (a *BundleActivity) SingleFile(ctx context.Context, transferDir, key, tempFile string) (string, error)

SingleFile bundles a transfer with the downloaded blob in it.

func (*BundleActivity) Unarchiver

func (a *BundleActivity) Unarchiver(key, filename string) archiver.Unarchiver

Unarchiver returns the unarchiver suited for the archival format.

type BundleActivityParams

type BundleActivityParams struct {
	TransferDir      string
	Key              string
	TempFile         string
	StripTopLevelDir bool
	BatchDir         string
}

type BundleActivityResult

type BundleActivityResult struct {
	RelPath             string // Path of the transfer relative to the transfer directory.
	FullPath            string // Full path to the transfer in the worker running the session.
	FullPathBeforeStrip string // Same as FullPath but includes the top-level dir even when stripped.
}

type CleanUpActivity

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

CleanUpActivity removes the contents that we've created in the TS location.

func NewCleanUpActivity

func NewCleanUpActivity(m *manager.Manager) *CleanUpActivity

func (*CleanUpActivity) Execute

func (a *CleanUpActivity) Execute(ctx context.Context, params *CleanUpActivityParams) error

type CleanUpActivityParams

type CleanUpActivityParams struct {
	FullPath string
}

type DeleteOriginalActivity

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

func NewDeleteOriginalActivity

func NewDeleteOriginalActivity(m *manager.Manager) *DeleteOriginalActivity

func (*DeleteOriginalActivity) Execute

func (a *DeleteOriginalActivity) Execute(ctx context.Context, watcherName, key string) error

type DownloadActivity

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

DownloadActivity downloads the blob into the pipeline processing directory.

func NewDownloadActivity

func NewDownloadActivity(m *manager.Manager) *DownloadActivity

func (*DownloadActivity) Execute

func (a *DownloadActivity) Execute(ctx context.Context, pipelineName, watcherName, key string) (string, error)

type HidePackageActivity

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

func NewHidePackageActivity

func NewHidePackageActivity(m *manager.Manager) *HidePackageActivity

func (*HidePackageActivity) Execute

func (a *HidePackageActivity) Execute(ctx context.Context, unitID, unitType, pipelineName string) error

type PollIngestActivity

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

func NewPollIngestActivity

func NewPollIngestActivity(m *manager.Manager) *PollIngestActivity

func (*PollIngestActivity) Execute

func (a *PollIngestActivity) Execute(ctx context.Context, params *PollIngestActivityParams) (time.Time, error)

type PollIngestActivityParams

type PollIngestActivityParams struct {
	PipelineName string
	SIPID        string
}

type PollTransferActivity

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

func NewPollTransferActivity

func NewPollTransferActivity(m *manager.Manager) *PollTransferActivity

func (*PollTransferActivity) Execute

func (a *PollTransferActivity) Execute(ctx context.Context, params *PollTransferActivityParams) (string, error)

type PollTransferActivityParams

type PollTransferActivityParams struct {
	PipelineName string
	TransferID   string
}

type TransferActivity

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

TransferActivity submits the transfer to Archivematica and returns its ID.

This is our first interaction with Archivematica. The workflow ends here after authentication errors.

func NewTransferActivity

func NewTransferActivity(m *manager.Manager) *TransferActivity

func (*TransferActivity) Execute

func (a *TransferActivity) Execute(ctx context.Context, params *TransferActivityParams) (*TransferActivityResponse, error)

type TransferActivityParams

type TransferActivityParams struct {
	PipelineName       string
	TransferLocationID string
	RelPath            string
	Name               string
	ProcessingConfig   string
	AutoApprove        bool
}

type TransferActivityResponse

type TransferActivityResponse struct {
	TransferID      string
	PipelineVersion string
	PipelineID      string
}

type ValidateTransferActivity

type ValidateTransferActivity struct{}

func NewValidateTransferActivity

func NewValidateTransferActivity() *ValidateTransferActivity

func (*ValidateTransferActivity) Execute

func (a *ValidateTransferActivity) Execute(ctx context.Context, params *ValidateTransferActivityParams) error

type ValidateTransferActivityParams

type ValidateTransferActivityParams struct {
	Config validation.Config
	Path   string
}

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier