Restruture
This commit is contained in:
parent
eff904a86d
commit
d0e31034a5
@ -1,4 +1,4 @@
|
|||||||
package database
|
package bitcask
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
@ -11,7 +11,6 @@ import (
|
|||||||
// Casket is an implmentation of a Filer and a Searcher using Bitcask.
|
// Casket is an implmentation of a Filer and a Searcher using Bitcask.
|
||||||
type Casket struct {
|
type Casket struct {
|
||||||
*bitcask.Bitcask
|
*bitcask.Bitcask
|
||||||
Searcher
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DB is a mapper of a Filer and Searcher implementation using Bitcask.
|
// DB is a mapper of a Filer and Searcher implementation using Bitcask.
|
||||||
@ -62,7 +61,7 @@ func (db *DB) With(bucketName string) Casket {
|
|||||||
defer db.mu.RUnlock()
|
defer db.mu.RUnlock()
|
||||||
d, ok := db.store[bucketName]
|
d, ok := db.store[bucketName]
|
||||||
if !ok {
|
if !ok {
|
||||||
return Casket{Bitcask: nil, Searcher: nil}
|
return Casket{Bitcask: nil}
|
||||||
}
|
}
|
||||||
return d
|
return d
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package database
|
package bitcask
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
@ -1,4 +1,4 @@
|
|||||||
package database
|
package bitcask
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
@ -1,4 +1,4 @@
|
|||||||
package database
|
package bitcask
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
@ -1,4 +1,4 @@
|
|||||||
package database
|
package bitcask
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
Loading…
Reference in New Issue
Block a user