github.phpd.cn/hashicorp/packer@v1.3.2/builder/lxc/artifact.go (about) 1 package lxc 2 3 import ( 4 "fmt" 5 "os" 6 ) 7 8 type Artifact struct { 9 dir string 10 f []string 11 } 12 13 func (*Artifact) BuilderId() string { 14 return BuilderId 15 } 16 17 func (a *Artifact) Files() []string { 18 return a.f 19 } 20 21 func (*Artifact) Id() string { 22 return "VM" 23 } 24 25 func (a *Artifact) String() string { 26 return fmt.Sprintf("VM files in directory: %s", a.dir) 27 } 28 29 func (a *Artifact) State(name string) interface{} { 30 return nil 31 } 32 33 func (a *Artifact) Destroy() error { 34 return os.RemoveAll(a.dir) 35 }