storage

package
v0.0.0-...-c2b9680 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "enduro"

APIName is the name of the API as defined in the design.

View Source
const APIVersion = "0.0.1"

APIVersion is the version of the API as defined in the design.

View Source
const ServiceName = "storage"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [12]string{"submit", "create", "update", "download", "locations", "add_location", "move", "move_status", "reject", "show", "show_location", "location_packages"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func MakeFailedDependency

func MakeFailedDependency(err error) *goa.ServiceError

MakeFailedDependency builds a goa.ServiceError from an error.

func MakeNotAvailable

func MakeNotAvailable(err error) *goa.ServiceError

MakeNotAvailable builds a goa.ServiceError from an error.

func MakeNotValid

func MakeNotValid(err error) *goa.ServiceError

MakeNotValid builds a goa.ServiceError from an error.

func NewAddLocationEndpoint

func NewAddLocationEndpoint(s Service, authOAuth2Fn security.AuthOAuth2Func) goa.Endpoint

NewAddLocationEndpoint returns an endpoint function that calls the method "add_location" of service "storage".

func NewCreateEndpoint

func NewCreateEndpoint(s Service, authOAuth2Fn security.AuthOAuth2Func) goa.Endpoint

NewCreateEndpoint returns an endpoint function that calls the method "create" of service "storage".

func NewDownloadEndpoint

func NewDownloadEndpoint(s Service, authOAuth2Fn security.AuthOAuth2Func) goa.Endpoint

NewDownloadEndpoint returns an endpoint function that calls the method "download" of service "storage".

func NewLocationPackagesEndpoint

func NewLocationPackagesEndpoint(s Service, authOAuth2Fn security.AuthOAuth2Func) goa.Endpoint

NewLocationPackagesEndpoint returns an endpoint function that calls the method "location_packages" of service "storage".

func NewLocationsEndpoint

func NewLocationsEndpoint(s Service, authOAuth2Fn security.AuthOAuth2Func) goa.Endpoint

NewLocationsEndpoint returns an endpoint function that calls the method "locations" of service "storage".

func NewMoveEndpoint

func NewMoveEndpoint(s Service, authOAuth2Fn security.AuthOAuth2Func) goa.Endpoint

NewMoveEndpoint returns an endpoint function that calls the method "move" of service "storage".

func NewMoveStatusEndpoint

func NewMoveStatusEndpoint(s Service, authOAuth2Fn security.AuthOAuth2Func) goa.Endpoint

NewMoveStatusEndpoint returns an endpoint function that calls the method "move_status" of service "storage".

func NewRejectEndpoint

func NewRejectEndpoint(s Service, authOAuth2Fn security.AuthOAuth2Func) goa.Endpoint

NewRejectEndpoint returns an endpoint function that calls the method "reject" of service "storage".

func NewShowEndpoint

func NewShowEndpoint(s Service, authOAuth2Fn security.AuthOAuth2Func) goa.Endpoint

NewShowEndpoint returns an endpoint function that calls the method "show" of service "storage".

func NewShowLocationEndpoint

func NewShowLocationEndpoint(s Service, authOAuth2Fn security.AuthOAuth2Func) goa.Endpoint

NewShowLocationEndpoint returns an endpoint function that calls the method "show_location" of service "storage".

func NewSubmitEndpoint

func NewSubmitEndpoint(s Service, authOAuth2Fn security.AuthOAuth2Func) goa.Endpoint

NewSubmitEndpoint returns an endpoint function that calls the method "submit" of service "storage".

func NewUpdateEndpoint

func NewUpdateEndpoint(s Service, authOAuth2Fn security.AuthOAuth2Func) goa.Endpoint

NewUpdateEndpoint returns an endpoint function that calls the method "update" of service "storage".

func NewViewedLocation

func NewViewedLocation(res *Location, view string) *storageviews.Location

NewViewedLocation initializes viewed result type Location from result type Location using the given view.

func NewViewedLocationCollection

func NewViewedLocationCollection(res LocationCollection, view string) storageviews.LocationCollection

NewViewedLocationCollection initializes viewed result type LocationCollection from result type LocationCollection using the given view.

func NewViewedPackage

func NewViewedPackage(res *Package, view string) *storageviews.Package

NewViewedPackage initializes viewed result type Package from result type Package using the given view.

func NewViewedPackageCollection

func NewViewedPackageCollection(res PackageCollection, view string) storageviews.PackageCollection

NewViewedPackageCollection initializes viewed result type PackageCollection from result type PackageCollection using the given view.

Types

type AMSSConfig

type AMSSConfig struct {
	APIKey   string
	URL      string
	Username string
}

func (*AMSSConfig) ConvertToSSConfig

func (t *AMSSConfig) ConvertToSSConfig() *types.AMSSConfig

ConvertToSSConfig creates an instance of SSConfig initialized from t.

type AddLocationPayload

type AddLocationPayload struct {
	Name        string
	Description *string
	Source      string
	Purpose     string
	Config      interface {
		// contains filtered or unexported methods
	}
	OauthToken *string
}

AddLocationPayload is the payload type of the storage service add_location method.

type AddLocationResult

type AddLocationResult struct {
	UUID string
}

AddLocationResult is the result type of the storage service add_location method.

type Auther

type Auther interface {
	// OAuth2Auth implements the authorization logic for the OAuth2 security scheme.
	OAuth2Auth(ctx context.Context, token string, schema *security.OAuth2Scheme) (context.Context, error)
}

Auther defines the authorization functions to be implemented by the service.

type Client

type Client struct {
	SubmitEndpoint           goa.Endpoint
	CreateEndpoint           goa.Endpoint
	UpdateEndpoint           goa.Endpoint
	DownloadEndpoint         goa.Endpoint
	LocationsEndpoint        goa.Endpoint
	AddLocationEndpoint      goa.Endpoint
	MoveEndpoint             goa.Endpoint
	MoveStatusEndpoint       goa.Endpoint
	RejectEndpoint           goa.Endpoint
	ShowEndpoint             goa.Endpoint
	ShowLocationEndpoint     goa.Endpoint
	LocationPackagesEndpoint goa.Endpoint
}

Client is the "storage" service client.

func NewClient

func NewClient(submit, create, update, download, locations, addLocation, move, moveStatus, reject, show, showLocation, locationPackages goa.Endpoint) *Client

NewClient initializes a "storage" service client given the endpoints.

func (*Client) AddLocation

func (c *Client) AddLocation(ctx context.Context, p *AddLocationPayload) (res *AddLocationResult, err error)

AddLocation calls the "add_location" endpoint of the "storage" service. AddLocation may return the following errors:

  • "not_valid" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • error: internal error

func (*Client) Create

func (c *Client) Create(ctx context.Context, p *CreatePayload) (res *Package, err error)

Create calls the "create" endpoint of the "storage" service. Create may return the following errors:

  • "not_valid" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • error: internal error

func (*Client) Download

func (c *Client) Download(ctx context.Context, p *DownloadPayload) (res []byte, err error)

Download calls the "download" endpoint of the "storage" service. Download may return the following errors:

  • "not_found" (type *PackageNotFound): Storage package not found
  • "unauthorized" (type Unauthorized)
  • error: internal error

func (*Client) LocationPackages

func (c *Client) LocationPackages(ctx context.Context, p *LocationPackagesPayload) (res PackageCollection, err error)

LocationPackages calls the "location_packages" endpoint of the "storage" service. LocationPackages may return the following errors:

  • "not_found" (type *LocationNotFound): Storage location not found
  • "not_valid" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • error: internal error

func (*Client) Locations

func (c *Client) Locations(ctx context.Context, p *LocationsPayload) (res LocationCollection, err error)

Locations calls the "locations" endpoint of the "storage" service. Locations may return the following errors:

  • "unauthorized" (type Unauthorized)
  • error: internal error

func (*Client) Move

func (c *Client) Move(ctx context.Context, p *MovePayload) (err error)

Move calls the "move" endpoint of the "storage" service. Move may return the following errors:

  • "not_found" (type *PackageNotFound): Storage package not found
  • "not_available" (type *goa.ServiceError)
  • "not_valid" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • error: internal error

func (*Client) MoveStatus

func (c *Client) MoveStatus(ctx context.Context, p *MoveStatusPayload) (res *MoveStatusResult, err error)

MoveStatus calls the "move_status" endpoint of the "storage" service. MoveStatus may return the following errors:

  • "not_found" (type *PackageNotFound): Storage package not found
  • "failed_dependency" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • error: internal error

func (*Client) Reject

func (c *Client) Reject(ctx context.Context, p *RejectPayload) (err error)

Reject calls the "reject" endpoint of the "storage" service. Reject may return the following errors:

  • "not_found" (type *PackageNotFound): Storage package not found
  • "not_available" (type *goa.ServiceError)
  • "not_valid" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • error: internal error

func (*Client) Show

func (c *Client) Show(ctx context.Context, p *ShowPayload) (res *Package, err error)

Show calls the "show" endpoint of the "storage" service. Show may return the following errors:

  • "not_found" (type *PackageNotFound): Storage package not found
  • "unauthorized" (type Unauthorized)
  • error: internal error

func (*Client) ShowLocation

func (c *Client) ShowLocation(ctx context.Context, p *ShowLocationPayload) (res *Location, err error)

ShowLocation calls the "show_location" endpoint of the "storage" service. ShowLocation may return the following errors:

  • "not_found" (type *LocationNotFound): Storage location not found
  • "unauthorized" (type Unauthorized)
  • error: internal error

func (*Client) Submit

func (c *Client) Submit(ctx context.Context, p *SubmitPayload) (res *SubmitResult, err error)

Submit calls the "submit" endpoint of the "storage" service. Submit may return the following errors:

  • "not_found" (type *PackageNotFound): Storage package not found
  • "not_available" (type *goa.ServiceError)
  • "not_valid" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • error: internal error

func (*Client) Update

func (c *Client) Update(ctx context.Context, p *UpdatePayload) (err error)

Update calls the "update" endpoint of the "storage" service. Update may return the following errors:

  • "not_found" (type *PackageNotFound): Storage package not found
  • "not_available" (type *goa.ServiceError)
  • "not_valid" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • error: internal error

type CreatePayload

type CreatePayload struct {
	// Identifier of AIP
	AipID string
	// Name of the package
	Name string
	// ObjectKey of AIP
	ObjectKey string
	// Status of the package
	Status string
	// Identifier of the package's storage location
	LocationID *uuid.UUID
	OauthToken *string
}

CreatePayload is the payload type of the storage service create method.

type DownloadPayload

type DownloadPayload struct {
	// Identifier of AIP
	AipID      string
	OauthToken *string
}

DownloadPayload is the payload type of the storage service download method.

type Endpoints

type Endpoints struct {
	Submit           goa.Endpoint
	Create           goa.Endpoint
	Update           goa.Endpoint
	Download         goa.Endpoint
	Locations        goa.Endpoint
	AddLocation      goa.Endpoint
	Move             goa.Endpoint
	MoveStatus       goa.Endpoint
	Reject           goa.Endpoint
	Show             goa.Endpoint
	ShowLocation     goa.Endpoint
	LocationPackages goa.Endpoint
}

Endpoints wraps the "storage" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "storage" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "storage" service endpoints.

type EnduroPackagePreservationAction

type EnduroPackagePreservationAction struct {
	ID          uint
	WorkflowID  string
	Type        string
	Status      string
	StartedAt   string
	CompletedAt *string
	Tasks       EnduroPackagePreservationTaskCollection
	PackageID   *uint
}

PreservationAction describes a preservation action.

type EnduroPackagePreservationTask

type EnduroPackagePreservationTask struct {
	ID                   uint
	TaskID               string
	Name                 string
	Status               string
	StartedAt            string
	CompletedAt          *string
	Note                 *string
	PreservationActionID *uint
}

PreservationTask describes a preservation action task.

type EnduroPackagePreservationTaskCollection

type EnduroPackagePreservationTaskCollection []*EnduroPackagePreservationTask

type EnduroStoredPackage

type EnduroStoredPackage struct {
	// Identifier of package
	ID uint
	// Name of the package
	Name *string
	// Identifier of storage location
	LocationID *uuid.UUID
	// Status of the package
	Status string
	// Identifier of processing workflow
	WorkflowID *string
	// Identifier of latest processing workflow run
	RunID *string
	// Identifier of AIP
	AipID *string
	// Creation datetime
	CreatedAt string
	// Start datetime
	StartedAt *string
	// Completion datetime
	CompletedAt *string
}

StoredPackage describes a package retrieved by the service.

type Location

type Location struct {
	// Name of location
	Name string
	// Description of the location
	Description *string
	// Data source of the location
	Source string
	// Purpose of the location
	Purpose string
	UUID    uuid.UUID
	Config  interface {
		// contains filtered or unexported methods
	}
	// Creation datetime
	CreatedAt string
}

Location is the result type of the storage service show_location method.

func NewLocation

func NewLocation(vres *storageviews.Location) *Location

NewLocation initializes result type Location from viewed result type Location.

type LocationCollection

type LocationCollection []*Location

LocationCollection is the result type of the storage service locations method.

func NewLocationCollection

func NewLocationCollection(vres storageviews.LocationCollection) LocationCollection

NewLocationCollection initializes result type LocationCollection from viewed result type LocationCollection.

type LocationNotFound

type LocationNotFound struct {
	// Message of error
	Message string
	UUID    uuid.UUID
}

Storage location not found.

func (*LocationNotFound) Error

func (e *LocationNotFound) Error() string

Error returns an error description.

func (*LocationNotFound) ErrorName deprecated

func (e *LocationNotFound) ErrorName() string

ErrorName returns "LocationNotFound".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*LocationNotFound) GoaErrorName

