func NewSimpleChecker(pwdlen int) (*SimpleChecker, error) { var err error c := SimpleChecker{} c.emailregex, err = regexp.Compile(`^[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,4}$`) c.pwdlen = pwdlen return &c, errs.Err(err, "cannot complie regex") }
func Open(name, path string) (Configurator, error) { config, ok := configurators[name] if !ok { return nil, ErrConfiguratorNotFound } err := config.Load(path) if err != nil { return nil, errs.Err(err, "confg: cannot Open") } return config, nil }