mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-02 03:28:25 +08:00
badgerds: use go-ds-badger from gx
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
@ -469,6 +469,12 @@
|
|||||||
"hash": "QmWRCn8vruNAzHx8i6SAXinuheRitKEGu8c7m26stKvsYx",
|
"hash": "QmWRCn8vruNAzHx8i6SAXinuheRitKEGu8c7m26stKvsYx",
|
||||||
"name": "go-testutil",
|
"name": "go-testutil",
|
||||||
"version": "1.1.11"
|
"version": "1.1.11"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"author": "magik6k",
|
||||||
|
"hash": "QmTC7BY2viSAbPbGte6NyMZJCC2xheaRBYKEn4BuzTxe7W",
|
||||||
|
"name": "go-ds-badger",
|
||||||
|
"version": "0.1.10"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"gxVersion": "0.10.0",
|
"gxVersion": "0.10.0",
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
@ -15,10 +16,9 @@ import (
|
|||||||
ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore"
|
ds "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore"
|
||||||
mount "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/syncmount"
|
mount "gx/ipfs/QmVSase1JP7cq9QkPT46oNwdp9pT6kBkG3oqS14y3QcZjG/go-datastore/syncmount"
|
||||||
|
|
||||||
badgerds "github.com/ipfs/go-ds-badger"
|
|
||||||
levelds "gx/ipfs/QmPdvXuXWAR6gtxxqZw42RtSADMwz4ijVmYHGS542b6cMz/go-ds-leveldb"
|
levelds "gx/ipfs/QmPdvXuXWAR6gtxxqZw42RtSADMwz4ijVmYHGS542b6cMz/go-ds-leveldb"
|
||||||
|
badgerds "gx/ipfs/QmTC7BY2viSAbPbGte6NyMZJCC2xheaRBYKEn4BuzTxe7W/go-ds-badger"
|
||||||
ldbopts "gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYvPRw1g/goleveldb/leveldb/opt"
|
ldbopts "gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYvPRw1g/goleveldb/leveldb/opt"
|
||||||
"os"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ConfigFromMap creates a new datastore config from a map
|
// ConfigFromMap creates a new datastore config from a map
|
||||||
@ -59,13 +59,13 @@ var datastores map[string]ConfigFromMap
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
datastores = map[string]ConfigFromMap{
|
datastores = map[string]ConfigFromMap{
|
||||||
"mount": MountDatastoreConfig,
|
"mount": MountDatastoreConfig,
|
||||||
"flatfs": FlatfsDatastoreConfig,
|
"flatfs": FlatfsDatastoreConfig,
|
||||||
"levelds": LeveldsDatastoreConfig,
|
"levelds": LeveldsDatastoreConfig,
|
||||||
"badger": BadgerdsDatastoreConfig,
|
"badgerds": BadgerdsDatastoreConfig,
|
||||||
"mem": MemDatastoreConfig,
|
"mem": MemDatastoreConfig,
|
||||||
"log": LogDatastoreConfig,
|
"log": LogDatastoreConfig,
|
||||||
"measure": MeasureDatastoreConfig,
|
"measure": MeasureDatastoreConfig,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,7 +340,7 @@ func (c measureDatastoreConfig) Create(path string) (repo.Datastore, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type badgerdsDatastoreConfig struct {
|
type badgerdsDatastoreConfig struct {
|
||||||
path string
|
path string
|
||||||
}
|
}
|
||||||
|
|
||||||
func BadgerdsDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error) {
|
func BadgerdsDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error) {
|
||||||
|
Reference in New Issue
Block a user