6a5f6938ef
* add bgzf compressor (it allows seek inside compressed file) * add optional format config variable to specify archive format * Update pgzip to get sse4 and avx optimizations. Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
38 lines
552 B
Go
38 lines
552 B
Go
package compress
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
const BuilderId = "packer.post-processor.compress"
|
|
|
|
type Artifact struct {
|
|
Path string
|
|
files []string
|
|
}
|
|
|
|
func (a *Artifact) BuilderId() string {
|
|
return BuilderId
|
|
}
|
|
|
|
func (*Artifact) Id() string {
|
|
return ""
|
|
}
|
|
|
|
func (a *Artifact) Files() []string {
|
|
return []string{a.Path}
|
|
}
|
|
|
|
func (a *Artifact) String() string {
|
|
return fmt.Sprintf("compressed artifacts in: %s", a.Path)
|
|
}
|
|
|
|
func (*Artifact) State(name string) interface{} {
|
|
return nil
|
|
}
|
|
|
|
func (a *Artifact) Destroy() error {
|
|
return os.Remove(a.Path)
|
|
}
|