github.com/askholme/packer@v0.7.2-0.20140924152349-70d9566a6852/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  	Provider string
    13  }
    14  
    15  func NewArtifact(provider, path string) *Artifact {
    16  	return &Artifact{
    17  		Path:     path,
    18  		Provider: provider,
    19  	}
    20  }
    21  
    22  func (*Artifact) BuilderId() string {
    23  	return BuilderId
    24  }
    25  
    26  func (self *Artifact) Id() string {
    27  	return ""
    28  }
    29  
    30  func (self *Artifact) Files() []string {
    31  	return []string{self.Path}
    32  }
    33  
    34  func (self *Artifact) String() string {
    35  	return fmt.Sprintf("'%s' compressing: %s", self.Provider, self.Path)
    36  }
    37  
    38  func (self *Artifact) Destroy() error {
    39  	return os.Remove(self.Path)
    40  }