github.com/marksheahan/packer@v0.10.2-0.20160613200515-1acb2d6645a0/post-processor/compress/artifact.go (about)

     1  package compress
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  )
     7  
     8  const BuilderId = "packer.post-processor.compress"
     9  
    10  type Artifact struct {
    11  	Path  string
    12  	files []string
    13  }
    14  
    15  func (a *Artifact) BuilderId() string {
    16  	return BuilderId
    17  }
    18  
    19  func (*Artifact) Id() string {
    20  	return ""
    21  }
    22  
    23  func (a *Artifact) Files() []string {
    24  	return []string{a.Path}
    25  }
    26  
    27  func (a *Artifact) String() string {
    28  	return fmt.Sprintf("compressed artifacts in: %s", a.Path)
    29  }
    30  
    31  func (*Artifact) State(name string) interface{} {
    32  	return nil
    33  }
    34  
    35  func (a *Artifact) Destroy() error {
    36  	return os.Remove(a.Path)
    37  }