parent
6a495a1449
commit
1d829ac257
|
@ -1,10 +0,0 @@
|
|||
package extractor
|
||||
|
||||
// Extractor is an interface for extracting data from browser data files
|
||||
type Extractor interface {
|
||||
Extract(masterKey []byte) error
|
||||
|
||||
Name() string
|
||||
|
||||
Len() int
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package extractor
|
||||
|
||||
import (
|
||||
"github.com/moond4rk/hackbrowserdata/types"
|
||||
)
|
||||
|
||||
var extractorRegistry = make(map[types.DataType]func() Extractor)
|
||||
|
||||
// RegisterExtractor is used to register the data source
|
||||
func RegisterExtractor(dataType types.DataType, factoryFunc func() Extractor) {
|
||||
extractorRegistry[dataType] = factoryFunc
|
||||
}
|
||||
|
||||
// CreateExtractor is used to create the data source
|
||||
func CreateExtractor(dataType types.DataType) Extractor {
|
||||
if factoryFunc, ok := extractorRegistry[dataType]; ok {
|
||||
return factoryFunc()
|
||||
}
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue