"errors"
"io/ioutil"
"log"
+ "os"
"strings"
)
+var passwords map[string]Auther = make(map[string]Auther)
+
+type Auther interface {
+ Auth(password string) bool
+}
+
func strToAuther(verifier string) (string, Auther, error) {
st := strings.SplitN(verifier, "$", 3)
if len(st) != 3 || st[0] != "" {
func refreshPasswd() {
passwd, err := ioutil.ReadFile(*passwdPath)
+ if os.IsNotExist(err) {
+ return
+ }
if err != nil {
log.Fatal(err)
}