24 lines
353 B
Go
24 lines
353 B
Go
package extract
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
type Extractor struct {
|
|
params *Params
|
|
Clean bool
|
|
}
|
|
|
|
func NewExtractor(params *Params) *Extractor {
|
|
os.MkdirAll(params.OutputPath, 0755)
|
|
os.MkdirAll(params.TempPath, 0755)
|
|
return &Extractor{params: params}
|
|
}
|
|
|
|
func (e *Extractor) Cleanup() error {
|
|
if e.Clean {
|
|
os.RemoveAll(e.params.TempPath)
|
|
}
|
|
return nil
|
|
}
|