activities

package
v0.0.0-...-c1e6758 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 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"
	MoveToPermanentStorageActivityName     = "move-to-permanent-storage-activity"
	PollMoveToPermanentStorageActivityName = "poll-move-to-permanent-storage-activity"
	RejectPackageActivityName              = "reject-package-activity"
	UploadActivityName                     = "upload-activity"
)
View Source
const (
	ModeDir  = 0o750
	ModeFile = 0o640
)
View Source
const ZipActivityName = "ZipActivity"

Variables

This section is empty.

Functions

func NewZipActivity

func NewZipActivity(logger logr.Logger) *zipActivity

Types

type BundleActivity

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

func NewBundleActivity

func NewBundleActivity(logger logr.Logger) *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 CleanUpActivity

type CleanUpActivity struct{}

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

func NewCleanUpActivity

func NewCleanUpActivity() *CleanUpActivity

func (*CleanUpActivity) Execute

type CleanUpActivityParams

type CleanUpActivityParams struct {
	FullPath string
}

type CleanUpActivityResult

type CleanUpActivityResult struct{}

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(logger logr.Logger, 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{}

type ZipActivityParams

type ZipActivityParams struct {
	SourceDir string
	DestPath  string
}

type ZipActivityResult

type ZipActivityResult struct {
	Path string
}

Jump to

Keyboard shortcuts

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