package_

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 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 = "package"

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 = [10]string{"monitor_request", "monitor", "list", "show", "preservation_actions", "confirm", "reject", "move", "move_status", "upload"}

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 MakeInternalError

func MakeInternalError(err error) *goa.ServiceError

MakeInternalError builds a goa.ServiceError from an error.

func MakeInvalidMediaType

func MakeInvalidMediaType(err error) *goa.ServiceError

MakeInvalidMediaType builds a goa.ServiceError from an error.

func MakeInvalidMultipartRequest

func MakeInvalidMultipartRequest(err error) *goa.ServiceError

MakeInvalidMultipartRequest 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 NewConfirmEndpoint

func NewConfirmEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewConfirmEndpoint returns an endpoint function that calls the method "confirm" of service "package".

func NewListEndpoint

func NewListEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewListEndpoint returns an endpoint function that calls the method "list" of service "package".

func NewMonitorEndpoint

func NewMonitorEndpoint(s Service) goa.Endpoint

NewMonitorEndpoint returns an endpoint function that calls the method "monitor" of service "package".

func NewMonitorRequestEndpoint

func NewMonitorRequestEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewMonitorRequestEndpoint returns an endpoint function that calls the method "monitor_request" of service "package".

func NewMoveEndpoint

func NewMoveEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

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

func NewMoveStatusEndpoint

func NewMoveStatusEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

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

func NewPreservationActionsEndpoint

func NewPreservationActionsEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewPreservationActionsEndpoint returns an endpoint function that calls the method "preservation_actions" of service "package".

func NewRejectEndpoint

func NewRejectEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

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

func NewShowEndpoint

func NewShowEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

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

func NewUploadEndpoint

func NewUploadEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewUploadEndpoint returns an endpoint function that calls the method "upload" of service "package".

func NewViewedEnduroPackagePreservationActions

func NewViewedEnduroPackagePreservationActions(res *EnduroPackagePreservationActions, view string) *package_views.EnduroPackagePreservationActions

NewViewedEnduroPackagePreservationActions initializes viewed result type EnduroPackagePreservationActions from result type EnduroPackagePreservationActions using the given view.

func NewViewedEnduroPackages

func NewViewedEnduroPackages(res *EnduroPackages, view string) *package_views.EnduroPackages

NewViewedEnduroPackages initializes viewed result type EnduroPackages from result type EnduroPackages using the given view.

func NewViewedEnduroStoredPackage

func NewViewedEnduroStoredPackage(res *EnduroStoredPackage, view string) *package_views.EnduroStoredPackage

NewViewedEnduroStoredPackage initializes viewed result type EnduroStoredPackage from result type EnduroStoredPackage using the given view.

Types

type Auther

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

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

type Client

type Client struct {
	MonitorRequestEndpoint      goa.Endpoint
	MonitorEndpoint             goa.Endpoint
	ListEndpoint                goa.Endpoint
	ShowEndpoint                goa.Endpoint
	PreservationActionsEndpoint goa.Endpoint
	ConfirmEndpoint             goa.Endpoint
	RejectEndpoint              goa.Endpoint
	MoveEndpoint                goa.Endpoint
	MoveStatusEndpoint          goa.Endpoint
	UploadEndpoint              goa.Endpoint
}

Client is the "package" service client.

func NewClient

func NewClient(monitorRequest, monitor, list, show, preservationActions, confirm, reject, move, moveStatus, upload goa.Endpoint) *Client

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

func (*Client) Confirm

func (c *Client) Confirm(ctx context.Context, p *ConfirmPayload) (err error)

Confirm calls the "confirm" endpoint of the "package" service. Confirm may return the following errors:

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

func (*Client) List

func (c *Client) List(ctx context.Context, p *ListPayload) (res *EnduroPackages, err error)

List calls the "list" endpoint of the "package" service. List may return the following errors:

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

func (*Client) Monitor

func (c *Client) Monitor(ctx context.Context, p *MonitorPayload) (res MonitorClientStream, err error)

Monitor calls the "monitor" endpoint of the "package" service. Monitor may return the following errors:

  • "not_available" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • error: internal error

func (*Client) MonitorRequest

func (c *Client) MonitorRequest(ctx context.Context, p *MonitorRequestPayload) (res *MonitorRequestResult, err error)

