package_

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: 21 Imported by: 0

Documentation

Overview

Package package_ manages persistency and lifecycle of packages.

Index

Constants

View Source
const (
	// Name of the package move workflow.
	MoveWorkflowName = "move-workflow"

	// Name of the package processing workflow.
	ProcessingWorkflowName = "processing-workflow"

	// Name of the signal for reviewing a package.
	ReviewPerformedSignalName = "review-performed-signal"
)

Variables

View Source
var ErrBulkStatusUnavailable = errors.New("bulk status unavailable")
View Source
var ErrInvalidToken error = goapackage.Unauthorized("invalid token")

Functions

func NewService

func NewService(
	logger logr.Logger,
	db *sql.DB,
	tc temporalsdk_client.Client,
	evsvc event.EventService,
	psvc persistence.Service,
	tokenVerifier auth.TokenVerifier,
	ticketProvider *auth.TicketProvider,
	taskQueue string,
) *packageImpl

Types

type MoveWorkflowRequest

type MoveWorkflowRequest struct {
	ID         uint
	AIPID      string
	LocationID uuid.UUID
	TaskQueue  string
}

type ProcessingWorkflowRequest

type ProcessingWorkflowRequest struct {
	WorkflowID string `json:"-"`

	// The zero value represents a new package. It can be used to indicate
	// an existing package in retries.
	PackageID uint

	// Name of the watcher that received this blob.
	WatcherName string

	// Period of time to schedule the deletion of the original blob from the
	// watched data source. nil means no deletion.
	RetentionPeriod *time.Duration

	// Directory where the transfer is moved to once processing has completed
	// successfully.
	CompletedDir string

	// Whether the top-level directory is meant to be stripped.
	StripTopLevelDir bool

	// Key of the blob.
	Key string

	// Whether the blob is a directory (fs watcher)
	IsDir bool

	// Whether the AIP is stored automatically in the default permanent location.
	AutoApproveAIP bool

	// Location identifier for storing auto approved AIPs.
	DefaultPermanentLocationID *uuid.UUID

	// Task queues used for starting new workflows.
	GlobalTaskQueue       string
	PreservationTaskQueue string

	// PollInterval is the time to wait between poll requests to the AM API.
	PollInterval time.Duration

	// TransferDeadline is the maximum time to wait for a transfer to complete.
	// Set to zero for no deadline.
	TransferDeadline time.Duration
}

type ReviewPerformedSignal

type ReviewPerformedSignal struct {
	Accepted   bool
	LocationID *uuid.UUID
}

type Service

type Service interface {
	// Goa returns an implementation of the goapackage Service.
	Goa() goapackage.Service
	Create(context.Context, *datatypes.Package) error
	UpdateWorkflowStatus(
		ctx context.Context,
		ID uint,
		name, workflowID, runID, aipID string,
		status enums.PackageStatus,
		storedAt time.Time,
	) error
	SetStatus(ctx context.Context, ID uint, status enums.PackageStatus) error
	SetStatusInProgress(ctx context.Context, ID uint, startedAt time.Time) error
	SetStatusPending(ctx context.Context, ID uint) error
	SetLocationID(ctx context.Context, ID uint, locationID uuid.UUID) error
	CreatePreservationAction(ctx context.Context, pa *datatypes.PreservationAction) error
	SetPreservationActionStatus(ctx context.Context, ID uint, status enums.PreservationActionStatus) error
	CompletePreservationAction(
		ctx context.Context,
		ID uint,
		status enums.PreservationActionStatus,
		completedAt time.Time,
	) error
	CreatePreservationTask(ctx context.Context, pt *datatypes.PreservationTask) error
	CompletePreservationTask(
		ctx context.Context,
		ID uint,
		status enums.PreservationTaskStatus,
		completedAt time.Time,
		note *string,
	) error
}

Directories

Path Synopsis
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.

Jump to

Keyboard shortcuts

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