Skip to content

Commit

Permalink
Refine the kv.Storage interface
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <[email protected]>
  • Loading branch information
JmPotato committed Nov 7, 2023
1 parent 635aa6e commit acf7555
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tikv/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"github.com/tikv/client-go/v2/oracle"
"github.com/tikv/client-go/v2/tikvrpc"
"github.com/tikv/client-go/v2/txnkv/txnlock"
pdhttp "github.com/tikv/pd/client/http"
)

// Storage represent the kv.Storage runs on TiKV.
Expand Down Expand Up @@ -69,6 +70,9 @@ type Storage interface {
// GetTiKVClient gets the TiKV client.
GetTiKVClient() Client

// GetPDHTTPClient gets the PD HTTP client.
GetPDHTTPClient() pdhttp.Client

// Closed returns the closed channel.
Closed() <-chan struct{}

Expand Down
2 changes: 2 additions & 0 deletions tikv/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ type KVStore struct {
gP Pool
}

var _ Storage = (*KVStore)(nil)

// Go run the function in a separate goroutine.
func (s *KVStore) Go(f func()) error {
return s.gP.Run(f)
Expand Down

0 comments on commit acf7555

Please sign in to comment.