MonitorRequest calls the "monitor_request" endpoint of the "package" service. MonitorRequest may return the following errors:

  • "not_available" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • error: internal error

func (*Client) Move

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

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

  • "not_found" (type *PackageNotFound): Package not found
  • "not_available" (type *goa.ServiceError)
  • "not_valid" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • 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 "package" service. MoveStatus may return the following errors:

  • "not_found" (type *PackageNotFound): Package not found
  • "failed_dependency" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • error: internal error

func (*Client) PreservationActions

func (c *Client) PreservationActions(ctx context.Context, p *PreservationActionsPayload) (res *EnduroPackagePreservationActions, err error)

PreservationActions calls the "preservation_actions" endpoint of the "package" service. PreservationActions may return the following errors:

  • "not_found" (type *PackageNotFound): Package not found
  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • error: internal error

func (*Client) Reject

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

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

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

func (*Client) Show

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

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

  • "not_found" (type *PackageNotFound): Package not found
  • "not_available" (type *goa.ServiceError)
  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • error: internal error

func (*Client) Upload

func (c *Client) Upload(ctx context.Context, p *UploadPayload, req io.ReadCloser) (err error)

Upload calls the "upload" endpoint of the "package" service. Upload may return the following errors:

  • "invalid_media_type" (type *goa.ServiceError): Error returned when the Content-Type header does not define a multipart request.
  • "invalid_multipart_request" (type *goa.ServiceError): Error returned when the request body is not a valid multipart content.
  • "internal_error" (type *goa.ServiceError): Fault while processing upload.
  • "unauthorized" (type Unauthorized)
  • "forbidden" (type Forbidden)
  • error: internal error

type ConfirmPayload

type ConfirmPayload struct {
	// Identifier of package to look up
	ID uint
	// Identifier of storage location
	LocationID uuid.UUID
	Token      *string
}

ConfirmPayload is the payload type of the package service confirm method.

type Endpoints

type Endpoints struct {
	MonitorRequest      goa.Endpoint
	Monitor             goa.Endpoint
	List                goa.Endpoint
	Show                goa.Endpoint
	PreservationActions goa.Endpoint
	Confirm             goa.Endpoint
	Reject              goa.Endpoint
	Move                goa.Endpoint
	MoveStatus          goa.Endpoint
	Upload              goa.Endpoint
}

Endpoints wraps the "package" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

Use applies the given middleware to all the "package" 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 EnduroPackagePreservationActionCollection

type EnduroPackagePreservationActionCollection []*EnduroPackagePreservationAction

type EnduroPackagePreservationActions

type EnduroPackagePreservationActions struct {
	Actions EnduroPackagePreservationActionCollection
}

EnduroPackagePreservationActions is the result type of the package service preservation_actions method.

func NewEnduroPackagePreservationActions

func NewEnduroPackagePreservationActions(vres *package_views.EnduroPackagePreservationActions) *EnduroPackagePreservationActions

NewEnduroPackagePreservationActions initializes result type EnduroPackagePreservationActions from viewed result type EnduroPackagePreservationActions.

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 EnduroPackages

type EnduroPackages struct {
	Items EnduroStoredPackageCollection
	Page  *EnduroPage
}

EnduroPackages is the result type of the package service list method.

func NewEnduroPackages

func NewEnduroPackages(vres *package_views.EnduroPackages) *EnduroPackages

NewEnduroPackages initializes result type EnduroPackages from viewed result type EnduroPackages.

type EnduroPage

type EnduroPage struct {
	// Maximum items per page
	Limit int
	// Offset from first result to start of page
	Offset int
	// Total result count before paging
	Total int
}

Page represents a subset of search results.

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
}

EnduroStoredPackage is the result type of the package service show method.

func NewEnduroStoredPackage

func NewEnduroStoredPackage(vres *package_views.EnduroStoredPackage) *EnduroStoredPackage

NewEnduroStoredPackage initializes result type EnduroStoredPackage from viewed result type EnduroStoredPackage.

type EnduroStoredPackageCollection

type EnduroStoredPackageCollection []*EnduroStoredPackage

type Forbidden

type Forbidden string

Forbidden

func (Forbidden) Error

func (e Forbidden) Error() string

Error returns an error description.

func (Forbidden) ErrorName deprecated

func (e Forbidden) ErrorName() string

ErrorName returns "forbidden".

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

func (Forbidden) GoaErrorName

func (e Forbidden) GoaErrorName() string