func (e *LocationNotFound) GoaErrorName() string

GoaErrorName returns "LocationNotFound".

type LocationPackagesPayload

type LocationPackagesPayload struct {
	// Identifier of location
	UUID       string
	OauthToken *string
}

LocationPackagesPayload is the payload type of the storage service location_packages method.

type LocationsPayload

type LocationsPayload struct {
	OauthToken *string
}

LocationsPayload is the payload type of the storage service locations method.

type MonitorPingEvent

type MonitorPingEvent struct {
	Message *string
}

type MovePayload

type MovePayload struct {
	// Identifier of AIP
	AipID string
	// Identifier of storage location
	LocationID uuid.UUID
	OauthToken *string
}

MovePayload is the payload type of the storage service move method.

type MoveStatusPayload

type MoveStatusPayload struct {
	// Identifier of AIP
	AipID      string
	OauthToken *string
}

MoveStatusPayload is the payload type of the storage service move_status method.

type MoveStatusResult

type MoveStatusResult struct {
	Done bool
}

MoveStatusResult is the result type of the storage service move_status method.

type Package

type Package struct {
	Name  string
	AipID uuid.UUID
	// Status of the package
	Status    string
	ObjectKey uuid.UUID
	// Identifier of storage location
	LocationID *uuid.UUID
	// Creation datetime
	CreatedAt string
}

