Skip to content

Commit

Permalink
別パッケージのinterfaceをシグネチャ違いで利用できないため、型が定義をしてみる
Browse files Browse the repository at this point in the history
  • Loading branch information
bootjp committed Apr 30, 2024
1 parent 2eeaff8 commit d27e739
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ type KVPair struct {

var Tombstone = []byte{0x00}

type Txn func(ctx context.Context, txn Txn) error

Check failure on line 20 in store/store.go

View workflow job for this annotation

GitHub Actions / build

other declaration of Txn

type Store interface {
Get(ctx context.Context, key []byte) ([]byte, error)
Put(ctx context.Context, key []byte, value []byte) error
Delete(ctx context.Context, key []byte) error
Exists(ctx context.Context, key []byte) (bool, error)
Snapshot() (io.ReadWriter, error)
Restore(buf io.Reader) error
Txn(ctx context.Context, f func(ctx context.Context, txn Txn) error) error
Txn(ctx context.Context, txn Txn) error
Close() error
}

Expand Down

0 comments on commit d27e739

Please sign in to comment.