adapter

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnknownTenantErr = errors.New("unknown tenantJiscID")
)

Functions

func NewStorageDynamoDB

func NewStorageDynamoDB(client dynamodbiface.DynamoDBAPI, table string) *storageDynamoDBImpl

Types

type Adapter

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

Adapter is the core of the adapter.

It uses a broker to subscribe to the queues, receive messages, forward operations to Archivematica and return the results. It employs an internal storage.

func New

func New(
	logger logrus.FieldLogger,
	broker *broker.Broker,
	s3 s3.ObjectStorage,
	storage Storage,
	registry *Registry,
) *Adapter

func (*Adapter) Run

func (c *Adapter) Run()

func (*Adapter) Stop

func (c *Adapter) Stop()

type Registry

type Registry struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry(logger logrus.FieldLogger, dynamodbClient dynamodbiface.DynamoDBAPI, dynamodbTable string) (*Registry, error)

NewRegistry returns a usable registry.

func (*Registry) Get

func (r *Registry) Get(tenantID uint64) *amclient.Client

Get a client for a given tenant.

func (*Registry) Log

func (r *Registry) Log()

func (*Registry) Reload

func (r *Registry) Reload()

Reload is a non-blocking request to reload the registry. The operation is omitted if it is already happening.

func (*Registry) Stop

func (r *Registry) Stop()

type Storage

type Storage interface {
	AssociateResearchObject(ctx context.Context, objectUUID string, transferID string) error
	GetResearchObject(ctx context.Context, objectUUID string) (string, error)
}

Jump to

Keyboard shortcuts

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