//Datfiles returns all datfile names in recentlist.
func Datfiles() []string {
	var datfile []string
	err := db.DB.View(func(tx *bolt.Tx) error {
		var err error
		datfile, err = db.GetPrefixs(tx, "recent")
		return err
	})
	if err != nil {
		log.Print(err)
	}
	return datfile
}
Example #2
0
//Len returns # of Caches
func Len() int {
	var r []string
	err := db.DB.View(func(tx *bolt.Tx) error {
		var err error
		r, err = db.GetPrefixs(tx, "record")
		return err
	})
	if err != nil {
		log.Print(err)
		return 0
	}

	return len(r)
}