From 368ccab8e87c05bf87f03a9120c9c2cbf0f6e3a5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 10 May 2013 16:59:28 -0700 Subject: [PATCH] packer: Put Builder definition into its own file --- packer/build.go | 14 -------------- packer/builder.go | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 packer/builder.go diff --git a/packer/build.go b/packer/build.go index 329958f3d..159b765dd 100644 --- a/packer/build.go +++ b/packer/build.go @@ -22,20 +22,6 @@ type coreBuild struct { prepareCalled bool } -// Implementers of Builder are responsible for actually building images -// on some platform given some configuration. -// -// Prepare is responsible for reading in some configuration, in the raw form -// of map[string]interface{}, and storing that state for use later. Any setup -// should be done in this method. Note that NO side effects should really take -// place in prepare. It is meant as a state setup step only. -// -// Run is where the actual build should take place. It takes a Build and a Ui. -type Builder interface { - Prepare(config interface{}) error - Run(build Build, ui Ui) -} - // Returns the name of the build. func (b *coreBuild) Name() string { return b.name diff --git a/packer/builder.go b/packer/builder.go new file mode 100644 index 000000000..7ff1bb95b --- /dev/null +++ b/packer/builder.go @@ -0,0 +1,16 @@ +package packer + +// Implementers of Builder are responsible for actually building images +// on some platform given some configuration. +// +// Prepare is responsible for reading in some configuration, in the raw form +// of map[string]interface{}, and storing that state for use later. Any setup +// should be done in this method. Note that NO side effects should really take +// place in prepare. It is meant as a state setup step only. +// +// Run is where the actual build should take place. It takes a Build and a Ui. +type Builder interface { + Prepare(config interface{}) error + Run(build Build, ui Ui) +} +