func (p Provider) Batch(entries []*goukv.Entry) error {
	batch := new(leveldb.Batch)
	for _, entry := range entries {
		if entry.Value == nil {
			batch.Delete(entry.Key)
		} else {
			batch.Put(entry.Key, EntryToValue(entry).Bytes())
		}
	}
	return p.db.Write(batch, &opt.WriteOptions{
		Sync: p.syncWrites,
	})
}
Batch perform multi put operation, empty value means *delete*
package leveldb
import (
	"time"
	"github.com/alash3al/goukv"
	"github.com/syndtr/goleveldb/leveldb"
	"github.com/syndtr/goleveldb/leveldb/filter"
	"github.com/syndtr/goleveldb/leveldb/iterator"
	"github.com/syndtr/goleveldb/leveldb/opt"
	"github.com/syndtr/goleveldb/leveldb/util"
)
type Provider struct {
	db         *leveldb.DB
	syncWrites bool
}
func (p Provider) Open(dsn *goukv.DSN) (goukv.Provider, error) {
	path := dsn.Hostname() + dsn.Path()
	syncWrites := dsn.GetBool("sync_writes")
	o := &opt.Options{
		Filter:         filter.NewBloomFilter(10),
		ErrorIfMissing: false,
		Compression:    9,
		NoSync:         syncWrites,
	}
	db, err := leveldb.OpenFile(path, o)
	if err != nil {
		return nil, err
	}
	return &Provider{
		db:         db,
		syncWrites: syncWrites,
	}, nil
}
func (p Provider) Put(e *goukv.Entry) error {
	return p.db.Put(e.Key, EntryToValue(e).Bytes(), &opt.WriteOptions{
		Sync: p.syncWrites,
	})
}