func New(options Options) (*BadgerStore, error) {
	options.BadgerOptions.Dir = options.Path + "/badger"
	options.BadgerOptions.ValueDir = options.Path + "/badger"
	db, err := badger.Open(*options.BadgerOptions)
	if err != nil {
		log.Fatal(err)
	}
	store := &BadgerStore{
		db:   db,
		path: options.Path,
	}
	return store, nil
}
New uses the supplied options to open a badger db and prepare it for use as a raft backend.
package raftbadgerdb
import (
	"bytes"
	"encoding/binary"
	"encoding/gob"
	"errors"
	"fmt"
	"log"
	"math"
	"strconv"
	"github.com/dgraph-io/badger"
	"github.com/hashicorp/raft"
)
var (
	dbLogsPrefix = []byte("logs")
	dbConfPrefix = []byte("conf")
	ErrKeyNotFound = errors.New("not found")
)
type BadgerStore struct {
	db   *badger.DB
	path string
}
type Options struct {
	BadgerOptions *badger.Options
	Path string
}
func NewBadgerStore(path string) (*BadgerStore, error) {
	opts := Options{Path: path, BadgerOptions: &badger.DefaultOptions}
	return New(opts)
}