Implement searcher and add test cases
This commit is contained in:
parent
440cabf1a8
commit
49f2432657
42
bitcask.go
42
bitcask.go
@ -8,16 +8,23 @@ import (
|
||||
"git.tcp.direct/Mirrors/bitcask-mirror"
|
||||
)
|
||||
|
||||
// DB is an implementation of Filer using bitcask.
|
||||
// Casket is an implmentation of a Filer and a Searcher using Bitcask.
|
||||
type Casket struct {
|
||||
*bitcask.Bitcask
|
||||
Searcher
|
||||
}
|
||||
|
||||
// DB is a mapper of a Filer and Searcher implementation using Bitcask.
|
||||
type DB struct {
|
||||
store map[string]*bitcask.Bitcask
|
||||
store map[string]Casket
|
||||
path string
|
||||
mu *sync.RWMutex
|
||||
}
|
||||
|
||||
func NewDB(path string) *DB {
|
||||
// OpenDB will either open an existing set of bitcask datastores at the given directory, or it will create a new one.
|
||||
func OpenDB(path string) *DB {
|
||||
return &DB{
|
||||
store: make(map[string]*bitcask.Bitcask),
|
||||
store: make(map[string]Casket),
|
||||
path: path,
|
||||
mu: &sync.RWMutex{},
|
||||
}
|
||||
@ -44,18 +51,18 @@ func (db *DB) Init(bucketName string) error {
|
||||
return e
|
||||
}
|
||||
|
||||
db.store[bucketName] = c
|
||||
db.store[bucketName] = Casket{Bitcask: c}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// With calls the given underlying bitcask instance.
|
||||
func (db *DB) With(bucketName string) Filer {
|
||||
func (db *DB) With(bucketName string) Casket {
|
||||
db.mu.RLock()
|
||||
defer db.mu.RUnlock()
|
||||
d, ok := db.store[bucketName]
|
||||
if !ok {
|
||||
return nil
|
||||
return Casket{Bitcask: nil, Searcher: nil}
|
||||
}
|
||||
return d
|
||||
}
|
||||
@ -74,10 +81,13 @@ func (db *DB) Sync(bucketName string) error {
|
||||
return db.store[bucketName].Sync()
|
||||
}
|
||||
|
||||
// withAllAction
|
||||
type withAllAction uint8
|
||||
|
||||
const (
|
||||
// dclose
|
||||
dclose withAllAction = iota
|
||||
// dsync
|
||||
dsync
|
||||
)
|
||||
|
||||
@ -90,7 +100,7 @@ func (db *DB) WithAll(action withAllAction) error {
|
||||
var errs []error
|
||||
for name, store := range db.store {
|
||||
var err error
|
||||
if store == nil {
|
||||
if store.Bitcask == nil {
|
||||
errs = append(errs, namedErr(name, errBogusStore))
|
||||
continue
|
||||
}
|
||||
@ -110,10 +120,26 @@ func (db *DB) WithAll(action withAllAction) error {
|
||||
return compoundErrors(errs)
|
||||
}
|
||||
|
||||
// SyncAndCloseAll implements the method from Keeper.
|
||||
func (db *DB) SyncAndCloseAll() error {
|
||||
var errs []error
|
||||
errSync := namedErr("sync", db.SyncAll())
|
||||
if errSync != nil {
|
||||
errs = append(errs, errSync)
|
||||
}
|
||||
errClose := namedErr("close", db.CloseAll())
|
||||
if errClose != nil {
|
||||
errs = append(errs, errClose)
|
||||
}
|
||||
return compoundErrors(errs)
|
||||
}
|
||||
|
||||
// CloseAll closes all bitcask datastores.
|
||||
func (db *DB) CloseAll() error {
|
||||
return db.WithAll(dclose)
|
||||
}
|
||||
|
||||
// SyncAll syncs all bitcask datastores.
|
||||
func (db *DB) SyncAll() error {
|
||||
return db.WithAll(dsync)
|
||||
}
|
||||
|
57
bitcask_search.go
Normal file
57
bitcask_search.go
Normal file
@ -0,0 +1,57 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"git.tcp.direct/kayos/common"
|
||||
)
|
||||
|
||||
func (c Casket) Search(query string) map[string]interface{} {
|
||||
res := make(map[string]interface{})
|
||||
for _, key := range c.AllKeys() {
|
||||
raw, _ := c.Get([]byte(key))
|
||||
if raw == nil {
|
||||
continue
|
||||
}
|
||||
if strings.Contains(string(raw), query) {
|
||||
res[key] = raw
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func (c Casket) ValueExists(value []byte) (key []byte, ok bool) {
|
||||
var raw []byte
|
||||
for _, k := range c.AllKeys() {
|
||||
raw, _ = c.Get([]byte(k))
|
||||
if raw == nil {
|
||||
continue
|
||||
}
|
||||
if common.CompareChecksums(value, raw) {
|
||||
ok = true
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (c Casket) PrefixScan(prefix string) map[string]interface{} {
|
||||
res := make(map[string]interface{})
|
||||
c.Scan([]byte(prefix), func(key []byte) error {
|
||||
raw, err := c.Get(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
res[string(key)] = raw
|
||||
return nil
|
||||
})
|
||||
return res
|
||||
}
|
||||
|
||||
func (c Casket) AllKeys() (keys []string) {
|
||||
keychan := c.Keys()
|
||||
for key := range keychan {
|
||||
keys = append(keys, string(key))
|
||||
}
|
||||
return
|
||||
}
|
83
bitcask_search_test.go
Normal file
83
bitcask_search_test.go
Normal file
@ -0,0 +1,83 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
c "git.tcp.direct/kayos/common"
|
||||
)
|
||||
|
||||
var needle = "yeet"
|
||||
|
||||
type Foo struct {
|
||||
Bar string
|
||||
Yeet int
|
||||
What map[string]int
|
||||
}
|
||||
|
||||
func genJunk(t *testing.T, correct bool) []byte {
|
||||
item := c.RandStr(5)
|
||||
if correct {
|
||||
item = needle + c.RandStr(5)
|
||||
}
|
||||
|
||||
f := Foo{
|
||||
Bar: c.RandStr(5),
|
||||
Yeet: 5,
|
||||
What: map[string]int{c.RandStr(5): 2, item: 7},
|
||||
}
|
||||
|
||||
raw, err := json.Marshal(f)
|
||||
if err != nil {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
return raw
|
||||
}
|
||||
|
||||
func Test_Search(t *testing.T) {
|
||||
var (
|
||||
testpath = "./testsearch"
|
||||
)
|
||||
|
||||
var db *DB
|
||||
|
||||
t.Logf("opening database at %s", testpath)
|
||||
|
||||
db = OpenDB(testpath)
|
||||
|
||||
err := db.Init("searchtest")
|
||||
if err != nil {
|
||||
t.Fatalf("[FAIL] couuldn't initialize bucket: %e", err)
|
||||
}
|
||||
|
||||
t.Cleanup(func() {
|
||||
t.Logf("cleaning up file at; %s", testpath)
|
||||
if err := os.RemoveAll(testpath); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
})
|
||||
|
||||
for n := 0; n != 100; n++ {
|
||||
var rawjson []byte
|
||||
switch n {
|
||||
case 5, 25, 35, 85:
|
||||
rawjson = genJunk(t, true)
|
||||
default:
|
||||
rawjson = genJunk(t, false)
|
||||
}
|
||||
t.Logf("created random data: %s", rawjson)
|
||||
err := db.With("searchtest").Put([]byte(fmt.Sprintf("%d", n)), rawjson)
|
||||
if err != nil {
|
||||
t.Fail()
|
||||
t.Logf("%e", err)
|
||||
}
|
||||
}
|
||||
|
||||
t.Logf("executing search for %s", needle)
|
||||
results := db.With("searchtest").Search(needle)
|
||||
for key, value := range results {
|
||||
t.Logf("Found key: %s, Value: %s", key, string(value.([]byte)))
|
||||
}
|
||||
}
|
@ -5,9 +5,14 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
var db *DB
|
||||
|
||||
func TestDB_NewDB(t *testing.T) {
|
||||
|
||||
db = OpenDB("./testdata")
|
||||
}
|
||||
|
||||
func TestDB_Init(t *testing.T) {
|
||||
t.Logf("Making new testdata db: ./testdata")
|
||||
db := NewDB("./testdata")
|
||||
|
||||
type args struct {
|
||||
bucketName string
|
||||
@ -66,13 +71,13 @@ func TestDB_Init(t *testing.T) {
|
||||
t.Logf("Got value %v at key %v", string(gvalue), key)
|
||||
})
|
||||
t.Run("withBucketDoesntExist", func(t *testing.T) {
|
||||
if nope := db.With("asdfqwerty"); nope != nil {
|
||||
if nope := db.With("asdfqwerty"); nope.Bitcask != nil {
|
||||
t.Errorf("[FAIL] got non nil result for nonexistent bucket: %T, %v", nope, nope)
|
||||
}
|
||||
t.Logf("[SUCCESS] got nil value for bucket that doesn't exist")
|
||||
})
|
||||
t.Run("syncAllShouldFail", func(t *testing.T) {
|
||||
db.store["wtf"] = nil
|
||||
db.store["wtf"] = Casket{}
|
||||
t.Cleanup(func() {
|
||||
t.Logf("deleting bogus store map entry")
|
||||
delete(db.store, "wtf")
|
||||
|
12
go.mod
12
go.mod
@ -2,14 +2,22 @@ module git.tcp.direct/kayos/database
|
||||
|
||||
go 1.17
|
||||
|
||||
require git.tcp.direct/Mirrors/bitcask-mirror v0.0.0-20211231150931-947667808303
|
||||
require (
|
||||
git.tcp.direct/Mirrors/bitcask-mirror v0.0.0-20211231150931-947667808303
|
||||
git.tcp.direct/kayos/common v0.0.0-20220101220121-7222e460b190
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/abcum/lcp v0.0.0-20201209214815-7a3f3840be81 // indirect
|
||||
github.com/gofrs/flock v0.8.0 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/plar/go-adaptive-radix-tree v1.0.4 // indirect
|
||||
github.com/rs/zerolog v1.26.1 // indirect
|
||||
github.com/sirupsen/logrus v1.8.1 // indirect
|
||||
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
|
||||
go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37 // indirect
|
||||
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e // indirect
|
||||
golang.org/x/exp v0.0.0-20200228211341-fcea875c7e85 // indirect
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect
|
||||
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e // indirect
|
||||
inet.af/netaddr v0.0.0-20211027220019-c74959edd3b6 // indirect
|
||||
)
|
||||
|
22
go.sum
22
go.sum
@ -39,6 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
git.tcp.direct/Mirrors/bitcask-mirror v0.0.0-20211231150931-947667808303 h1:h0703BkfBT3ShScuT5eKalhmJdHcOwj0eNHFlS6KsiM=
|
||||
git.tcp.direct/Mirrors/bitcask-mirror v0.0.0-20211231150931-947667808303/go.mod h1:h85n0Nf+YhtSVm7Y5R03ydmDkYePHlU/+M2V01byeRQ=
|
||||
git.tcp.direct/kayos/common v0.0.0-20220101220121-7222e460b190 h1:dqSyETmJ9INrofckqE3iP8kOZ+6K1Loa7e7rzqUIqbA=
|
||||
git.tcp.direct/kayos/common v0.0.0-20220101220121-7222e460b190/go.mod h1:EQM0tL6J12k5Ef209u/0RStL4PCLmPkBdN6mOX6F+/k=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
@ -77,6 +79,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
|
||||
github.com/dvyukov/go-fuzz v0.0.0-20210103155950-6a8e9d1f2415/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
@ -258,6 +261,9 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||
github.com/rs/zerolog v1.26.1 h1:/ihwxqH+4z8UxyI70wM1z9yCvkWcfz/a3mj48k/Zngc=
|
||||
github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||
@ -307,6 +313,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
|
||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
|
||||
@ -324,6 +331,10 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/
|
||||
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
|
||||
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 h1:UXLjNohABv4S58tHmeuIZDO6e3mHpW2Dx33gaNt03LE=
|
||||
go4.org/intern v0.0.0-20211027215823-ae77deb06f29/go.mod h1:cS2ma+47FKrLPdXFpr7CuxiTW3eyJbWew4qx0qtQWDA=
|
||||
go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37 h1:Tx9kY6yUkLge/pFG7IEMwDZy6CS2ajFc9TvQdPCW0uA=
|
||||
go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
@ -332,6 +343,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e h1:1SzTfNOXwIS2oWiMF+6qu0OUDKb0dauo6MoDUQyu+yU=
|
||||
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@ -408,6 +421,7 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@ -475,8 +489,10 @@ golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA=
|
||||
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@ -485,6 +501,7 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@ -540,6 +557,7 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
@ -670,6 +688,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
inet.af/netaddr v0.0.0-20211027220019-c74959edd3b6 h1:acCzuUSQ79tGsM/O50VRFySfMm19IoMKL+sZztZkCxw=
|
||||
inet.af/netaddr v0.0.0-20211027220019-c74959edd3b6/go.mod h1:y3MGhcFMlh0KZPMuXXow8mpjxxAk3yoDNsp4cQz54i8=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
|
@ -14,6 +14,7 @@ type Filer interface {
|
||||
Put(key []byte, value []byte) error
|
||||
// Delete should delete the key and the value associated with the given key, and return an error upon failure.
|
||||
Delete(key []byte) error
|
||||
|
||||
}
|
||||
|
||||
// Keeper will be in charge of the more meta operations involving Filers.
|
||||
|
Loading…
Reference in New Issue
Block a user