From 55d9cd21249a7d7493d16e7a0d327f7c3db8d30c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 21 May 2013 21:53:16 -0700 Subject: [PATCH] packer: First pass at Artifact interface --- packer/artifact.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packer/artifact.go diff --git a/packer/artifact.go b/packer/artifact.go new file mode 100644 index 000000000..7d349a3d5 --- /dev/null +++ b/packer/artifact.go @@ -0,0 +1,27 @@ +package packer + +// An Artifact is the result of a build, and is the metadata that documents +// what a builder actually created. The exact meaning of the contents is +// specific to each builder, but this interface is used to communicate back +// to the user the result of a build. +type Artifact interface { + // Returns the ID of the builder that was used to create this artifact. + // This is the internal ID of the builder and should be unique to every + // builder. This can be used to identify what the contents of the + // artifact actually are. + BuilderId() string + + // Returns the set of files that comprise this artifact. If an + // artifact is not made up of files, then this will be empty. + Files() []string + + // The ID for the artifact, if it has one. This is not guaranteed to + // be unique every run (like a GUID), but simply provide an identifier + // for the artifact that may be meaningful in some way. For example, + // for Amazon EC2, this value might be the AMI ID. + Id() string + + // Returns human-readable output that describes the artifact created. + // This is used for UI output. It can be multiple lines. + String() string +}