Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-datastore
Commits
884eb1ef
Unverified
Commit
884eb1ef
authored
Jan 31, 2019
by
Steven Allen
Committed by
GitHub
Jan 31, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #115 from ipfs/fix/get-backed
interfaces: make GetBacked* take a Read instead of a Datastore
parents
f1971d02
cd8d7b48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
datastore.go
datastore.go
+2
-2
No files found.
datastore.go
View file @
884eb1ef
...
...
@@ -210,7 +210,7 @@ var ErrInvalidType = errors.New("datastore: invalid type error")
// func (*d SomeDatastore) Has(key Key) (exists bool, err error) {
// return GetBackedHas(d, key)
// }
func
GetBackedHas
(
ds
Datastore
,
key
Key
)
(
bool
,
error
)
{
func
GetBackedHas
(
ds
Read
,
key
Key
)
(
bool
,
error
)
{
_
,
err
:=
ds
.
Get
(
key
)
switch
err
{
case
nil
:
...
...
@@ -228,7 +228,7 @@ func GetBackedHas(ds Datastore, key Key) (bool, error) {
// func (*d SomeDatastore) GetSize(key Key) (size int, err error) {
// return GetBackedSize(d, key)
// }
func
GetBackedSize
(
ds
Datastore
,
key
Key
)
(
int
,
error
)
{
func
GetBackedSize
(
ds
Read
,
key
Key
)
(
int
,
error
)
{
value
,
err
:=
ds
.
Get
(
key
)
if
err
==
nil
{
return
len
(
value
),
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment