Update storage interface

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
This commit is contained in:
cai.zhang 2020-09-03 10:02:48 +08:00 committed by yefu.chen
parent 18cf816e56
commit 18d7745261
2 changed files with 8 additions and 8 deletions

View File

@ -0,0 +1 @@
package proxy_test

View File

@ -3,24 +3,23 @@ package storage
import (
"context"
"errors"
minIODriver "storage/internal/minio"
tikvDriver "storage/internal/tikv"
"storage/pkg/types"
minIODriver "github.com/czs007/suvlim/storage/internal/minio"
tikvDriver "github.com/czs007/suvlim/storage/internal/tikv"
"github.com/czs007/suvlim/storage/pkg/types"
)
func NewStore(ctx context.Context, driver types.DriverType) (types.Store, error) {
var err error
var store types.Store
driverType := types.DriverType(driver)
switch driverType{
case types.MinIODriver:
switch driver{
case types.TIKVDriver:
store, err = tikvDriver.NewTikvStore(ctx)
if err != nil {
panic(err.Error())
}
return store, nil
case types.TIKVDriver:
store, err = minIODriver.NewMinIOStore(ctx)
case types.MinIODriver:
store, err = minIODriver.NewMinioDriver(ctx)
if err != nil {
//panic(err.Error())
return nil, err