Skip to content

Commit

Permalink
refactor: move cachebatchkv/cache.go to cachekv/batchkv.go
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyanchen committed Jan 12, 2024
1 parent 3e139cf commit 705bf2d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions cachebatchkv/cache.go → cachekv/batchkv.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package cachebatchkv
package cachekv

import (
"context"
"errors"
"fmt"

"github.com/chenyanchen/db"
"github.com/chenyanchen/db/cachekv"
)

// cacheBatchKV is a struct that contains a cache and a source BatchKV.
Expand All @@ -19,13 +18,13 @@ type cacheBatchKV[K comparable, V any] struct {
source db.BatchKV[K, V]
}

// New creates a new cacheBatchKV instance with the given source and options.
func New[K comparable, V any](
// NewBatch creates a new cacheBatchKV instance with the given source and options.
func NewBatch[K comparable, V any](
source db.BatchKV[K, V],
options ...cachekv.Option[K, V],
options ...Option[K, V],
) *cacheBatchKV[K, V] {
return &cacheBatchKV[K, V]{
cache: cachekv.New(options...),
cache: New(options...),
source: source,
}
}
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 705bf2d

Please sign in to comment.