GoaErrorName returns "forbidden".

type ListPayload

type ListPayload struct {
	Name *string
	// Identifier of AIP
	AipID               *string
	EarliestCreatedTime *string
	LatestCreatedTime   *string
	// Identifier of storage location
	LocationID *string
	Status     *string
	// Limit number of results to return
	Limit *int
	// Offset from the beginning of the found set
	Offset *int
	Token  *string
}

ListPayload is the payload type of the package service list method.

type MonitorClientStream

type MonitorClientStream interface {
	// Recv reads instances of "MonitorEvent" from the stream.
	Recv() (*MonitorEvent, error)
}

MonitorClientStream is the interface a "monitor" endpoint client stream must satisfy.

type MonitorEndpointInput

type MonitorEndpointInput struct {
	// Payload is the method payload.
	Payload *MonitorPayload
	// Stream is the server stream used by the "monitor" method to send data.
	Stream MonitorServerStream
}

MonitorEndpointInput holds both the payload and the server stream of the "monitor" method.

type MonitorEvent

type MonitorEvent struct {
	Event interface {
		// contains filtered or unexported methods
	}
}

MonitorEvent is the result type of the package service monitor method.

type MonitorPayload

type MonitorPayload struct {
	Ticket *string
}

MonitorPayload is the payload type of the package service monitor method.

type MonitorPingEvent

type MonitorPingEvent struct {
	Message *string
}

type MonitorRequestPayload

type MonitorRequestPayload struct {
	Token *string
}

MonitorRequestPayload is the payload type of the package service monitor_request method.

type MonitorRequestResult

type MonitorRequestResult struct {
	Ticket *string
}

MonitorRequestResult is the result type of the package service monitor_request method.

type MonitorServerStream

type MonitorServerStream interface {
	// Send streams instances of "MonitorEvent".
	Send(*MonitorEvent) error
	// Close closes the stream.
	Close() error
}

MonitorServerStream is the interface a "monitor" endpoint server stream must satisfy.

type MovePayload

type MovePayload struct {
	// Identifier of package to move
	ID uint
	// Identifier of storage location
	LocationID uuid.UUID
	Token      *string
}

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

type MoveStatusPayload

type MoveStatusPayload struct {
	// Identifier of package to move
	ID    uint
	Token *string
}

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

type MoveStatusResult

type MoveStatusResult struct {
	Done bool
}

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

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
	ID uint
}

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 PreservationActionsPayload

type PreservationActionsPayload struct {
	// Identifier of package to look up
	ID    uint
	Token *string
}

PreservationActionsPayload is the payload type of the package service preservation_actions method.

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 package to look up
	ID    uint
	Token *string
}

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

type Service

type Service interface {
	// Request access to the /monitor WebSocket
	MonitorRequest(context.Context, *MonitorRequestPayload) (res *MonitorRequestResult, err error)
	// Obtain access to the /monitor WebSocket
	Monitor(context.Context, *MonitorPayload, MonitorServerStream) (err error)
	// List all stored packages
	List(context.Context, *ListPayload) (res *EnduroPackages, err error)
	// Show package by ID
	Show(context.Context, *ShowPayload) (res *EnduroStoredPackage, err error)
	// List all preservation actions by ID
	PreservationActions(context.Context, *PreservationActionsPayload) (res *EnduroPackagePreservationActions, err error)
	// Signal the package has been reviewed and accepted
	Confirm(context.Context, *ConfirmPayload) (err error)
	// Signal the package has been reviewed and rejected
	Reject(context.Context, *RejectPayload) (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)
	// Upload a package to trigger an ingest workflow
	Upload(context.Context, *UploadPayload, io.ReadCloser) (err error)
}

The package service manages packages being transferred to a3m.

type ShowPayload

type ShowPayload struct {
	// Identifier of package to show
	ID    uint
	Token *string
}

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

type Unauthorized

type Unauthorized string

Unauthorized

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 UploadPayload

type UploadPayload struct {
	// Content-Type header, must define value for multipart boundary.
	ContentType string
	Token       *string
}

UploadPayload is the payload type of the package service upload method.

type UploadRequestData

type UploadRequestData struct {
	// Payload is the method payload.
	Payload *UploadPayload
	// Body streams the HTTP request body.
	Body io.ReadCloser
}

UploadRequestData holds both the payload and the HTTP request body reader of the "upload" method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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