This commit is contained in:
nuknal
2024-05-16 17:33:33 +08:00
parent 7e4efd83a1
commit 58acd444d6
10 changed files with 175 additions and 85 deletions

View File

@@ -6,6 +6,7 @@ import (
type Extractor struct {
params *Params
Clean bool
}
func NewExtractor(params *Params) *Extractor {
@@ -13,3 +14,10 @@ func NewExtractor(params *Params) *Extractor {
os.MkdirAll(params.TempPath, 0755)
return &Extractor{params: params}
}
func (e *Extractor) Cleanup() error {
if e.Clean {
os.RemoveAll(e.params.TempPath)
}
return nil
}