github.com/mitchellh/packer@v1.3.2/builder/vmware/iso/artifact.go (about)

     1  package iso
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  const (
     8  	ArtifactConfFormat         = "artifact.conf.format"
     9  	ArtifactConfKeepRegistered = "artifact.conf.keep_registered"
    10  	ArtifactConfSkipExport     = "artifact.conf.skip_export"
    11  )
    12  
    13  // Artifact is the result of running the VMware builder, namely a set
    14  // of files associated with the resulting machine.
    15  type Artifact struct {
    16  	builderId string
    17  	id        string
    18  	dir       OutputDir
    19  	f         []string
    20  	config    map[string]string
    21  }
    22  
    23  func (a *Artifact) BuilderId() string {
    24  	return a.builderId
    25  }
    26  
    27  func (a *Artifact) Files() []string {
    28  	return a.f
    29  }
    30  
    31  func (a *Artifact) Id() string {
    32  	return a.id
    33  }
    34  
    35  func (a *Artifact) String() string {
    36  	return fmt.Sprintf("VM files in directory: %s", a.dir)
    37  }
    38  
    39  func (a *Artifact) State(name string) interface{} {
    40  	return a.config[name]
    41  }
    42  
    43  func (a *Artifact) Destroy() error {
    44  	return a.dir.RemoveAll()
    45  }