design

package
v0.41.6 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package design is the single source of truth of Enduro's API. It uses the Goa design language (https://goa.design) which is a Go DSL.

We describe multiple services (collection, pipeline) which map to resources in REST or service declarations in gRPC. Services define their own methods, errors, etc...

UUID attributes

Use AttributeUUID or TypedAttributeUUID to declare UUID attributes.

These attributes produce consistent example UUIDs.

Index

Constants

This section is empty.

Variables

View Source
var BatchHintsResult = Type("BatchHintsResult", func() {
	Attribute("completed_dirs", ArrayOf(String), "A list of known values of completedDir used by existing watchers.")
})
View Source
var BatchResult = Type("BatchResult", func() {
	Attribute("workflow_id", String)
	Attribute("run_id", String)
	Required("workflow_id", "run_id")
})
View Source
var BatchStatusResult = Type("BatchStatusResult", func() {
	Attribute("running", Boolean)
	Attribute("status", String)
	Attribute("workflow_id", String)
	Attribute("run_id", String)
	Required("running")
})
View Source
var BulkResult = Type("BulkResult", func() {
	Attribute("workflow_id", String)
	Attribute("run_id", String)
	Required("workflow_id", "run_id")
})
View Source
var BulkStatusResult = Type("BulkStatusResult", func() {
	Attribute("running", Boolean)
	Attribute("started_at", String, func() {
		Format(FormatDateTime)
	})
	Attribute("closed_at", String, func() {
		Format(FormatDateTime)
	})
	Attribute("status", String)
	Attribute("workflow_id", String)
	Attribute("run_id", String)
	Required("running")
})
View Source
var Collection = Type("Collection", func() {
	Description("Collection describes a collection to be stored.")
	Attribute("name", String, "Name of the collection")
	Attribute("status", String, "Status of the collection", func() {
		EnumCollectionStatus()
		Default("new")
	})
	AttributeUUID("workflow_id", "Identifier of processing workflow")
	AttributeUUID("run_id", "Identifier of latest processing workflow run")
	AttributeUUID("transfer_id", "Identifier of Archivematica tranfser")
	AttributeUUID("aip_id", "Identifier of Archivematica AIP")
	Attribute("original_id", String, "Identifier provided by the client")
	AttributeUUID("pipeline_id", "Identifier of Archivematica pipeline")
	Attribute("created_at", String, "Creation datetime", func() {
		Format(FormatDateTime)
	})
	Attribute("started_at", String, "Start datetime", func() {
		Format(FormatDateTime)
	})
	Attribute("completed_at", String, "Completion datetime", func() {
		Format(FormatDateTime)
	})
	Required("id", "status", "created_at")
})
View Source
var CollectionNotFound = Type("CollectionNotfound", func() {
	Description("Collection not found.")
	Attribute("message", String, "Message of error", func() {
		Meta("struct:error:name")
	})
	Attribute("id", UInt, "Identifier of missing collection")
	Required("message", "id")
})
View Source
var EnumCollectionStatus = func() {
	Enum("new", "in progress", "done", "error", "unknown", "queued", "pending", "abandoned")
}
View Source
var MonitorUpdate = ResultType("application/vnd.enduro.monitor-update", func() {
	Attribute("id", UInt, "Identifier of collection")
	Attribute("type", String, "Type of the event")
	Attribute("item", StoredCollection, "Collection")
	Required("id", "type")
})
View Source
var Pipeline = Type("Pipeline", func() {
	Description("Pipeline describes an Archivematica pipeline.")
	AttributeUUID("id", "Identifier of pipeline")
	Attribute("name", String, "Name of the pipeline")
	Attribute("capacity", Int64, "Maximum concurrent transfers")
	Attribute("current", Int64, "Current transfers")
	Required("name")
})
View Source
var PipelineNotFound = Type("PipelineNotFound", func() {
	Description("Pipeline not found.")
	Attribute("message", String, "Message of error", func() {
		Meta("struct:error:name")
	})
	Attribute("id", String, "Identifier of missing pipeline")
	Required("message", "id")
})
View Source
var StoredCollection = ResultType("application/vnd.enduro.stored-collection", func() {
	Description("StoredCollection describes a collection retrieved by the service.")
	Reference(Collection)
	Attributes(func() {
		Attribute("id", UInt, "Identifier of collection")
		Attribute("name")
		Attribute("status")
		Attribute("workflow_id")
		Attribute("run_id")
		Attribute("transfer_id")
		Attribute("aip_id")
		Attribute("original_id")
		Attribute("pipeline_id")
		Attribute("created_at")
		Attribute("started_at")
		Attribute("completed_at")
	})
	View("default", func() {
		Attribute("id")
		Attribute("name")
		Attribute("status")
		Attribute("workflow_id")
		Attribute("run_id")
		Attribute("transfer_id")
		Attribute("aip_id")
		Attribute("original_id")
		Attribute("pipeline_id")
		Attribute("created_at")
		Attribute("started_at")
		Attribute("completed_at")
	})
	Required("id", "status", "created_at")
})
View Source
var StoredPipeline = ResultType("application/vnd.enduro.stored-pipeline", func() {
	Description("StoredPipeline describes a pipeline retrieved by this service.")
	Reference(Pipeline)
	Attributes(func() {
		Attribute("id")
		Attribute("name")
		Attribute("capacity")
		Attribute("current")
		Attribute("status")
	})
	View("default", func() {
		Attribute("id")
		Attribute("name")
		Attribute("capacity")
		Attribute("current")
		Attribute("status")
	})
	Required("name")
})
View Source
var WorkflowHistoryEvent = ResultType("application/vnd.enduro.collection-workflow-history", func() {
	Description("WorkflowHistoryEvent describes a history event in Temporal.")
	Attributes(func() {
		Attribute("id", UInt, "Identifier of collection")
		Attribute("type", String, "Type of the event")
		Attribute("details", Any, "Contents of the event")
	})
})
View Source
var WorkflowStatus = ResultType("application/vnd.enduro.collection-workflow-status", func() {
	Description("WorkflowStatus describes the processing workflow status of a collection.")
	Attribute("status", String)
	Attribute("history", CollectionOf(WorkflowHistoryEvent))
})

Functions

func AttributeUUID added in v0.38.0

func AttributeUUID(name, desc string)

AttributeUUID describes a string typed field that must be a valid UUID. The desc is a short description of the field's purpose.

AttributeUUID's example value is a deterministic UUID.

func PaginatedCollectionOf added in v0.5.0

func PaginatedCollectionOf(v interface{}, adsl ...func()) interface{}

func TypedAttributeUUID added in v0.38.0

func TypedAttributeUUID(name, desc string)

TypedAttributeUUID describes a uuid.UUID typed field. The desc is a short description of the field's purpose.

TypedAttributeUUID's example value is a deterministic UUID.

Types

This section is empty.

Jump to

Keyboard shortcuts

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