2013-06-18 13:54:22 -04:00
|
|
|
package packer
|
|
|
|
|
2013-06-19 01:45:53 -04:00
|
|
|
type TestArtifact struct {
|
|
|
|
id string
|
2014-01-19 13:32:44 -05:00
|
|
|
state map[string]interface{}
|
2013-06-19 01:45:53 -04:00
|
|
|
destroyCalled bool
|
|
|
|
}
|
2013-06-18 13:54:22 -04:00
|
|
|
|
|
|
|
func (*TestArtifact) BuilderId() string {
|
|
|
|
return "bid"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*TestArtifact) Files() []string {
|
|
|
|
return []string{"a", "b"}
|
|
|
|
}
|
|
|
|
|
2013-06-19 01:45:53 -04:00
|
|
|
func (a *TestArtifact) Id() string {
|
|
|
|
id := a.id
|
|
|
|
if id == "" {
|
|
|
|
id = "id"
|
|
|
|
}
|
|
|
|
|
|
|
|
return id
|
2013-06-18 13:54:22 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (*TestArtifact) String() string {
|
|
|
|
return "string"
|
|
|
|
}
|
2013-06-18 19:01:14 -04:00
|
|
|
|
2014-01-19 13:32:44 -05:00
|
|
|
func (a *TestArtifact) State(name string) interface{} {
|
|
|
|
value, _ := a.state[name]
|
|
|
|
return value
|
|
|
|
}
|
|
|
|
|
2013-06-19 01:45:53 -04:00
|
|
|
func (a *TestArtifact) Destroy() error {
|
|
|
|
a.destroyCalled = true
|
2013-06-18 19:01:14 -04:00
|
|
|
return nil
|
|
|
|
}
|