Documentation ¶
Overview ¶
Package package_ manages persistency and lifecycle of packages.
Index ¶
- Constants
- Variables
- func InitMoveWorkflow(ctx context.Context, tc temporalsdk_client.Client, req *MoveWorkflowRequest) (temporalsdk_client.WorkflowRun, error)
- func InitProcessingWorkflow(ctx context.Context, tc temporalsdk_client.Client, ...) error
- func NewService(logger logr.Logger, db *sql.DB, tc temporalsdk_client.Client, ...) *packageImpl
- type MoveWorkflowRequest
- type ProcessingWorkflowRequest
- type ReviewPerformedSignal
- type Service
- type UploadConfig
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 ( ErrForbidden error = goapackage.Forbidden("Forbidden") )
View Source
var ErrInvalid = errors.New("invalid")
Functions ¶
func InitMoveWorkflow ¶
func InitMoveWorkflow( ctx context.Context, tc temporalsdk_client.Client, req *MoveWorkflowRequest, ) (temporalsdk_client.WorkflowRun, error)
func InitProcessingWorkflow ¶
func InitProcessingWorkflow(ctx context.Context, tc temporalsdk_client.Client, req *ProcessingWorkflowRequest) error
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, uploadBucket *blob.Bucket, uploadMaxSize int64, ) *packageImpl
Types ¶
type MoveWorkflowRequest ¶
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 int // 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 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 int, name, workflowID, runID, aipID string, status enums.PackageStatus, storedAt time.Time, ) error SetStatus(ctx context.Context, ID int, status enums.PackageStatus) error SetStatusInProgress(ctx context.Context, ID int, startedAt time.Time) error SetStatusPending(ctx context.Context, ID int) error SetLocationID(ctx context.Context, ID int, locationID uuid.UUID) error CreatePreservationAction(ctx context.Context, pa *datatypes.PreservationAction) error SetPreservationActionStatus(ctx context.Context, ID int, status enums.PreservationActionStatus) error CompletePreservationAction( ctx context.Context, ID int, status enums.PreservationActionStatus, completedAt time.Time, ) error CreatePreservationTask(ctx context.Context, pt *datatypes.PreservationTask) error CompletePreservationTask( ctx context.Context, ID int, status enums.PreservationTaskStatus, completedAt time.Time, note *string, ) error }
type UploadConfig ¶
func (UploadConfig) Validate ¶
func (c UploadConfig) Validate() error
Validate implements config.ConfigurationValidator.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.