Update vendor/

This commit is contained in:
2018-06-25 23:27:32 +01:00
parent 4f5e3ed906
commit d25ed6c1bd
182 changed files with 31368 additions and 6047 deletions

25
vendor/github.com/asdine/storm/kv.go generated vendored
View File

@@ -18,6 +18,8 @@ type KeyValueStore interface {
GetBytes(bucketName string, key interface{}) ([]byte, error)
// SetBytes sets a raw value into a bucket.
SetBytes(bucketName string, key interface{}, value []byte) error
// KeyExists reports the presence of a key in a bucket.
KeyExists(bucketName string, key interface{}) (bool, error)
}
// GetBytes gets a raw value from a bucket.
@@ -143,3 +145,26 @@ func (n *node) delete(tx *bolt.Tx, bucketName string, id []byte) error {
return bucket.Delete(id)
}
// KeyExists reports the presence of a key in a bucket.
func (n *node) KeyExists(bucketName string, key interface{}) (bool, error) {
id, err := toBytes(key, n.codec)
if err != nil {
return false, err
}
var exists bool
return exists, n.readTx(func(tx *bolt.Tx) error {
bucket := n.GetBucket(tx, bucketName)
if bucket == nil {
return ErrNotFound
}
v := bucket.Get(id)
if v != nil {
exists = true
}
return nil
})
}