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.
HackBrowserData/options.go

34 lines
581 B

package hackbrowserdata
import (
"path/filepath"
)
type BrowserOption func(browserOptionsSetter)
type browserOptionsSetter interface {
setProfilePath(string)
setDisableAllUsers(bool)
setStorageName(string)
}
func WithProfilePath(p string) BrowserOption {
return func(b browserOptionsSetter) {
b.setProfilePath(filepath.Clean(p))
}
}
func WithDisableAllUsers(e bool) BrowserOption {
return func(b browserOptionsSetter) {
b.setDisableAllUsers(e)
}
}
func WithStorageName(s string) BrowserOption {
return func(b browserOptionsSetter) {
b.setStorageName(s)
}
}