github.com/vijayrajah/packer@v1.3.2/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  }
    13  
    14  func (a *Artifact) BuilderId() string {
    15  	return BuilderId
    16  }
    17  
    18  func (*Artifact) Id() string {
    19  	return ""
    20  }
    21  
    22  func (a *Artifact) Files() []string {
    23  	return []string{a.Path}
    24  }
    25  
    26  func (a *Artifact) String() string {
    27  	return fmt.Sprintf("compressed artifacts in: %s", a.Path)
    28  }
    29  
    30  func (*Artifact) State(name string) interface{} {
    31  	return nil
    32  }
    33  
    34  func (a *Artifact) Destroy() error {
    35  	return os.Remove(a.Path)
    36  }