Files
sjy01-preprocessing/extract/process.go
2024-05-16 17:33:33 +08:00

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
}