Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interfaces: make GetBacked* take a Read instead of a Datastore #115

Merged
merged 1 commit into from
Jan 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down