func Add(username, password, comment string, cost int, db *bolt.DB) error {
	entry, err := NewEntry(username, password, comment, cost)
	if err != nil {
		return err
	}
	data, err := json.Marshal(entry)
	if err != nil {
		return err
	}
	err = db.Update(func(tx *bolt.Tx) error {
		b := tx.Bucket([]byte("htpasswd"))
		return b.Put([]byte(username), data)
	})
	return err
}
Add adds a new entry to the specified boltdb database.
The supplied password is hashed using the bcrypt algorithm before storing
in the database.
package passwd
import (
	"encoding/json"
	"github.com/boltdb/bolt"
	"golang.org/x/crypto/bcrypt"
)
type Entries []Entry
type Entry struct {
	Comment      string
	PasswordHash []byte
	Username     string
}