You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
578 B
34 lines
578 B
1 year ago
|
package hackbrowserdata
|
||
|
|
||
|
import (
|
||
|
"path/filepath"
|
||
|
)
|
||
|
|
||
|
type BrowserOption func(browserOptionsSetter)
|
||
|
|
||
|
type browserOptionsSetter interface {
|
||
|
setProfilePath(string)
|
||
|
|
||
|
setEnableAllUsers(bool)
|
||
|
|
||
|
setStorageName(string)
|
||
|
}
|
||
|
|
||
|
func WithProfilePath(p string) BrowserOption {
|
||
|
return func(b browserOptionsSetter) {
|
||
|
b.setProfilePath(filepath.Clean(p))
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func WithEnableAllUsers(e bool) BrowserOption {
|
||
|
return func(b browserOptionsSetter) {
|
||
|
b.setEnableAllUsers(e)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func WithStorageName(s string) BrowserOption {
|
||
|
return func(b browserOptionsSetter) {
|
||
|
b.setStorageName(s)
|
||
|
}
|
||
|
}
|