storage

package
v0.0.0-...-db1a339 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CopyToPermanentLocationActivityName = "copy-to-permanent-location-activity"
	DeleteFromLocationActivityName      = "delete-from-location-activity"
	StorageUploadWorkflowName           = "storage-upload-workflow"
	StorageMoveWorkflowName             = "storage-move-workflow"
	UploadDoneSignalName                = "upload-done-signal"
)

Variables

View Source
var ErrInvalidToken error = goastorage.Unauthorized("invalid token")
View Source
var SubmitURLExpirationTime = 15 * time.Minute

Functions

func DeleteFromLocationLocalActivity

func DeleteFromLocationLocalActivity(
	ctx context.Context,
	storagesvc Service,
	params *DeleteFromLocationLocalActivityParams,
) error

func Download

func Download(svc Service, mux goahttp.Muxer, dec func(r *http.Request) goahttp.Decoder) http.HandlerFunc

Download returns an HTTP handler that sets the headers for the AIP when it is downloaded. The headers are the Content Type, Content Length, and the Content Disposition. If there is an error with the file download, it will return http-status not found (404).

func NewService

func NewService(
	logger logr.Logger,
	config Config,
	storagePersistence persistence.Storage,
	tc temporalsdk_client.Client,
	tokenVerifier auth.TokenVerifier,
	rander io.Reader,
) (s *serviceImpl, err error)

func UpdatePackageLocationLocalActivity

func UpdatePackageLocationLocalActivity(
	ctx context.Context,
	storagesvc Service,
	params *UpdatePackageLocationLocalActivityParams,
) error

func UpdatePackageStatusLocalActivity

func UpdatePackageStatusLocalActivity(
	ctx context.Context,
	storagesvc Service,
	params *UpdatePackageStatusLocalActivityParams,
) error

Types

type Config

type Config struct {
	TaskQueue     string
	EnduroAddress string
	Internal      LocationConfig
	Database      Database
}

type CopyToPermanentLocationActivityParams

type CopyToPermanentLocationActivityParams struct {
	AIPID      uuid.UUID
	LocationID uuid.UUID
}

type Database

type Database struct {
	// Driver specifies the database driver (e.g. "mysql" or "sqlite3").
	Driver string

	// DSN (Data Source Name) specifies the database connection information.
	DSN string

	// Migrate specifies whether to run migrations (true) to upgrade the
	// database schema or not (false).
	Migrate bool
}

type DeleteFromLocationLocalActivityParams

type DeleteFromLocationLocalActivityParams struct {
	AIPID uuid.UUID
}

type Location

type Location interface {
	UUID() uuid.UUID
	OpenBucket(ctx context.Context) (*blob.Bucket, error)
}

func NewInternalLocation

func NewInternalLocation(config *LocationConfig) (Location, error)

func NewLocation

func NewLocation(location *goastorage.Location) (Location, error)

type LocationConfig

type LocationConfig struct {
	// URL specifies the location's driver and address by URL (e.g.
	// "s3://my-bucket?region=us-west-1", "file:///tmp/my-bucket").
	URL string

	// S3 compatible location configuration. If URL has a value then these
	// fields are ignored.
	Name      string
	Region    string
	Endpoint  string
	PathStyle bool
	Profile   string
	Key       string
	Secret    string
	Token     string
	Bucket    string
}

type Service

type Service interface {
	goastorage.Service

	// Used from workflow activities.
	Location(ctx context.Context, locationID uuid.UUID) (Location, error)
	ReadPackage(ctx context.Context, aipID uuid.UUID) (*goastorage.Package, error)
	UpdatePackageStatus(ctx context.Context, aipID uuid.UUID, status types.PackageStatus) error
	UpdatePackageLocationID(ctx context.Context, aipID, locationID uuid.UUID) error
	Delete(ctx context.Context, aipID uuid.UUID) (err error)

	// Both.
	PackageReader(ctx context.Context, pkg *goastorage.Package) (*blob.Reader, error)
}

Service provides an interface for persisting storage data.

type StorageMoveWorkflowRequest

type StorageMoveWorkflowRequest struct {
	AIPID      uuid.UUID
	LocationID uuid.UUID
	TaskQueue  string
}

type StorageUploadWorkflowRequest

type StorageUploadWorkflowRequest struct {
	AIPID     uuid.UUID
	TaskQueue string
}

type UpdatePackageLocationLocalActivityParams

type UpdatePackageLocationLocalActivityParams struct {
	AIPID      uuid.UUID
	LocationID uuid.UUID
}

type UpdatePackageStatusLocalActivityParams

type UpdatePackageStatusLocalActivityParams struct {
	AIPID  uuid.UUID
	Status types.PackageStatus
}

type UploadDoneSignal

type UploadDoneSignal struct{}

Directories

Path Synopsis
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.
fake
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.
Package ssblob provides a blob implementation for the Archivematica Storage Service.
Package ssblob provides a blob implementation for the Archivematica Storage Service.

Jump to

Keyboard shortcuts

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