func (b *BoltStore) Close() error {
	return b.db.Close()
}
Close closes the bolt database
package boltdb
import (
	"bytes"
	"encoding/json"
	"time"
	"github.com/boltdb/bolt"
	"github.com/mxschmitt/golang-url-shortener/internal/stores/shared"
	"github.com/pkg/errors"
)
var (
	shortedURLsBucket      = []byte("shorted")
	shortedIDsToUserBucket = []byte("shorted2Users")
)
type BoltStore struct {
	db *bolt.DB
}
func New(path string) (*BoltStore, error) {
	db, err := bolt.Open(path, 0644, &bolt.Options{Timeout: 1 * time.Second})
	if err != nil {
		return nil, errors.Wrap(err, "could not open bolt DB database")
	}
	err = db.Update(func(tx *bolt.Tx) error {
		if _, err := tx.CreateBucketIfNotExists(shortedURLsBucket); err != nil {
			return errors.Wrapf(err, "could not create %s bucket", shortedURLsBucket)
		}
		if _, err := tx.CreateBucketIfNotExists(shortedIDsToUserBucket); err != nil {
			return errors.Wrapf(err, "could not create %s bucket", shortedIDsToUserBucket)
		}
		return err
	})
	if err != nil {
		return nil, errors.Wrap(err, "could not create buckets")
	}
	return &BoltStore{
		db: db,
	}, nil
}