github.com/rothwerx/packer@v0.9.0/packer/artifact_test.go (about) 1 package packer 2 3 type TestArtifact struct { 4 id string 5 state map[string]interface{} 6 destroyCalled bool 7 } 8 9 func (*TestArtifact) BuilderId() string { 10 return "bid" 11 } 12 13 func (*TestArtifact) Files() []string { 14 return []string{"a", "b"} 15 } 16 17 func (a *TestArtifact) Id() string { 18 id := a.id 19 if id == "" { 20 id = "id" 21 } 22 23 return id 24 } 25 26 func (*TestArtifact) String() string { 27 return "string" 28 } 29 30 func (a *TestArtifact) State(name string) interface{} { 31 value, _ := a.state[name] 32 return value 33 } 34 35 func (a *TestArtifact) Destroy() error { 36 a.destroyCalled = true 37 return nil 38 }