Back to godoc.org

Package design

v0.30.2
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/artefactual-labs/enduro

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...

Index

Variables

var BatchResult = Type("BatchResult", func() {
	Attribute("workflow_id", String)
	Attribute("run_id", String)
	Required("workflow_id", "run_id")
})
var BatchStatusResult = Type("BatchStatusResult", func() {
	Attribute("running", Boolean)
	Attribute("status", String)
	Attribute("workflow_id", String)
	Attribute("run_id", String)
	Required("running")
})
var BulkResult = Type("BulkResult", func() {
	Attribute("workflow_id", String)
	Attribute("run_id", String)
	Required("workflow_id", "run_id")
})
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")
})
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")
	})
	Attribute("workflow_id", String, "Identifier of processing workflow", func() {
		Format(FormatUUID)
	})
	Attribute("run_id", String, "Identifier of latest processing workflow run", func() {
		Format(FormatUUID)
	})
	Attribute("transfer_id", String, "Identifier of Archivematica transfer", func() {
		Format(FormatUUID)
	})
	Attribute("aip_id", String, "Identifier of Archivematica AIP", func() {
		Format(FormatUUID)
	})
	Attribute("original_id", String, "Identifier provided by the client")
	Attribute("pipeline_id", String, "Identifier of Archivematica pipeline", func() {
		Format(FormatUUID)
	})
	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")
})
var EnumCollectionStatus = func() {
	Enum("new", "in progress", "done", "error", "unknown", "queued", "pending", "abandoned")
}
var NotFound = Type("NotFound", func() {
	Description("NotFound is the type returned when attempting to operate with a collection that does not exist.")
	Attribute("message", String, "Message of error", func() {
		Meta("struct:error:name")
	})
	Attribute("id", UInt, "Identifier of missing collection")
	Required("message", "id")
})
var Pipeline = Type("Pipeline", func() {
	Description("Pipeline describes an Archivematica pipeline.")
	Attribute("id", String, "Name of the collection", func() { Format(FormatUUID) })
	Attribute("name", String, "Name of the collection")
	Required("name")
})
var StoredCollection = ResultType("application/vnd.enduro.stored-collection", func() {
	Description("StoredPipeline 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")
})
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")
	})
	View("default", func() {
		Attribute("id")
		Attribute("name")
	})
	Required("name")
})
var WorkflowHistoryEvent = ResultType("application/vnd.enduro.collection-workflow-history", func() {
	Description("WorkflowHistoryEvent describes a history event in Cadence.")
	Attributes(func() {
		Attribute("id", UInt, "Identifier of collection")
		Attribute("type", String, "Type of the event")
		Attribute("details", Any, "Contents of the event")
	})
})
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))
})

func PaginatedCollectionOf

func PaginatedCollectionOf(v interface{}, adsl ...func()) interface{}
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier