Skip to content

Commit

Permalink
rename unadorned bucket to crudbucket
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepeterson committed Sep 4, 2024
1 parent 35a0b34 commit d3a9d66
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions storage/kv/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ type RWBucket interface {
Delete(ctx context.Context, key string) error
}

// Bucket defines simple read-write operations for key-value stores.
type Bucket interface {
// CRUDBucket defines simple read-write operations for key-value stores.
type CRUDBucket interface {
ROBucket
RWBucket
}

// Bucket is an alias for any commonly used key-value store.
type Bucket = CRUDBucket
4 changes: 2 additions & 2 deletions storage/kv/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ type KeysPrefixTraverser interface {

// KeysTraversingBucket is a key-value store that can traverse keys.
type KeysTraversingBucket interface {
Bucket
CRUDBucket
KeysTraverser
}

// KeysPrefixTraversingBucket is a key-value store that can traverse keys.
// Inlcuding using a prefix.
type KeysPrefixTraversingBucket interface {
Bucket
CRUDBucket
KeysTraverser
KeysPrefixTraverser
}
2 changes: 1 addition & 1 deletion storage/kv/test/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/micromdm/nanolib/storage/kv"
)

func TestBucketSimple(t *testing.T, ctx context.Context, b kv.Bucket) {
func TestBucketSimple(t *testing.T, ctx context.Context, b kv.CRUDBucket) {
const testKey1 = "test_key_1"
const testKey2 = "test_key_2"
const testValue1 = "test_value_1"
Expand Down

0 comments on commit d3a9d66

Please sign in to comment.