func (bf *File) Match(username, password string) bool {
	bf.mutex.Lock()
	matcher, ok := bf.passwds[username]
	bf.mutex.Unlock()
	if ok && matcher.MatchesPassword(password) {
		return true
	}
	return false
}
Match checks the username and password combination to see if it represents
a valid account from the htpassword file.
package htpasswd
import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strings"
	"sync"
)
type EncodedPasswd interface {
	MatchesPassword(pw string) bool
}
type PasswdParser func(pw string) (EncodedPasswd, error)
type passwdTable map[string]EncodedPasswd
type BadLineHandler func(err error)
type File struct {
	filePath string
	mutex    sync.Mutex
	passwds  passwdTable
	parsers  []PasswdParser
}
var DefaultSystems = []PasswdParser{AcceptMd5, AcceptSha, AcceptBcrypt, AcceptSsha, AcceptCryptSha, AcceptPlain}
func New(filename string, parsers []PasswdParser, bad BadLineHandler) (*File, error) {
	bf := File{
		filePath: filename,
		parsers:  parsers,
	}
	if err := bf.Reload(bad); err != nil {
		return nil, err
	}
	return &bf, nil
}
func NewFromReader(r io.Reader, parsers []PasswdParser, bad BadLineHandler) (*File, error) {
	bf := File{
		parsers: parsers,
	}
	if err := bf.ReloadFromReader(r, bad); err != nil {
		return nil, err
	}
	return &bf, nil
}