Пример #1
0
func saveQuimbyUser(db *bolt.DB) {
	u := quimby.NewUser(
		"quimby",
		quimby.UserDB(db),
		quimby.UserPassword(randString(16)),
		quimby.UserPermission("write"),
	)
	if _, err := u.Save(); err != nil {
		log.Fatal(err)
	}
}
Пример #2
0
func doUser(f userNeeder) {
	db := getDB()
	u := quimby.NewUser(
		*userName,
		quimby.UserDB(db),
		quimby.UserPassword(*userPW),
		quimby.UserPermission(*userPerm),
	)
	f(u)
	defer db.Close()
}