activities

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package activities implements Enduro's workflow activities.

Index

Constants

View Source
const (
	DownloadActivityName                   = "download-activity"
	BundleActivityName                     = "bundle-activity"
	CleanUpActivityName                    = "clean-up-activity"
	DeleteOriginalActivityName             = "delete-original-activity"
	DisposeOriginalActivityName            = "dispose-original-activity"
	CreateStoragePackageActivityName       = "create-storage-package-activity"
	MoveToPermanentStorageActivityName     = "move-to-permanent-storage-activity"
	PollMoveToPermanentStorageActivityName = "poll-move-to-permanent-storage-activity"
	RejectPackageActivityName              = "reject-package-activity"
	UploadActivityName                     = "upload-activity"
	SendToFailedSIPsName                   = "send-to-failed-sips"
	SendToFailedPIPsName                   = "send-to-failed-pips"
)
View Source
const (
	ModeDir  = 0o750
	ModeFile = 0o640
)
View Source
const ClassifyPackageActivityName = "classify-package-activity"

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleActivity

type BundleActivity struct{}

func NewBundleActivity

func NewBundleActivity() *BundleActivity

func (*BundleActivity) Bundle

func (a *BundleActivity) Bundle(
	ctx context.Context,
	sourcePath string,
	transferDir string,
) (string, error)

Bundle a transfer with the contents found in the archive.

func (*BundleActivity) Copy

func (a *BundleActivity) Copy(ctx context.Context, src, dst string) (string, error)

Copy a transfer in the given destination using an intermediate temp. directory.

func (*BundleActivity) Execute

func (*BundleActivity) SingleFile

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

SingleFile bundles a transfer with the downloaded blob in it.

TODO: Write metadata.csv and checksum files to the metadata dir.

type BundleActivityParams

type BundleActivityParams struct {
	// SourcePath is the path of the transfer file or directory.
	SourcePath string

	// TransferDir is the target directory for the bundled package.
	TransferDir string

	// IsDir indicates that the transfer is a local directory when true. If true
	// the transfer will be copied to TransferDir without modification.
	IsDir bool
}

type BundleActivityResult

type BundleActivityResult struct {
	FullPath string // Full path to the transfer in the worker running the session.
}

type ClassifyPackageActivity

type ClassifyPackageActivity struct{}

func NewClassifyPackageActivity

func NewClassifyPackageActivity() *ClassifyPackageActivity

func (*ClassifyPackageActivity) Execute

type ClassifyPackageActivityParams

type ClassifyPackageActivityParams struct {
	// Path is the full path of the package.
	Path string
}

type ClassifyPackageActivityResult

type ClassifyPackageActivityResult struct {
	// Type of the package.
	Type enums.PackageType
}

type CreateStoragePackageActivity

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

func NewCreateStoragePackageActivity

func NewCreateStoragePackageActivity(client storage.Client) *CreateStoragePackageActivity

func (*CreateStoragePackageActivity) Execute

type CreateStoragePackageActivityParams

type CreateStoragePackageActivityParams struct {
	Name       string
	AIPID      string
	ObjectKey  string
	Status     string
	LocationID *uuid.UUID
}

type CreateStoragePackageActivityResult

type CreateStoragePackageActivityResult struct {
	CreatedAt string
}

type DeleteOriginalActivity

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

func NewDeleteOriginalActivity

func NewDeleteOriginalActivity(wsvc watcher.Service) *DeleteOriginalActivity

func (*DeleteOriginalActivity) Execute

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

type DeleteOriginalActivityResult

type DeleteOriginalActivityResult struct{}

type DisposeOriginalActivity

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

func NewDisposeOriginalActivity

func NewDisposeOriginalActivity(wsvc watcher.Service) *DisposeOriginalActivity

func (*DisposeOriginalActivity) Execute

func (a *DisposeOriginalActivity) Execute(
	ctx context.Context,
	watcherName, completedDir, key string,
) (*DisposeOriginalActivityResult, error)

type DisposeOriginalActivityResult

type DisposeOriginalActivityResult struct{}

type DownloadActivity

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

DownloadActivity downloads the blob into the processing directory.

func NewDownloadActivity

func NewDownloadActivity(tracer trace.Tracer, wsvc watcher.Service) *DownloadActivity

func (*DownloadActivity) Execute

type DownloadActivityParams

type DownloadActivityParams struct {
	Key             string
	WatcherName     string
	DestinationPath string
}

type DownloadActivityResult

type DownloadActivityResult struct {
	Path string
}

type MoveToPermanentStorageActivity

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

func NewMoveToPermanentStorageActivity

func NewMoveToPermanentStorageActivity(storageClient *goastorage.Client) *MoveToPermanentStorageActivity

func (*MoveToPermanentStorageActivity) Execute

type MoveToPermanentStorageActivityParams

type MoveToPermanentStorageActivityParams struct {
	AIPID      string
	LocationID uuid.UUID
}

type MoveToPermanentStorageActivityResult

type MoveToPermanentStorageActivityResult struct{}

type PollMoveToPermanentStorageActivity

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

func NewPollMoveToPermanentStorageActivity

func NewPollMoveToPermanentStorageActivity(storageClient *goastorage.Client) *PollMoveToPermanentStorageActivity

type PollMoveToPermanentStorageActivityParams

type PollMoveToPermanentStorageActivityParams struct {
	AIPID string
}

type PollMoveToPermanentStorageActivityResult

type PollMoveToPermanentStorageActivityResult struct{}

type RejectPackageActivity

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

func NewRejectPackageActivity

func NewRejectPackageActivity(storageClient *goastorage.Client) *RejectPackageActivity

func (*RejectPackageActivity) Execute

type RejectPackageActivityParams

type RejectPackageActivityParams struct {
	AIPID string
}

type RejectPackageActivityResult

type RejectPackageActivityResult struct{}

type UploadActivity

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

func NewUploadActivity

func NewUploadActivity(storageClient *goastorage.Client) *UploadActivity

func (*UploadActivity) Execute

type UploadActivityParams

type UploadActivityParams struct {
	AIPPath string
	AIPID   string
	Name    string
}

type UploadActivityResult

type UploadActivityResult struct{}

Jump to

Keyboard shortcuts

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