Package is the result type of the storage service create method.

func NewPackage

func NewPackage(vres *storageviews.Package) *Package

NewPackage initializes result type Package from viewed result type Package.

type PackageCollection

type PackageCollection []*Package

PackageCollection is the result type of the storage service location_packages method.

func NewPackageCollection

func NewPackageCollection(vres storageviews.PackageCollection) PackageCollection

NewPackageCollection initializes result type PackageCollection from viewed result type PackageCollection.

type PackageCreatedEvent

type PackageCreatedEvent struct {
	// Identifier of package
	ID   uint
	Item *EnduroStoredPackage
}

type PackageLocationUpdatedEvent

type PackageLocationUpdatedEvent struct {
	// Identifier of package
	ID uint
	// Identifier of storage location
	LocationID uuid.UUID
}

type PackageNotFound

type PackageNotFound struct {
	// Message of error
	Message string
	// Identifier of missing package
	AipID uuid.UUID
}

Storage package not found.

func (*PackageNotFound) Error

func (e *PackageNotFound) Error() string

Error returns an error description.

func (*PackageNotFound) ErrorName deprecated

func (e *PackageNotFound) ErrorName() string

ErrorName returns "PackageNotFound".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*PackageNotFound) GoaErrorName

func (e *PackageNotFound) GoaErrorName() string

