diff options
author | EuAndreh <eu@euandre.org> | 2025-02-13 10:41:10 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-02-13 10:41:10 -0300 |
commit | ab20fd9fd1ee6369bfb09b83506da3838e361184 (patch) | |
tree | 7011246a2ec6d845684c15287cf7bbbe72bf09c3 | |
parent | src/dedo.go: Include NextID() in BucketI (diff) | |
download | dedo-ab20fd9fd1ee6369bfb09b83506da3838e361184.tar.gz dedo-ab20fd9fd1ee6369bfb09b83506da3838e361184.tar.xz |
src/dedo.go: Include CreateBucketIfNotExists() in BucketI
-rw-r--r-- | src/dedo.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dedo.go b/src/dedo.go index 66daba2..0541bab 100644 --- a/src/dedo.go +++ b/src/dedo.go @@ -76,6 +76,7 @@ type BucketI interface{ Delete([]byte) error ForEach(func([]byte, []byte) error) error CreateBucket([]byte) (BucketI, error) + CreateBucketIfNotExists([]byte) (BucketI, error) DeleteBucket([]byte) error Bucket([]byte) (BucketI, error) NextID() []byte @@ -742,7 +743,7 @@ func bucketCreateBucketIfNotExists(b *bucketT, key []byte) (*bucketT, error) { return child, nil } -func (b *bucketT) CreateBucketIfNotExists(key []byte) (*bucketT, error) { +func (b *bucketT) CreateBucketIfNotExists(key []byte) (BucketI, error) { return bucketCreateBucketIfNotExists(b, key) } @@ -3616,7 +3617,7 @@ func (tx *transactionT) CreateBucket(name []byte) (BucketI, error) { /// is too long. The bucket instance is only valid for the lifetime of the /// transaction. func txCreateBucketIfNotExists(tx *transactionT, name []byte) (*bucketT, error) { - return tx.root.CreateBucketIfNotExists(name) + return bucketCreateBucketIfNotExists(&tx.root, name) } func (tx *transactionT) CreateBucketIfNotExists(name []byte) (BucketI, error) { |