func (db BoltDB) DeleteBucket(bucket string) error {
	err := db.Update(func(tx *bolt.Tx) error {
		return tx.DeleteBucket([]byte(bucket))
	})
	return err
}
Delete a bucket
package repository
import (
	"errors"
	"log"
	"github.com/boltdb/bolt"
)
var (
	ErrorBucketNotExists = errors.New("Bucket Not Exists")
)
type BoltDB struct {
	*bolt.DB
}
func Open(name string) *BoltDB {
	db, err := bolt.Open(name, 0600, nil)
	if err != nil {
		log.Fatalln(err)
	}
	return &BoltDB{db}
}
func (db BoltDB) Find(key, bucket string) (string, error) {
	var value string
	err := db.View(func(tx *bolt.Tx) error {
		b := tx.Bucket([]byte(bucket))
		if b == nil {
			return ErrorBucketNotExists
		}
		val := b.Get([]byte(key))
		value = string(val)
		return nil
	})
	return value, err
}
func (db BoltDB) Delete(key, bucket string) error {
	err := db.Update(func(tx *bolt.Tx) error {
		b := tx.Bucket([]byte(bucket))
		if b == nil {
			return ErrorBucketNotExists
		}
		return b.Delete([]byte(key))
	})
	return err
}