GoaErrorName returns "PackageNotFound".

type PackageStatusUpdatedEvent

type PackageStatusUpdatedEvent struct {
	// Identifier of package
	ID     uint
	Status string
}

type PackageUpdatedEvent

type PackageUpdatedEvent struct {
	// Identifier of package
	ID   uint
	Item *EnduroStoredPackage
}

type PreservationActionCreatedEvent

type PreservationActionCreatedEvent struct {
	// Identifier of preservation action
	ID   uint
	Item *EnduroPackagePreservationAction
}

type PreservationActionUpdatedEvent

type PreservationActionUpdatedEvent struct {
	// Identifier of preservation action
	ID   uint
	Item *EnduroPackagePreservationAction
}

type PreservationTaskCreatedEvent

type PreservationTaskCreatedEvent struct {
	// Identifier of preservation task
	ID   uint
	Item *EnduroPackagePreservationTask
}

type PreservationTaskUpdatedEvent

type PreservationTaskUpdatedEvent struct {
	// Identifier of preservation task
	ID   uint
	Item *EnduroPackagePreservationTask
}

type RejectPayload

type RejectPayload struct {
	// Identifier of AIP
	AipID      string
	OauthToken *string
}

RejectPayload is the payload type of the storage service reject method.

type S3Config

type S3Config struct {
	Bucket    string
	Region    string
	Endpoint  *string
	PathStyle *bool
	Profile   *string
	Key       *string
	Secret    *string
	Token     *string
}

