In order that something consuming an artifact can have access to extra builder specific data add the State method which allows the caller to ask for arbitary values by name.
38 lines
629 B
Go
38 lines
629 B
Go
package iso
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// Artifact is the result of running the VMware builder, namely a set
|
|
// of files associated with the resulting machine.
|
|
type Artifact struct {
|
|
builderId string
|
|
dir OutputDir
|
|
f []string
|
|
}
|
|
|
|
func (a *Artifact) BuilderId() string {
|
|
return a.builderId
|
|
}
|
|
|
|
func (a *Artifact) Files() []string {
|
|
return a.f
|
|
}
|
|
|
|
func (*Artifact) Id() string {
|
|
return "VM"
|
|
}
|
|
|
|
func (a *Artifact) String() string {
|
|
return fmt.Sprintf("VM files in directory: %s", a.dir)
|
|
}
|
|
|
|
func (a *Artifact) State(name string) interface{} {
|
|
return nil
|
|
}
|
|
|
|
func (a *Artifact) Destroy() error {
|
|
return a.dir.RemoveAll()
|
|
}
|