func (*S3Config) ConvertToS3Config

func (t *S3Config) ConvertToS3Config() *types.S3Config

ConvertToS3Config creates an instance of S3Config initialized from t.

type SFTPConfig

type SFTPConfig struct {
	Address   string
	Username  string
	Password  string
	Directory string
}

func (*SFTPConfig) ConvertToSFTPConfig

func (t *SFTPConfig) ConvertToSFTPConfig() *types.SFTPConfig

ConvertToSFTPConfig creates an instance of SFTPConfig initialized from t.

type Service

type Service interface {
	// Start the submission of a package
	Submit(context.Context, *SubmitPayload) (res *SubmitResult, err error)
	// Create a new package
	Create(context.Context, *CreatePayload) (res *Package, err error)
	// Signal the storage service that an upload is complete
	Update(context.Context, *UpdatePayload) (err error)
	// Download package by AIPID
	Download(context.Context, *DownloadPayload) (res []byte, err error)
	// List locations
	Locations(context.Context, *LocationsPayload) (res LocationCollection, err error)
	// Add a storage location
	AddLocation(context.Context, *AddLocationPayload) (res *AddLocationResult, err error)
	// Move a package to a permanent storage location
	Move(context.Context, *MovePayload) (err error)
	// Retrieve the status of a permanent storage location move of the package
	MoveStatus(context.Context, *MoveStatusPayload) (res *MoveStatusResult, err error)
	// Reject a package
	Reject(context.Context, *RejectPayload) (err error)
	// Show package by AIPID
	Show(context.Context, *ShowPayload) (res *Package, err error)
	// Show location by UUID
	ShowLocation(context.Context, *ShowLocationPayload) (res *Location, err error)
	// List all the packages stored in the location with UUID
	LocationPackages(context.Context, *LocationPackagesPayload) (res PackageCollection, err error)
}

The storage service manages the storage of packages.

type ShowLocationPayload

type ShowLocationPayload struct {
	// Identifier of location
	UUID       string
	OauthToken *string
}

ShowLocationPayload is the payload type of the storage service show_location method.

type ShowPayload

type ShowPayload struct {
	// Identifier of AIP
	AipID      string
	OauthToken *string
}

ShowPayload is the payload type of the storage service show method.

type SubmitPayload

type SubmitPayload struct {
	// Identifier of AIP
	AipID      string
	Name       string
	OauthToken *string
}

SubmitPayload is the payload type of the storage service submit method.

type SubmitResult

type SubmitResult struct {
	URL string
}

SubmitResult is the result type of the storage service submit method.

type URLConfig

type URLConfig struct {
	URL string
}

func (*URLConfig) ConvertToURLConfig

func (t *URLConfig) ConvertToURLConfig() *types.URLConfig

ConvertToURLConfig creates an instance of URLConfig initialized from t.

type Unauthorized

type Unauthorized string

Invalid token

func (Unauthorized) Error

func (e Unauthorized) Error() string

Error returns an error description.

func (Unauthorized) ErrorName deprecated

func (e Unauthorized) ErrorName() string

ErrorName returns "unauthorized".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (Unauthorized) GoaErrorName

func (e Unauthorized) GoaErrorName() string

GoaErrorName returns "unauthorized".

type UpdatePayload

type UpdatePayload struct {
	// Identifier of AIP
	AipID      string
	OauthToken *string
}

UpdatePayload is the payload type of the storage service update method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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