Repository: milvus-io/milvus-sdk-go
Pull request #501 (2023-06-26 06:53:42)

[Feature|Pick] Support Database for managing collection and index
Related issue: https://github.com/milvus-io/milvus-sdk-go/issues/448
Pick from: 
https://github.com/milvus-io/milvus-sdk-go/pull/449
https://github.com/milvus-io/milvus-sdk-go/pull/473
https://github.com/milvus-io/milvus-sdk-go/pull/478

sre-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/milvus-io/milvus-sdk-go/pull/501#" title="Author self-approved">chyezh</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **sunby** after the PR has been reviewed.
You can assign the PR to them by writing `/assign @sunby` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=milvus-io%2Fmilvus-sdk-go).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/milvus-io/milvus-sdk-go/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["sunby"]} -->
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/milvus-io/milvus-sdk-go/pull/501?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io) Report
> Merging [#501](https://app.codecov.io/gh/milvus-io/milvus-sdk-go/pull/501?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io) (f87db21) into [master](https://app.codecov.io/gh/milvus-io/milvus-sdk-go/commit/06b4a4a41a09a9e2e15790080c9a55609dabc0b9?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io) (06b4a4a) will **decrease** coverage by `0.49%`.
> The diff coverage is `63.05%`.

[![Impacted file tree graph](https://app.codecov.io/gh/milvus-io/milvus-sdk-go/pull/501/graphs/tree.svg?width=650&height=150&src=pr&token=WJK43PV390&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io)](https://app.codecov.io/gh/milvus-io/milvus-sdk-go/pull/501?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io)

```diff
@@            Coverage Diff             @@
##           master     #501      +/-   ##
==========================================
- Coverage   84.09%   83.60%   -0.49%     
==========================================
  Files          36       38       +2     
  Lines        3319     3380      +61     
==========================================
+ Hits         2791     2826      +35     
- Misses        425      447      +22     
- Partials      103      107       +4     
```


| [Impacted Files](https://app.codecov.io/gh/milvus-io/milvus-sdk-go/pull/501?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io) | Coverage Δ | |
|---|---|---|
| [client/client.go](https://app.codecov.io/gh/milvus-io/milvus-sdk-go/pull/501?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-Y2xpZW50L2NsaWVudC5nbw==) | `31.70% <27.77%> (-35.80%)` | :arrow_down: |
| [client/connect.go](https://app.codecov.io/gh/milvus-io/milvus-sdk-go/pull/501?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-Y2xpZW50L2Nvbm5lY3QuZ28=) | `54.76% <50.00%> (-25.76%)` | :arrow_down: |
| [client/config.go](https://app.codecov.io/gh/milvus-io/milvus-sdk-go/pull/501?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-Y2xpZW50L2NvbmZpZy5nbw==) | `65.21% <65.21%> (ø)` | |
| [client/database.go](https://app.codecov.io/gh/milvus-io/milvus-sdk-go/pull/501?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-Y2xpZW50L2RhdGFiYXNlLmdv) | `78.78% <78.78%> (ø)` | |
| [client/interceptor.go](https://app.codecov.io/gh/milvus-io/milvus-sdk-go/pull/501?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-Y2xpZW50L2ludGVyY2VwdG9yLmdv) | `100.00% <100.00%> (+75.00%)` | :arrow_up: |

... and [1 file with indirect coverage changes](https://app.codecov.io/gh/milvus-io/milvus-sdk-go/pull/501/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io)

chyezh: /assign congqixia
sre-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/milvus-io/milvus-sdk-go/pull/501#" title="Author self-approved">chyezh</a>*, *<a href="https://github.com/milvus-io/milvus-sdk-go/pull/501#pullrequestreview-1502176848" title="LGTM">congqixia</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=milvus-io%2Fmilvus-sdk-go).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/milvus-io/milvus-sdk-go/blob/master/OWNERS)~~ [congqixia]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/README.md b/README.md
index c1ae185..6a6caee 100644
--- a/README.md
+++ b/README.md
@@ -43,7 +43,9 @@ Go 1.15 or higher
    import "github.com/milvus-io/milvus-sdk-go/v2/client"
 
    //...other snippet ...
-   client, err := client.NewGrpcClient(context.Background(), "address_of_milvus")
+   client, err := client.NewClient(context.Background(), client.Config{
+      Address: "localhost:19530",
+   })
    if err != nil {
        // handle error
    }
diff --git a/client/client.go b/client/client.go
index 358d834..f737cea 100644
--- a/client/client.go
+++ b/client/client.go
@@ -14,14 +14,11 @@ package client
 
 import (
 	"context"
-	"net/url"
-	"strings"
 	"time"
 
-	"github.com/milvus-io/milvus-sdk-go/v2/entity"
 	"google.golang.org/grpc"
-	"google.golang.org/grpc/backoff"
-	"google.golang.org/grpc/keepalive"
+
+	"github.com/milvus-io/milvus-sdk-go/v2/entity"
 )
 
 const (
@@ -30,9 +27,25 @@ const (
 
 // Client is the interface used to communicate with Milvus
 type Client interface {
+	// -- client --
 	// Close close the remaining connection resources
 	Close() error
 
+	// UsingDatabase for database operation after this function call.
+	// All request in any goroutine will be applied to new database on the same client. e.g.
+	// 1. goroutine A access DB1.
+	// 2. goroutine B call UsingDatabase(ctx, "DB2").
+	// 3. goroutine A access DB2 after 2.
+	UsingDatabase(ctx context.Context, dbName string) error
+
+	// -- database --
+	// ListDatabases list all database in milvus cluster.
+	ListDatabases(ctx context.Context) ([]entity.Database, error)
+	// CreateDatabase create database with the given name.
+	CreateDatabase(ctx context.Context, dbName string) error
+	// DropDatabase drop database with the given db name.
+	DropDatabase(ctx context.Context, dbName string) error
+
 	// -- collection --
 
 	// ListCollections list collections from connection
@@ -215,97 +228,88 @@ func (rs ResultSet) GetColumn(fieldName string) entity.Column {
 	return nil
 }
 
-var DefaultGrpcOpts = []grpc.DialOption{
-	grpc.WithBlock(),
-	grpc.WithKeepaliveParams(keepalive.ClientParameters{
-		Time:                5 * time.Second,
-		Timeout:             10 * time.Second,
-		PermitWithoutStream: true,
-	}),
-	grpc.WithConnectParams(grpc.ConnectParams{
-		Backoff: backoff.Config{
-			BaseDelay:  100 * time.Millisecond,
-			Multiplier: 1.6,
-			Jitter:     0.2,
-			MaxDelay:   3 * time.Second,
-		},
-		MinConnectTimeout: 3 * time.Second,
-	}),
-}
+// Check if GrpcClient implement Client.
+var _ Client = &GrpcClient{}
 
-// NewGrpcClient create client with grpc addr
-// the `Connect` API will be called for you
-// dialOptions contains the dial option(s) that control the grpc dialing process
-func NewGrpcClient(ctx context.Context, addr string, dialOptions ...grpc.DialOption) (Client, error) {
-	c := &GrpcClient{}
-	if len(dialOptions) == 0 {
-		return NewDefaultGrpcClient(ctx, addr)
+// NewClient create a client connected to remote milvus cluster.
+// More connect option can be modified by Config.
+func NewClient(ctx context.Context, config Config) (Client, error) {
+	if err := config.parse(); err != nil {
+		return nil, err
 	}
 
-	if err := c.connect(ctx, addr, dialOptions...); err != nil {
-		return nil, err
+	c := &GrpcClient{
+		config: &config,
 	}
 
-	return c, nil
-}
+	// Parse remote address.
+	addr := c.config.getParsedAddress()
 
-func NewDefaultGrpcClient(ctx context.Context, addr string) (Client, error) {
-	c := &GrpcClient{}
+	// Parse grpc options
+	options := c.config.getDialOption()
 
-	err := c.connect(ctx, addr, c.getDefaultDialOpts()...)
-	if err != nil {
+	// Connect the grpc server.
+	if err := c.connect(ctx, addr, options...); err != nil {
 		return nil, err
 	}
+
 	return c, nil
 }
 
-func NewDefaultGrpcClientWithURI(ctx context.Context, uri, username, password string) (Client, error) {
-	addr, inSecure, err := parseURI(uri)
-	if err != nil {
-		return nil, err
-	}
+// NewGrpcClient create client with grpc addr
+// the `Connect` API will be called for you
+// dialOptions contains the dial option(s) that control the grpc dialing process
+// !!!Deprecated in future, use `NewClient` first.
+func NewGrpcClient(ctx context.Context, addr string, dialOptions ...grpc.DialOption) (Client, error) {
+	return NewClient(ctx, Config{
+		Address:     addr,
+		DialOptions: dialOptions,
+	})
+}
 
-	if inSecure {
-		return NewDefaultGrpcClientWithTLSAuth(ctx, addr, username, password)
-	}
+// NewDefaultGrpcClient creates a new gRPC client.
+// !!!Deprecated in future, use `NewClient` first.
+func NewDefaultGrpcClient(ctx context.Context, addr string) (Client, error) {
+	return NewClient(
+		ctx, Config{
+			Address: addr,
+		},
+	)
+}
 
-	return NewDefaultGrpcClientWithAuth(ctx, addr, username, password)
+// NewDefaultGrpcClientWithURI creates a new gRPC client with URI.
+// !!!Deprecated in future, use `NewClient` first.
+func NewDefaultGrpcClientWithURI(ctx context.Context, uri, username, password string) (Client, error) {
+	return NewClient(ctx, Config{
+		Address:  uri,
+		Username: username,
+		Password: password,
+	})
 }
 
-// NewDefaultGrpcClientWithTLSAuth enable transport security
+// NewDefaultGrpcClientWithTLSAuth creates a new gRPC client with TLS authentication.
+// !!!Deprecated in future, use `NewClient` first.
 func NewDefaultGrpcClientWithTLSAuth(ctx context.Context, addr, username, password string) (Client, error) {
-	c := &GrpcClient{}
-	defaultOpts := c.getDefaultAuthDialOpts(username, password, true)
-	return c.dialWithOptions(ctx, addr, defaultOpts...)
+	return NewClient(
+		ctx,
+		Config{
+			Address:       addr,
+			Username:      username,
+			Password:      password,
+			EnableTLSAuth: true,
+		},
+	)
 }
 
-// NewDefaultGrpcClientWithAuth  disable transport security
+// NewDefaultGrpcClientWithAuth creates a new gRPC client with authentication.
+// !!!Deprecated in future, use `NewClient` first.
 func NewDefaultGrpcClientWithAuth(ctx context.Context, addr, username, password string) (Client, error) {
-	c := &GrpcClient{}
-	defaultOpts := c.getDefaultAuthDialOpts(username, password, false)
-	return c.dialWithOptions(ctx, addr, defaultOpts...) //NewGrpcClient(ctx, addr, defaultOpts...)
-}
-
-func parseURI(uri string) (string, bool, error) {
-	hasPrefix := false
-	inSecure := false
-	if strings.HasPrefix(uri, "https://") {
-		inSecure = true
-		hasPrefix = true
-	}
-
-	if strings.HasPrefix(uri, "http://") {
-		inSecure = false
-		hasPrefix = true
-	}
-
-	if hasPrefix {
-		url, err := url.Parse(uri)
-		if err != nil {
-			return "", inSecure, err
-		}
-		return url.Host, inSecure, nil
-	}
-
-	return uri, inSecure, nil
+	return NewClient(
+		ctx,
+		Config{
+			Address:  addr,
+			Username: username,
+			Password: password,
+		},
+	)
 }
diff --git a/client/config.go b/client/config.go
new file mode 100644
index 0000000..1fa967a
--- /dev/null
+++ b/client/config.go
@@ -0,0 +1,149 @@
+package client
+
+import (
+	"context"
+	"crypto/tls"
+	"fmt"
+	"math"
+	"net/url"
+	"regexp"
+	"strings"
+	"time"
+
+	"github.com/cockroachdb/errors"
+	grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/backoff"
+	"google.golang.org/grpc/codes"
+	"google.golang.org/grpc/credentials"
+	"google.golang.org/grpc/credentials/insecure"
+	"google.golang.org/grpc/keepalive"
+)
+
+var regexValidScheme = regexp.MustCompile(`^https?:\/\/`)
+
+// DefaultGrpcOpts is GRPC options for milvus client.
+var DefaultGrpcOpts = []grpc.DialOption{
+	grpc.WithBlock(),
+	grpc.WithKeepaliveParams(keepalive.ClientParameters{
+		Time:                5 * time.Second,
+		Timeout:             10 * time.Second,
+		PermitWithoutStream: true,
+	}),
+	grpc.WithConnectParams(grpc.ConnectParams{
+		Backoff: backoff.Config{
+			BaseDelay:  100 * time.Millisecond,
+			Multiplier: 1.6,
+			Jitter:     0.2,
+			MaxDelay:   3 * time.Second,
+		},
+		MinConnectTimeout: 3 * time.Second,
+	}),
+}
+
+// Config for milvus client.
+type Config struct {
+	Address       string // Remote address, "localhost:19530".
+	Username      string // Username for auth.
+	Password      string // Password for auth.
+	DBName        string // DBName for this client.
+	Identifier    string // Identifier for this connection
+	EnableTLSAuth bool   // Enable TLS Auth for transport security.
+	APIKey        string // API key
+
+	DialOptions []grpc.DialOption // Dial options for GRPC.
+
+	parsedAddress *url.URL
+
+	DisableConn bool
+}
+
+// Copy a new config, dialOption may shared with old config.
+func (c *Config) Copy() Config {
+	newConfig := Config{
+		Address:       c.Address,
+		Username:      c.Username,
+		Password:      c.Password,
+		DBName:        c.DBName,
+		EnableTLSAuth: c.EnableTLSAuth,
+	}
+	newConfig.DialOptions = make([]grpc.DialOption, 0, len(c.DialOptions))
+	newConfig.DialOptions = append(newConfig.DialOptions, c.DialOptions...)
+	return newConfig
+}
+
+func (c *Config) parse() error {
+	// Prepend default fake tcp:// scheme for remote address.
+	address := c.Address
+	if !regexValidScheme.MatchString(address) {
+		address = fmt.Sprintf("tcp://%s", address)
+	}
+
+	remoteURL, err := url.Parse(address)
+	if err != nil {
+		return errors.Wrap(err, "milvus address parse fail")
+	}
+	// Remote Host should never be empty.
+	if remoteURL.Host == "" {
+		return errors.New("empty remote host of milvus address")
+	}
+	// Use DBName in remote url path.
+	if c.DBName == "" {
+		c.DBName = strings.TrimLeft(remoteURL.Path, "/")
+	}
+	// Always enable tls auth for https remote url.
+	if remoteURL.Scheme == "https" {
+		c.EnableTLSAuth = true
+	}
+	c.parsedAddress = remoteURL
+	return nil
+}
+
+// Get parsed remote milvus address, should be called after parse was called.
+func (c *Config) getParsedAddress() string {
+	return c.parsedAddress.Host
+}
+
+// useDatabase change the inner db name.
+func (c *Config) useDatabase(dbName string) {
+	c.DBName = dbName
+}
+
+// useDatabase change the inner db name.
+func (c *Config) setIdentifier(identifier string) {
+	c.Identifier = identifier
+}
+
+// Get parsed grpc dial options, should be called after parse was called.
+func (c *Config) getDialOption() []grpc.DialOption {
+	options := c.DialOptions
+	if c.DialOptions == nil {
+		// Add default connection options.
+		options = make([]grpc.DialOption, len(DefaultGrpcOpts))
+		copy(options, DefaultGrpcOpts)
+	}
+
+	// Construct dial option.
+	if c.EnableTLSAuth {
+		options = append(options, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})))
+	} else {
+		options = append(options, grpc.WithTransportCredentials(insecure.NewCredentials()))
+	}
+
+	options = append(options,
+		grpc.WithChainUnaryInterceptor(grpc_retry.UnaryClientInterceptor(
+			grpc_retry.WithMax(6),
+			grpc_retry.WithBackoff(func(attempt uint) time.Duration {
+				return 60 * time.Millisecond * time.Duration(math.Pow(3, float64(attempt)))
+			}),
+			grpc_retry.WithCodes(codes.Unavailable, codes.ResourceExhausted)),
+			RetryOnRateLimitInterceptor(10, func(ctx context.Context, attempt uint) time.Duration {
+				return 10 * time.Millisecond * time.Duration(math.Pow(3, float64(attempt)))
+			}),
+		))
+
+	options = append(options, grpc.WithChainUnaryInterceptor(
+		createMetaDataUnaryInterceptor(c),
+	))
+	return options
+}
diff --git a/client/connect.go b/client/connect.go
index 0420c42..cc46a08 100644
--- a/client/connect.go
+++ b/client/connect.go
@@ -13,106 +13,24 @@ package client
 
 import (
 	"context"
-	"crypto/tls"
 	"fmt"
-	"math"
+	"os"
 	"strconv"
-	"sync/atomic"
 	"time"
 
-	grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
-	grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
+	"github.com/cockroachdb/errors"
 	common "github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
 	server "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc/codes"
-	"google.golang.org/grpc/credentials"
-	"google.golang.org/grpc/credentials/insecure"
-	"google.golang.org/grpc/metadata"
+	"google.golang.org/grpc/status"
 )
 
 // GrpcClient, uses default grpc Service definition to connect with Milvus2.0
 type GrpcClient struct {
-	Conn       *grpc.ClientConn           // grpc connection instance
-	Service    server.MilvusServiceClient // Service client stub
-	identifier atomic.Value
-}
-
-func (c *GrpcClient) getIdentifier() (int64, bool) {
-	v, ok := c.identifier.Load().(int64)
-	return v, ok
-}
-
-func (c GrpcClient) getIdentifierInterceptor() grpc.UnaryClientInterceptor {
-	return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
-		identifier, ok := c.getIdentifier()
-		if !ok {
-			ctx = metadata.AppendToOutgoingContext(ctx, "identifier", strconv.FormatInt(identifier, 10))
-		}
-		return invoker(ctx, method, req, reply, cc, opts...)
-	}
-}
-
-func (c *GrpcClient) getUnaryClientInteceptors() []grpc.UnaryClientInterceptor {
-	return []grpc.UnaryClientInterceptor{
-		c.getIdentifierInterceptor(),
-	}
-}
-
-func (c *GrpcClient) dialWithOptions(ctx context.Context, addr string, dialOptions ...grpc.DialOption) (Client, error) {
-	if err := c.connect(ctx, addr, dialOptions...); err != nil {
-		return nil, err
-	}
-	return c, nil
-}
-
-func (c *GrpcClient) getDefaultDialOpts() []grpc.DialOption {
-	clientInteceptors := c.getUnaryClientInteceptors()
-	clientInteceptors = append(clientInteceptors, grpc_retry.UnaryClientInterceptor(
-		grpc_retry.WithMax(6),
-		grpc_retry.WithBackoff(func(attempt uint) time.Duration {
-			return 60 * time.Millisecond * time.Duration(math.Pow(3, float64(attempt)))
-		}),
-		grpc_retry.WithCodes(codes.Unavailable, codes.ResourceExhausted)),
-		RetryOnRateLimitInterceptor(10, func(ctx context.Context, attempt uint) time.Duration {
-			return 10 * time.Millisecond * time.Duration(math.Pow(3, float64(attempt)))
-		}))
-	defaultOpts := append(DefaultGrpcOpts,
-		grpc.WithTransportCredentials(insecure.NewCredentials()),
-		grpc.WithUnaryInterceptor(
-			grpc_middleware.ChainUnaryClient(
-				clientInteceptors...,
-			),
-		),
-	)
-
-	return defaultOpts
-}
-
-func (c *GrpcClient) getDefaultAuthDialOpts(username, password string, enableTLS bool) []grpc.DialOption {
-	var credential credentials.TransportCredentials
-	if enableTLS {
-		credential = credentials.NewTLS(&tls.Config{})
-	} else {
-		credential = insecure.NewCredentials()
-	}
-
-	clientInteceptors := c.getUnaryClientInteceptors()
-	clientInteceptors = append(clientInteceptors,
-		CreateAuthenticationUnaryInterceptor(username, password),
-		grpc_retry.UnaryClientInterceptor(
-			grpc_retry.WithMax(6),
-			grpc_retry.WithBackoff(func(attempt uint) time.Duration {
-				return 60 * time.Millisecond * time.Duration(math.Pow(3, float64(attempt)))
-			}),
-			grpc_retry.WithCodes(codes.Unavailable, codes.ResourceExhausted)),
-	)
-	defaultOpts := append(DefaultGrpcOpts,
-		grpc.WithTransportCredentials(credential),
-		grpc.WithChainUnaryInterceptor(clientInteceptors...),
-		grpc.WithStreamInterceptor(CreateAuthenticationStreamInterceptor(username, password)),
-	)
-	return defaultOpts
+	Conn    *grpc.ClientConn           // grpc connection instance
+	Service server.MilvusServiceClient // Service client stub
+	config  *Config                    // No thread safety
 }
 
 func (c *GrpcClient) dial(ctx context.Context, addr string, opts ...grpc.DialOption) error {
@@ -133,22 +51,47 @@ func (c *GrpcClient) connect(ctx context.Context, addr string, opts ...grpc.Dial
 		return err
 	}
 	c.Service = server.NewMilvusServiceClient(c.Conn)
-	resp, err := c.Service.Connect(ctx, &server.ConnectRequest{
-		Base: &common.MsgBase{},
+
+	if !c.config.DisableConn {
+		if err := c.connectInternal(ctx); err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+func (c *GrpcClient) connectInternal(ctx context.Context) error {
+	hostName, err := os.Hostname()
+	if err != nil {
+		return err
+	}
+
+	req := &server.ConnectRequest{
 		ClientInfo: &common.ClientInfo{
 			SdkType:    "golang",
 			SdkVersion: sdkVerion,
-			//TODO get local ip and username if provided
+			LocalTime:  time.Now().String(),
+			User:       c.config.Username,
+			Host:       hostName,
 		},
-	})
+	}
+
+	resp, err := c.Service.Connect(ctx, req)
 	if err != nil {
+		status, ok := status.FromError(err)
+		if ok {
+			if status.Code() == codes.Unimplemented {
+				return errors.New("this version of sdk is incompatible with server," +
+					" please downgrade your sdk or upgrade your server")
+			}
+		}
 		return err
 	}
 	if err := handleRespStatus(resp.GetStatus()); err != nil {
 		return err
 	}
 
-	c.identifier.Store(resp.GetIdentifier())
+	c.config.Identifier = strconv.FormatInt(resp.GetIdentifier(), 10)
 	return nil
 }
 
diff --git a/client/database.go b/client/database.go
new file mode 100644
index 0000000..ea225c7
--- /dev/null
+++ b/client/database.go
@@ -0,0 +1,94 @@
+// Licensed to the LF AI & Data foundation under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package client
+
+import (
+	"context"
+
+	server "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
+	"github.com/milvus-io/milvus-sdk-go/v2/entity"
+)
+
+// UsingDatabase for database operation after this function call.
+// All request in any goroutine will be applied to new database on the same client. e.g.
+// 1. goroutine A access DB1.
+// 2. goroutine B call UsingDatabase(ctx, "DB2").
+// 3. goroutine A access DB2 after 2.
+func (c *GrpcClient) UsingDatabase(ctx context.Context, dbName string) error {
+	c.config.useDatabase(dbName)
+	err := c.connectInternal(ctx)
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// CreateDatabase creates a new database for remote Milvus cluster.
+// TODO:New options can be added as expanding parameters.
+func (c *GrpcClient) CreateDatabase(ctx context.Context, dbName string) error {
+	if c.Service == nil {
+		return ErrClientNotReady
+	}
+	req := &server.CreateDatabaseRequest{
+		DbName: dbName,
+	}
+	resp, err := c.Service.CreateDatabase(ctx, req)
+	if err != nil {
+		return err
+	}
+	return handleRespStatus(resp)
+}
+
+// ListDatabases list all database in milvus cluster.
+func (c *GrpcClient) ListDatabases(ctx context.Context) ([]entity.Database, error) {
+	if c.Service == nil {
+		return nil, ErrClientNotReady
+	}
+
+	req := &server.ListDatabasesRequest{}
+	resp, err := c.Service.ListDatabases(ctx, req)
+	if err != nil {
+		return nil, err
+	}
+	if err = handleRespStatus(resp.GetStatus()); err != nil {
+		return nil, err
+	}
+	databases := make([]entity.Database, len(resp.GetDbNames()))
+	for i, dbName := range resp.GetDbNames() {
+		databases[i] = entity.Database{
+			Name: dbName,
+		}
+	}
+	return databases, nil
+}
+
+// DropDatabase drop all database in milvus cluster.
+func (c *GrpcClient) DropDatabase(ctx context.Context, dbName string) error {
+	if c.Service == nil {
+		return ErrClientNotReady
+	}
+
+	req := &server.DropDatabaseRequest{
+		DbName: dbName,
+	}
+	resp, err := c.Service.DropDatabase(ctx, req)
+	if err != nil {
+		return err
+	}
+	return handleRespStatus(resp)
+}
diff --git a/client/interceptor.go b/client/interceptor.go
index 1aa8b1c..6ef9eeb 100644
--- a/client/interceptor.go
+++ b/client/interceptor.go
@@ -4,29 +4,61 @@ import (
 	"context"
 	"fmt"
 
-	"github.com/milvus-io/milvus-sdk-go/v2/internal/utils/crypto"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc/metadata"
+
+	"github.com/milvus-io/milvus-sdk-go/v2/internal/utils/crypto"
+)
+
+const (
+	authorizationHeader = `authorization`
 )
 
-// AuthenticationInterceptor appends credential into context metadata
-func AuthenticationInterceptor(ctx context.Context, username, password string) context.Context {
-	value := crypto.Base64Encode(fmt.Sprintf("%s:%s", username, password))
-	return metadata.AppendToOutgoingContext(ctx, "authorization", value)
+// authenticationInterceptor appends credential into context metadata
+func authenticationInterceptor(ctx context.Context, username, password string) context.Context {
+	if username != "" || password != "" {
+		value := crypto.Base64Encode(fmt.Sprintf("%s:%s", username, password))
+		return metadata.AppendToOutgoingContext(ctx, authorizationHeader, value)
+	}
+	return ctx
 }
 
-// CreateAuthenticationUnaryInterceptor creates a unary interceptor for authentication
-func CreateAuthenticationUnaryInterceptor(username, password string) grpc.UnaryClientInterceptor {
-	return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
-		ctx = AuthenticationInterceptor(ctx, username, password)
-		return invoker(ctx, method, req, reply, cc, opts...)
+func apiKeyInterceptor(ctx context.Context, apiKey string) context.Context {
+	if apiKey != "" {
+		value := crypto.Base64Encode(fmt.Sprintf("Bearer: %s", apiKey))
+		return metadata.AppendToOutgoingContext(ctx, authorizationHeader, value)
 	}
+	return ctx
 }
 
-// CreateAuthenticationStreamInterceptor creates a stream interceptor for authentication
-func CreateAuthenticationStreamInterceptor(username, password string) grpc.StreamClientInterceptor {
-	return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {
-		ctx = AuthenticationInterceptor(ctx, username, password)
-		return streamer(ctx, desc, cc, method, opts...)
+func identifierInterceptor(ctx context.Context, identifierGetter func() string) context.Context {
+	dbname := identifierGetter()
+	if dbname != "" {
+		ctx = metadata.AppendToOutgoingContext(ctx, "identifier", dbname)
+	}
+	return ctx
+}
+
+// databaseNameInterceptor appends the dbName into metadata.
+func databaseNameInterceptor(ctx context.Context, dbNameGetter func() string) context.Context {
+	dbname := dbNameGetter()
+	if dbname != "" {
+		ctx = metadata.AppendToOutgoingContext(ctx, "dbname", dbname)
+	}
+	return ctx
+}
+
+// createMetaDataUnaryInterceptor creates a unary interceptor for metadata information.
+func createMetaDataUnaryInterceptor(cfg *Config) grpc.UnaryClientInterceptor {
+	return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
+		ctx = authenticationInterceptor(ctx, cfg.Username, cfg.Password)
+		ctx = apiKeyInterceptor(ctx, cfg.APIKey)
+		ctx = identifierInterceptor(ctx, func() string {
+			return cfg.Identifier
+		})
+		ctx = databaseNameInterceptor(ctx, func() string {
+			return cfg.DBName
+		})
+		return invoker(ctx, method, req, reply, cc, opts...)
 	}
 }
diff --git a/docs/new_client.md b/docs/new_client.md
index efbfb7d..c024739 100644
--- a/docs/new_client.md
+++ b/docs/new_client.md
@@ -18,5 +18,7 @@ This is the "Constructor" method set (only one for current release) to obtain `C
 
 ```go
 ctx := context.Background()
-cli, err := client.NewGrpcClient(ctx, "localhost:19530")
+cli, err := client.NewClient(context.Background(), client.Config{
+		Address:  "localhost:19530",
+	})
 ```
diff --git a/entity/database.go b/entity/database.go
new file mode 100644
index 0000000..a354c6a
--- /dev/null
+++ b/entity/database.go
@@ -0,0 +1,22 @@
+package entity
+
+// Licensed to the LF AI & Data foundation under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Database represents a database in a remote Milvus cluster.
+type Database struct {
+	Name string // Database name.
+}
diff --git a/examples/README.md b/examples/README.md
index 8c64dd0..57fb6c9 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -7,3 +7,4 @@ here is some list to demonstrate the usage of `milvus-sdk-go`
 - [Index building](index/index.go) Index related creation/search example, time consumption compared as well
 - [Calculate Distance](calcdistance/calc_distance.go) Calculate distance between vectors. Both ids or raw vectors example are presented.
 - [Hello Milvus](hello_milvus/hello_milvus.go) Golang version of [hello_milvus](https://milvus.io/docs/v2.0.x/example_code.md)
+- [Use database](database/database.go) Create, use and drop database of Milvus, isolate your data in the unique Milvus cluster.
diff --git a/examples/auth/auth.go b/examples/auth/auth.go
index da53e7b..b1ee23a 100644
--- a/examples/auth/auth.go
+++ b/examples/auth/auth.go
@@ -22,7 +22,14 @@ const (
 func main() {
 	ctx := context.Background()
 	// create grpc client that tls is enabled
-	c, err := client.NewDefaultGrpcClientWithTLSAuth(ctx, addr, username, password)
+	c, err := client.NewClient(
+		ctx,
+		client.Config{
+			Address:  addr,
+			Username: username,
+			Password: password,
+		},
+	)
 	if err != nil {
 		log.Fatal("failed to connect:", err)
 	}
diff --git a/examples/basic/basic.go b/examples/basic/basic.go
index f2d866b..0ccd172 100644
--- a/examples/basic/basic.go
+++ b/examples/basic/basic.go
@@ -19,7 +19,9 @@ func main() {
 	ctx, cancel := context.WithTimeout(ctx, 2*time.Second)
 	defer cancel()
 
-	c, err := client.NewGrpcClient(ctx, milvusAddr)
+	c, err := client.NewClient(ctx, client.Config{
+		Address: milvusAddr,
+	})
 	if err != nil {
 		// handling error and exit, to make example simple here
 		log.Fatal("failed to connect to milvus:", err.Error())
diff --git a/examples/calcdistance/calc_distance.go b/examples/calcdistance/calc_distance.go
index cf3e173..7a19f7d 100644
--- a/examples/calcdistance/calc_distance.go
+++ b/examples/calcdistance/calc_distance.go
@@ -22,7 +22,9 @@ func main() {
 	ctx, cancel := context.WithTimeout(ctx, 2*time.Second)
 	defer cancel()
 
-	c, err := client.NewGrpcClient(ctx, milvusAddr)
+	c, err := client.NewClient(ctx, client.Config{
+		Address: milvusAddr,
+	})
 	if err != nil {
 		// handling error and exit, to make example simple here
 		log.Fatal("failed to connect to milvus:", err.Error())
@@ -117,8 +119,8 @@ func main() {
 	}
 	log.Println("load collection completed")
 
-	//searchFilm := films[0] // use first fim to search
-	//vector := entity.FloatVector(searchFilm.Vector[:])
+	// searchFilm := films[0] // use first fim to search
+	// vector := entity.FloatVector(searchFilm.Vector[:])
 	// Use flat search param
 
 	r, err := c.CalcDistance(ctx, collectionName, []string{}, entity.L2, entity.NewColumnFloatVector("Vector", 8, vectors[0:2]), entity.NewColumnFloatVector("Vector", 8, vectors[3:4]))
diff --git a/examples/database/database.go b/examples/database/database.go
new file mode 100644
index 0000000..4fb135e
--- /dev/null
+++ b/examples/database/database.go
@@ -0,0 +1,166 @@
+package main
+
+import (
+	"context"
+	"fmt"
+	"log"
+
+	"github.com/milvus-io/milvus-sdk-go/v2/client"
+	"github.com/milvus-io/milvus-sdk-go/v2/entity"
+)
+
+func main() {
+	fmt.Println("using default database...")
+	ctx := context.Background()
+	cfg := client.Config{
+		Address:  "localhost:19530",
+		Username: "root",
+		Password: "Milvus",
+	}
+	clientDefault := mustConnect(ctx, cfg)
+	defer clientDefault.Close()
+	createCollection(ctx, clientDefault, "col1")
+	if err := clientDefault.CreateDatabase(ctx, "db1"); err != nil {
+		log.Fatalf("create db1 failed, %+v", err)
+	}
+	dbs, err := clientDefault.ListDatabases(ctx)
+	if err != nil {
+		log.Fatalf("list database failed: %+v", err)
+	}
+
+	fmt.Println("using db1...")
+	cfg.DBName = ""
+	cfg.Address = "localhost:19530/db1"
+	clientDB1 := mustConnect(ctx, cfg)
+	defer clientDB1.Close()
+	createCollection(ctx, clientDB1, "col1")
+	createCollection(ctx, clientDB1, "col2")
+
+	fmt.Println("create collection col1 in default database...")
+	collections, err := clientDefault.ListCollections(ctx)
+	if err != nil {
+		log.Fatalf("list on default database failed: %+v", err)
+	}
+	if len(collections) != 1 {
+		log.Fatalf("unexpected count of default database, %d", len(collections))
+	}
+	if collections[0].Name != "col1" {
+		log.Fatalf("unexpected db name of default database, %s", collections[0].Name)
+	}
+
+	fmt.Println("create collection col1, col2 in db1...")
+	collections, err = clientDB1.ListCollections(ctx)
+	if err != nil {
+		log.Fatalf("list on db1 failed: %+v", err)
+	}
+
+	fmt.Println("create db2...")
+	if err := clientDefault.CreateDatabase(ctx, "db2"); err != nil {
+		log.Fatalf("create db2 failed, %+v", err)
+	}
+	dbs, err = clientDefault.ListDatabases(ctx)
+	if err != nil {
+		log.Fatalf("list database failed: %+v", err)
+	}
+
+	fmt.Println("connect to db2 with existing client...")
+	clientDefault.UsingDatabase(ctx, "db2")
+	fmt.Println("create and drop collection on db2...")
+	createCollection(ctx, clientDefault, "col1")
+	if err := clientDefault.DropCollection(ctx, "col1"); err != nil {
+		log.Fatalf("drop col1 at db2 failed, %+v", err)
+	}
+
+	err = clientDefault.UsingDatabase(ctx, "")
+	if err != nil {
+		log.Fatalf("using database failed: %+v", err)
+	}
+
+	fmt.Println("drop db2: drop empty database should be always success...")
+	if err := clientDefault.DropDatabase(ctx, "db2"); err != nil {
+		log.Fatalf("drop db2 failed, %+v", err)
+	}
+	dbs, err = clientDefault.ListDatabases(ctx)
+	if err != nil {
+		log.Fatalf("list database failed: %+v", err)
+	}
+
+	fmt.Println("drop db1: drop non-empty database should be fail...")
+	if err := clientDB1.DropDatabase(ctx, "db1"); err == nil {
+		log.Fatalf("drop an non empty db success")
+	}
+
+	fmt.Println("drop db1: drop all collection before drop db...")
+	if err := clientDB1.DropCollection(ctx, "col1"); err != nil {
+		log.Fatalf("drop col1 at db1 failed, %+v", err)
+	}
+	if err := clientDB1.DropCollection(ctx, "col2"); err != nil {
+		log.Fatalf("drop col2 at db1 failed, %+v", err)
+	}
+	if err := clientDB1.DropDatabase(ctx, "db1"); err != nil {
+		log.Fatalf("drop db1 failed, %+v", err)
+	}
+
+	fmt.Println("Drop collection on default database...")
+	if err := clientDefault.DropCollection(ctx, "col1"); err != nil {
+		log.Fatalf("drop col1 at default db failed, %+v", err)
+	}
+
+	fmt.Println("drop default: drop default database should be fail...")
+	if err := clientDefault.DropDatabase(ctx, ""); err == nil {
+		log.Fatalf("drop an default db success")
+	}
+	dbs, err = clientDefault.ListDatabases(ctx)
+	if err != nil {
+		log.Fatalf("list database failed: %+v", err)
+	}
+
+	fmt.Println("db:", dbs)
+}
+
+func mustConnect(ctx context.Context, cfg client.Config) client.Client {
+	c, err := client.NewClient(ctx, cfg)
+	if err != nil {
+		log.Fatalf("connect to database failed, %+v", err)
+	}
+	return c
+}
+
+func createCollection(ctx context.Context, c client.Client, collectionName string) {
+	ok, err := c.HasCollection(ctx, collectionName)
+	if err != nil {
+		log.Fatalf("%v", err)
+	}
+	if ok {
+		c.DropCollection(ctx, collectionName)
+	}
+	schema := &entity.Schema{
+		CollectionName: collectionName,
+		Description:    "database demo",
+		AutoID:         false,
+		Fields: []*entity.Field{
+			{
+				Name:       "id",
+				DataType:   entity.FieldTypeInt64,
+				PrimaryKey: true,
+				AutoID:     false,
+			},
+			{
+				Name:       "data",
+				DataType:   entity.FieldTypeDouble,
+				PrimaryKey: false,
+				AutoID:     false,
+			},
+			{
+				Name:     "embeddings",
+				DataType: entity.FieldTypeFloatVector,
+				TypeParams: map[string]string{
+					entity.TypeParamDim: fmt.Sprintf("%d", 128),
+				},
+			},
+		},
+	}
+	if err := c.CreateCollection(ctx, schema, entity.DefaultShardNumber); err != nil {
+		log.Fatalf("create collection failed, err: %v", err)
+	}
+}
diff --git a/examples/hello_milvus/hello_milvus.go b/examples/hello_milvus/hello_milvus.go
index 94a9d13..436435c 100644
--- a/examples/hello_milvus/hello_milvus.go
+++ b/examples/hello_milvus/hello_milvus.go
@@ -25,7 +25,9 @@ func main() {
 	ctx := context.Background()
 
 	fmt.Printf(msgFmt, "start connecting to Milvus")
-	c, err := client.NewGrpcClient(ctx, milvusAddr)
+	c, err := client.NewClient(ctx, client.Config{
+		Address: milvusAddr,
+	})
 	if err != nil {
 		log.Fatalf("failed to connect to milvus, err: %v", err)
 	}
diff --git a/examples/index/index.go b/examples/index/index.go
index dcad0de..bccceb2 100644
--- a/examples/index/index.go
+++ b/examples/index/index.go
@@ -23,7 +23,9 @@ func main() {
 	ctx, cancel := context.WithTimeout(ctx, 2*time.Second)
 	defer cancel()
 
-	c, err := client.NewGrpcClient(ctx, milvusAddr)
+	c, err := client.NewClient(ctx, client.Config{
+		Address: milvusAddr,
+	})
 	if err != nil {
 		// handling error and exit, to make example simple here
 		log.Fatal("failed to connect to milvus:", err.Error())
diff --git a/examples/insert/insert.go b/examples/insert/insert.go
index 0bfe83a..e0e2fc0 100644
--- a/examples/insert/insert.go
+++ b/examples/insert/insert.go
@@ -23,7 +23,9 @@ func main() {
 	ctx, cancel := context.WithTimeout(ctx, 2*time.Second)
 	defer cancel()
 
-	c, err := client.NewGrpcClient(ctx, milvusAddr)
+	c, err := client.NewClient(ctx, client.Config{
+		Address: milvusAddr,
+	})
 	if err != nil {
 		// handling error and exit, to make example simple here
 		log.Fatal("failed to connect to milvus:", err.Error())
diff --git a/examples/query/query.go b/examples/query/query.go
index 05177d1..d9b5a0c 100644
--- a/examples/query/query.go
+++ b/examples/query/query.go
@@ -25,7 +25,9 @@ func main() {
 	ctx := context.Background()
 
 	fmt.Printf(msgFmt, "start connecting to Milvus")
-	c, err := client.NewGrpcClient(ctx, milvusAddr)
+	c, err := client.NewClient(ctx, client.Config{
+		Address: milvusAddr,
+	})
 	if err != nil {
 		log.Fatalf("failed to connect to milvus, err: %v", err)
 	}
diff --git a/examples/tls/tls.go b/examples/tls/tls.go
index 9850d33..1cd885e 100644
--- a/examples/tls/tls.go
+++ b/examples/tls/tls.go
@@ -51,7 +51,10 @@ func main() {
 		MinVersion:   tls.VersionTLS13,
 	})
 
-	c, err := client.NewGrpcClient(ctx, milvusAddr, grpc.WithTransportCredentials(creds))
+	c, err := client.NewClient(ctx, client.Config{
+		Address:     milvusAddr,
+		DialOptions: []grpc.DialOption{grpc.WithTransportCredentials(creds)},
+	})
 	if err != nil {
 		// handling error and exit, to make example simple here
 		log.Fatal("failed to connect to milvus:", err.Error())
diff --git a/examples/varchar/varchar_pk.go b/examples/varchar/varchar_pk.go
index 248bfe7..b3c4954 100644
--- a/examples/varchar/varchar_pk.go
+++ b/examples/varchar/varchar_pk.go
@@ -26,7 +26,9 @@ func main() {
 	ctx := context.Background()
 
 	fmt.Printf(msgFmt, "start connecting to Milvus")
-	c, err := client.NewGrpcClient(ctx, milvusAddr)
+	c, err := client.NewClient(ctx, client.Config{
+		Address: milvusAddr,
+	})
 	if err != nil {
 		log.Fatalf("failed to connect to milvus, err: %v", err)
 	}
diff --git a/go.mod b/go.mod
index d302324..94ed2de 100644
--- a/go.mod
+++ b/go.mod
@@ -4,6 +4,7 @@ go 1.17
 
 require (
 	github.com/cockroachdb/errors v1.9.1
+	github.com/go-faker/faker/v4 v4.1.0
 	github.com/golang/protobuf v1.5.2
 	github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
 	github.com/milvus-io/milvus-proto/go-api/v2 v2.3.0-dev.1
@@ -27,10 +28,10 @@ require (
 	github.com/stretchr/objx v0.5.0 // indirect
 	github.com/tidwall/match v1.1.1 // indirect
 	github.com/tidwall/pretty v1.2.0 // indirect
-	golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
+	golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
 	golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
 	golang.org/x/text v0.3.8 // indirect
 	google.golang.org/genproto v0.0.0-20220503193339-ba3ae3f07e29 // indirect
-	google.golang.org/protobuf v1.28.1 // indirect
+	google.golang.org/protobuf v1.30.0 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 )
diff --git a/go.sum b/go.sum
index be1aa44..536c166 100644
--- a/go.sum
+++ b/go.sum
@@ -59,6 +59,8 @@ github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/
 github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
 github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
 github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
+github.com/go-faker/faker/v4 v4.1.0 h1:ffuWmpDrducIUOO0QSKSF5Q2dxAht+dhsT9FvVHhPEI=
+github.com/go-faker/faker/v4 v4.1.0/go.mod h1:uuNc0PSRxF8nMgjGrrrU4Nw5cF30Jc6Kd0/FUTTYbhg=
 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
 github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8=
@@ -241,6 +243,7 @@ github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZ
 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
+github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
 go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
 go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
@@ -262,6 +265,7 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
 golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -281,8 +285,9 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
 golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk=
 golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0=
+golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -293,6 +298,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -316,10 +322,14 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -342,6 +352,7 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK
 golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -387,8 +398,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
-google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
-google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
+google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
diff --git a/mocks/MilvusServiceServer.go b/mocks/MilvusServiceServer.go
index 1a0f159..092e3bd 100644
--- a/mocks/MilvusServiceServer.go
+++ b/mocks/MilvusServiceServer.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.16.0. DO NOT EDIT.
+// Code generated by mockery v2.26.1. DO NOT EDIT.
 
 package mocks
 
@@ -32,6 +32,10 @@ func (_m *MilvusServiceServer) AlterAlias(_a0 context.Context, _a1 *milvuspb.Alt
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.AlterAliasRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.AlterAliasRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -40,7 +44,6 @@ func (_m *MilvusServiceServer) AlterAlias(_a0 context.Context, _a1 *milvuspb.Alt
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.AlterAliasRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -56,8 +59,8 @@ type MilvusServiceServer_AlterAlias_Call struct {
 }
 
 // AlterAlias is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.AlterAliasRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.AlterAliasRequest
 func (_e *MilvusServiceServer_Expecter) AlterAlias(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_AlterAlias_Call {
 	return &MilvusServiceServer_AlterAlias_Call{Call: _e.mock.On("AlterAlias", _a0, _a1)}
 }
@@ -74,11 +77,20 @@ func (_c *MilvusServiceServer_AlterAlias_Call) Return(_a0 *commonpb.Status, _a1
 	return _c
 }
 
+func (_c *MilvusServiceServer_AlterAlias_Call) RunAndReturn(run func(context.Context, *milvuspb.AlterAliasRequest) (*commonpb.Status, error)) *MilvusServiceServer_AlterAlias_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // AlterCollection provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) AlterCollection(_a0 context.Context, _a1 *milvuspb.AlterCollectionRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.AlterCollectionRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.AlterCollectionRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -87,7 +99,6 @@ func (_m *MilvusServiceServer) AlterCollection(_a0 context.Context, _a1 *milvusp
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.AlterCollectionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -103,8 +114,8 @@ type MilvusServiceServer_AlterCollection_Call struct {
 }
 
 // AlterCollection is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.AlterCollectionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.AlterCollectionRequest
 func (_e *MilvusServiceServer_Expecter) AlterCollection(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_AlterCollection_Call {
 	return &MilvusServiceServer_AlterCollection_Call{Call: _e.mock.On("AlterCollection", _a0, _a1)}
 }
@@ -121,11 +132,20 @@ func (_c *MilvusServiceServer_AlterCollection_Call) Return(_a0 *commonpb.Status,
 	return _c
 }
 
+func (_c *MilvusServiceServer_AlterCollection_Call) RunAndReturn(run func(context.Context, *milvuspb.AlterCollectionRequest) (*commonpb.Status, error)) *MilvusServiceServer_AlterCollection_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // CalcDistance provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) CalcDistance(_a0 context.Context, _a1 *milvuspb.CalcDistanceRequest) (*milvuspb.CalcDistanceResults, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.CalcDistanceResults
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CalcDistanceRequest) (*milvuspb.CalcDistanceResults, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CalcDistanceRequest) *milvuspb.CalcDistanceResults); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -134,7 +154,6 @@ func (_m *MilvusServiceServer) CalcDistance(_a0 context.Context, _a1 *milvuspb.C
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.CalcDistanceRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -150,8 +169,8 @@ type MilvusServiceServer_CalcDistance_Call struct {
 }
 
 // CalcDistance is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.CalcDistanceRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.CalcDistanceRequest
 func (_e *MilvusServiceServer_Expecter) CalcDistance(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_CalcDistance_Call {
 	return &MilvusServiceServer_CalcDistance_Call{Call: _e.mock.On("CalcDistance", _a0, _a1)}
 }
@@ -168,11 +187,20 @@ func (_c *MilvusServiceServer_CalcDistance_Call) Return(_a0 *milvuspb.CalcDistan
 	return _c
 }
 
+func (_c *MilvusServiceServer_CalcDistance_Call) RunAndReturn(run func(context.Context, *milvuspb.CalcDistanceRequest) (*milvuspb.CalcDistanceResults, error)) *MilvusServiceServer_CalcDistance_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // CheckHealth provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) CheckHealth(_a0 context.Context, _a1 *milvuspb.CheckHealthRequest) (*milvuspb.CheckHealthResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.CheckHealthResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CheckHealthRequest) (*milvuspb.CheckHealthResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CheckHealthRequest) *milvuspb.CheckHealthResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -181,7 +209,6 @@ func (_m *MilvusServiceServer) CheckHealth(_a0 context.Context, _a1 *milvuspb.Ch
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.CheckHealthRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -197,8 +224,8 @@ type MilvusServiceServer_CheckHealth_Call struct {
 }
 
 // CheckHealth is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.CheckHealthRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.CheckHealthRequest
 func (_e *MilvusServiceServer_Expecter) CheckHealth(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_CheckHealth_Call {
 	return &MilvusServiceServer_CheckHealth_Call{Call: _e.mock.On("CheckHealth", _a0, _a1)}
 }
@@ -267,6 +294,10 @@ func (_m *MilvusServiceServer) CreateAlias(_a0 context.Context, _a1 *milvuspb.Cr
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateAliasRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateAliasRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -275,7 +306,6 @@ func (_m *MilvusServiceServer) CreateAlias(_a0 context.Context, _a1 *milvuspb.Cr
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.CreateAliasRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -291,8 +321,8 @@ type MilvusServiceServer_CreateAlias_Call struct {
 }
 
 // CreateAlias is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.CreateAliasRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.CreateAliasRequest
 func (_e *MilvusServiceServer_Expecter) CreateAlias(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_CreateAlias_Call {
 	return &MilvusServiceServer_CreateAlias_Call{Call: _e.mock.On("CreateAlias", _a0, _a1)}
 }
@@ -309,11 +339,20 @@ func (_c *MilvusServiceServer_CreateAlias_Call) Return(_a0 *commonpb.Status, _a1
 	return _c
 }
 
+func (_c *MilvusServiceServer_CreateAlias_Call) RunAndReturn(run func(context.Context, *milvuspb.CreateAliasRequest) (*commonpb.Status, error)) *MilvusServiceServer_CreateAlias_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // CreateCollection provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) CreateCollection(_a0 context.Context, _a1 *milvuspb.CreateCollectionRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateCollectionRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateCollectionRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -322,7 +361,6 @@ func (_m *MilvusServiceServer) CreateCollection(_a0 context.Context, _a1 *milvus
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.CreateCollectionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -338,8 +376,8 @@ type MilvusServiceServer_CreateCollection_Call struct {
 }
 
 // CreateCollection is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.CreateCollectionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.CreateCollectionRequest
 func (_e *MilvusServiceServer_Expecter) CreateCollection(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_CreateCollection_Call {
 	return &MilvusServiceServer_CreateCollection_Call{Call: _e.mock.On("CreateCollection", _a0, _a1)}
 }
@@ -356,11 +394,20 @@ func (_c *MilvusServiceServer_CreateCollection_Call) Return(_a0 *commonpb.Status
 	return _c
 }
 
+func (_c *MilvusServiceServer_CreateCollection_Call) RunAndReturn(run func(context.Context, *milvuspb.CreateCollectionRequest) (*commonpb.Status, error)) *MilvusServiceServer_CreateCollection_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // CreateCredential provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) CreateCredential(_a0 context.Context, _a1 *milvuspb.CreateCredentialRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateCredentialRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateCredentialRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -369,7 +416,6 @@ func (_m *MilvusServiceServer) CreateCredential(_a0 context.Context, _a1 *milvus
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.CreateCredentialRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -385,8 +431,8 @@ type MilvusServiceServer_CreateCredential_Call struct {
 }
 
 // CreateCredential is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.CreateCredentialRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.CreateCredentialRequest
 func (_e *MilvusServiceServer_Expecter) CreateCredential(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_CreateCredential_Call {
 	return &MilvusServiceServer_CreateCredential_Call{Call: _e.mock.On("CreateCredential", _a0, _a1)}
 }
@@ -455,6 +501,10 @@ func (_m *MilvusServiceServer) CreateIndex(_a0 context.Context, _a1 *milvuspb.Cr
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateIndexRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateIndexRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -463,7 +513,6 @@ func (_m *MilvusServiceServer) CreateIndex(_a0 context.Context, _a1 *milvuspb.Cr
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.CreateIndexRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -479,8 +528,8 @@ type MilvusServiceServer_CreateIndex_Call struct {
 }
 
 // CreateIndex is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.CreateIndexRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.CreateIndexRequest
 func (_e *MilvusServiceServer_Expecter) CreateIndex(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_CreateIndex_Call {
 	return &MilvusServiceServer_CreateIndex_Call{Call: _e.mock.On("CreateIndex", _a0, _a1)}
 }
@@ -497,11 +546,20 @@ func (_c *MilvusServiceServer_CreateIndex_Call) Return(_a0 *commonpb.Status, _a1
 	return _c
 }
 
+func (_c *MilvusServiceServer_CreateIndex_Call) RunAndReturn(run func(context.Context, *milvuspb.CreateIndexRequest) (*commonpb.Status, error)) *MilvusServiceServer_CreateIndex_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // CreatePartition provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) CreatePartition(_a0 context.Context, _a1 *milvuspb.CreatePartitionRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreatePartitionRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreatePartitionRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -510,7 +568,6 @@ func (_m *MilvusServiceServer) CreatePartition(_a0 context.Context, _a1 *milvusp
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.CreatePartitionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -526,8 +583,8 @@ type MilvusServiceServer_CreatePartition_Call struct {
 }
 
 // CreatePartition is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.CreatePartitionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.CreatePartitionRequest
 func (_e *MilvusServiceServer_Expecter) CreatePartition(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_CreatePartition_Call {
 	return &MilvusServiceServer_CreatePartition_Call{Call: _e.mock.On("CreatePartition", _a0, _a1)}
 }
@@ -544,11 +601,20 @@ func (_c *MilvusServiceServer_CreatePartition_Call) Return(_a0 *commonpb.Status,
 	return _c
 }
 
+func (_c *MilvusServiceServer_CreatePartition_Call) RunAndReturn(run func(context.Context, *milvuspb.CreatePartitionRequest) (*commonpb.Status, error)) *MilvusServiceServer_CreatePartition_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // CreateResourceGroup provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) CreateResourceGroup(_a0 context.Context, _a1 *milvuspb.CreateResourceGroupRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateResourceGroupRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateResourceGroupRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -557,7 +623,6 @@ func (_m *MilvusServiceServer) CreateResourceGroup(_a0 context.Context, _a1 *mil
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.CreateResourceGroupRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -573,8 +638,8 @@ type MilvusServiceServer_CreateResourceGroup_Call struct {
 }
 
 // CreateResourceGroup is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.CreateResourceGroupRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.CreateResourceGroupRequest
 func (_e *MilvusServiceServer_Expecter) CreateResourceGroup(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_CreateResourceGroup_Call {
 	return &MilvusServiceServer_CreateResourceGroup_Call{Call: _e.mock.On("CreateResourceGroup", _a0, _a1)}
 }
@@ -591,11 +656,20 @@ func (_c *MilvusServiceServer_CreateResourceGroup_Call) Return(_a0 *commonpb.Sta
 	return _c
 }
 
+func (_c *MilvusServiceServer_CreateResourceGroup_Call) RunAndReturn(run func(context.Context, *milvuspb.CreateResourceGroupRequest) (*commonpb.Status, error)) *MilvusServiceServer_CreateResourceGroup_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // CreateRole provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) CreateRole(_a0 context.Context, _a1 *milvuspb.CreateRoleRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateRoleRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateRoleRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -604,7 +678,6 @@ func (_m *MilvusServiceServer) CreateRole(_a0 context.Context, _a1 *milvuspb.Cre
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.CreateRoleRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -620,8 +693,8 @@ type MilvusServiceServer_CreateRole_Call struct {
 }
 
 // CreateRole is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.CreateRoleRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.CreateRoleRequest
 func (_e *MilvusServiceServer_Expecter) CreateRole(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_CreateRole_Call {
 	return &MilvusServiceServer_CreateRole_Call{Call: _e.mock.On("CreateRole", _a0, _a1)}
 }
@@ -638,11 +711,20 @@ func (_c *MilvusServiceServer_CreateRole_Call) Return(_a0 *commonpb.Status, _a1
 	return _c
 }
 
+func (_c *MilvusServiceServer_CreateRole_Call) RunAndReturn(run func(context.Context, *milvuspb.CreateRoleRequest) (*commonpb.Status, error)) *MilvusServiceServer_CreateRole_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // Delete provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) Delete(_a0 context.Context, _a1 *milvuspb.DeleteRequest) (*milvuspb.MutationResult, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.MutationResult
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DeleteRequest) (*milvuspb.MutationResult, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DeleteRequest) *milvuspb.MutationResult); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -651,7 +733,6 @@ func (_m *MilvusServiceServer) Delete(_a0 context.Context, _a1 *milvuspb.DeleteR
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DeleteRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -667,8 +748,8 @@ type MilvusServiceServer_Delete_Call struct {
 }
 
 // Delete is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DeleteRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DeleteRequest
 func (_e *MilvusServiceServer_Expecter) Delete(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_Delete_Call {
 	return &MilvusServiceServer_Delete_Call{Call: _e.mock.On("Delete", _a0, _a1)}
 }
@@ -685,11 +766,20 @@ func (_c *MilvusServiceServer_Delete_Call) Return(_a0 *milvuspb.MutationResult,
 	return _c
 }
 
+func (_c *MilvusServiceServer_Delete_Call) RunAndReturn(run func(context.Context, *milvuspb.DeleteRequest) (*milvuspb.MutationResult, error)) *MilvusServiceServer_Delete_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DeleteCredential provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DeleteCredential(_a0 context.Context, _a1 *milvuspb.DeleteCredentialRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DeleteCredentialRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DeleteCredentialRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -698,7 +788,6 @@ func (_m *MilvusServiceServer) DeleteCredential(_a0 context.Context, _a1 *milvus
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DeleteCredentialRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -714,8 +803,8 @@ type MilvusServiceServer_DeleteCredential_Call struct {
 }
 
 // DeleteCredential is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DeleteCredentialRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DeleteCredentialRequest
 func (_e *MilvusServiceServer_Expecter) DeleteCredential(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DeleteCredential_Call {
 	return &MilvusServiceServer_DeleteCredential_Call{Call: _e.mock.On("DeleteCredential", _a0, _a1)}
 }
@@ -784,6 +873,10 @@ func (_m *MilvusServiceServer) DescribeCollection(_a0 context.Context, _a1 *milv
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.DescribeCollectionResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DescribeCollectionRequest) *milvuspb.DescribeCollectionResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -792,7 +885,6 @@ func (_m *MilvusServiceServer) DescribeCollection(_a0 context.Context, _a1 *milv
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DescribeCollectionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -808,8 +900,8 @@ type MilvusServiceServer_DescribeCollection_Call struct {
 }
 
 // DescribeCollection is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DescribeCollectionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DescribeCollectionRequest
 func (_e *MilvusServiceServer_Expecter) DescribeCollection(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DescribeCollection_Call {
 	return &MilvusServiceServer_DescribeCollection_Call{Call: _e.mock.On("DescribeCollection", _a0, _a1)}
 }
@@ -826,11 +918,20 @@ func (_c *MilvusServiceServer_DescribeCollection_Call) Return(_a0 *milvuspb.Desc
 	return _c
 }
 
+func (_c *MilvusServiceServer_DescribeCollection_Call) RunAndReturn(run func(context.Context, *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error)) *MilvusServiceServer_DescribeCollection_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DescribeIndex provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DescribeIndex(_a0 context.Context, _a1 *milvuspb.DescribeIndexRequest) (*milvuspb.DescribeIndexResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.DescribeIndexResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DescribeIndexRequest) (*milvuspb.DescribeIndexResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DescribeIndexRequest) *milvuspb.DescribeIndexResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -839,7 +940,6 @@ func (_m *MilvusServiceServer) DescribeIndex(_a0 context.Context, _a1 *milvuspb.
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DescribeIndexRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -855,8 +955,8 @@ type MilvusServiceServer_DescribeIndex_Call struct {
 }
 
 // DescribeIndex is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DescribeIndexRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DescribeIndexRequest
 func (_e *MilvusServiceServer_Expecter) DescribeIndex(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DescribeIndex_Call {
 	return &MilvusServiceServer_DescribeIndex_Call{Call: _e.mock.On("DescribeIndex", _a0, _a1)}
 }
@@ -873,11 +973,20 @@ func (_c *MilvusServiceServer_DescribeIndex_Call) Return(_a0 *milvuspb.DescribeI
 	return _c
 }
 
+func (_c *MilvusServiceServer_DescribeIndex_Call) RunAndReturn(run func(context.Context, *milvuspb.DescribeIndexRequest) (*milvuspb.DescribeIndexResponse, error)) *MilvusServiceServer_DescribeIndex_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DescribeResourceGroup provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DescribeResourceGroup(_a0 context.Context, _a1 *milvuspb.DescribeResourceGroupRequest) (*milvuspb.DescribeResourceGroupResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.DescribeResourceGroupResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DescribeResourceGroupRequest) (*milvuspb.DescribeResourceGroupResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DescribeResourceGroupRequest) *milvuspb.DescribeResourceGroupResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -886,7 +995,6 @@ func (_m *MilvusServiceServer) DescribeResourceGroup(_a0 context.Context, _a1 *m
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DescribeResourceGroupRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -902,8 +1010,8 @@ type MilvusServiceServer_DescribeResourceGroup_Call struct {
 }
 
 // DescribeResourceGroup is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DescribeResourceGroupRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DescribeResourceGroupRequest
 func (_e *MilvusServiceServer_Expecter) DescribeResourceGroup(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DescribeResourceGroup_Call {
 	return &MilvusServiceServer_DescribeResourceGroup_Call{Call: _e.mock.On("DescribeResourceGroup", _a0, _a1)}
 }
@@ -972,6 +1080,10 @@ func (_m *MilvusServiceServer) DropAlias(_a0 context.Context, _a1 *milvuspb.Drop
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropAliasRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropAliasRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -980,7 +1092,6 @@ func (_m *MilvusServiceServer) DropAlias(_a0 context.Context, _a1 *milvuspb.Drop
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DropAliasRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -996,8 +1107,8 @@ type MilvusServiceServer_DropAlias_Call struct {
 }
 
 // DropAlias is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DropAliasRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DropAliasRequest
 func (_e *MilvusServiceServer_Expecter) DropAlias(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DropAlias_Call {
 	return &MilvusServiceServer_DropAlias_Call{Call: _e.mock.On("DropAlias", _a0, _a1)}
 }
@@ -1014,11 +1125,20 @@ func (_c *MilvusServiceServer_DropAlias_Call) Return(_a0 *commonpb.Status, _a1 e
 	return _c
 }
 
+func (_c *MilvusServiceServer_DropAlias_Call) RunAndReturn(run func(context.Context, *milvuspb.DropAliasRequest) (*commonpb.Status, error)) *MilvusServiceServer_DropAlias_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DropCollection provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DropCollection(_a0 context.Context, _a1 *milvuspb.DropCollectionRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropCollectionRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropCollectionRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1027,7 +1147,6 @@ func (_m *MilvusServiceServer) DropCollection(_a0 context.Context, _a1 *milvuspb
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DropCollectionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1043,8 +1162,8 @@ type MilvusServiceServer_DropCollection_Call struct {
 }
 
 // DropCollection is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DropCollectionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DropCollectionRequest
 func (_e *MilvusServiceServer_Expecter) DropCollection(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DropCollection_Call {
 	return &MilvusServiceServer_DropCollection_Call{Call: _e.mock.On("DropCollection", _a0, _a1)}
 }
@@ -1113,6 +1232,10 @@ func (_m *MilvusServiceServer) DropIndex(_a0 context.Context, _a1 *milvuspb.Drop
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropIndexRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropIndexRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1121,7 +1244,6 @@ func (_m *MilvusServiceServer) DropIndex(_a0 context.Context, _a1 *milvuspb.Drop
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DropIndexRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1137,8 +1259,8 @@ type MilvusServiceServer_DropIndex_Call struct {
 }
 
 // DropIndex is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DropIndexRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DropIndexRequest
 func (_e *MilvusServiceServer_Expecter) DropIndex(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DropIndex_Call {
 	return &MilvusServiceServer_DropIndex_Call{Call: _e.mock.On("DropIndex", _a0, _a1)}
 }
@@ -1155,11 +1277,20 @@ func (_c *MilvusServiceServer_DropIndex_Call) Return(_a0 *commonpb.Status, _a1 e
 	return _c
 }
 
+func (_c *MilvusServiceServer_DropIndex_Call) RunAndReturn(run func(context.Context, *milvuspb.DropIndexRequest) (*commonpb.Status, error)) *MilvusServiceServer_DropIndex_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DropPartition provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DropPartition(_a0 context.Context, _a1 *milvuspb.DropPartitionRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropPartitionRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropPartitionRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1168,7 +1299,6 @@ func (_m *MilvusServiceServer) DropPartition(_a0 context.Context, _a1 *milvuspb.
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DropPartitionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1184,8 +1314,8 @@ type MilvusServiceServer_DropPartition_Call struct {
 }
 
 // DropPartition is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DropPartitionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DropPartitionRequest
 func (_e *MilvusServiceServer_Expecter) DropPartition(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DropPartition_Call {
 	return &MilvusServiceServer_DropPartition_Call{Call: _e.mock.On("DropPartition", _a0, _a1)}
 }
@@ -1202,11 +1332,20 @@ func (_c *MilvusServiceServer_DropPartition_Call) Return(_a0 *commonpb.Status, _
 	return _c
 }
 
+func (_c *MilvusServiceServer_DropPartition_Call) RunAndReturn(run func(context.Context, *milvuspb.DropPartitionRequest) (*commonpb.Status, error)) *MilvusServiceServer_DropPartition_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DropResourceGroup provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DropResourceGroup(_a0 context.Context, _a1 *milvuspb.DropResourceGroupRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropResourceGroupRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropResourceGroupRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1215,7 +1354,6 @@ func (_m *MilvusServiceServer) DropResourceGroup(_a0 context.Context, _a1 *milvu
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DropResourceGroupRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1231,8 +1369,8 @@ type MilvusServiceServer_DropResourceGroup_Call struct {
 }
 
 // DropResourceGroup is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DropResourceGroupRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DropResourceGroupRequest
 func (_e *MilvusServiceServer_Expecter) DropResourceGroup(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DropResourceGroup_Call {
 	return &MilvusServiceServer_DropResourceGroup_Call{Call: _e.mock.On("DropResourceGroup", _a0, _a1)}
 }
@@ -1249,11 +1387,20 @@ func (_c *MilvusServiceServer_DropResourceGroup_Call) Return(_a0 *commonpb.Statu
 	return _c
 }
 
+func (_c *MilvusServiceServer_DropResourceGroup_Call) RunAndReturn(run func(context.Context, *milvuspb.DropResourceGroupRequest) (*commonpb.Status, error)) *MilvusServiceServer_DropResourceGroup_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DropRole provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DropRole(_a0 context.Context, _a1 *milvuspb.DropRoleRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropRoleRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropRoleRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1262,7 +1409,6 @@ func (_m *MilvusServiceServer) DropRole(_a0 context.Context, _a1 *milvuspb.DropR
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DropRoleRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1278,8 +1424,8 @@ type MilvusServiceServer_DropRole_Call struct {
 }
 
 // DropRole is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DropRoleRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DropRoleRequest
 func (_e *MilvusServiceServer_Expecter) DropRole(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DropRole_Call {
 	return &MilvusServiceServer_DropRole_Call{Call: _e.mock.On("DropRole", _a0, _a1)}
 }
@@ -1296,11 +1442,20 @@ func (_c *MilvusServiceServer_DropRole_Call) Return(_a0 *commonpb.Status, _a1 er
 	return _c
 }
 
+func (_c *MilvusServiceServer_DropRole_Call) RunAndReturn(run func(context.Context, *milvuspb.DropRoleRequest) (*commonpb.Status, error)) *MilvusServiceServer_DropRole_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // Dummy provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) Dummy(_a0 context.Context, _a1 *milvuspb.DummyRequest) (*milvuspb.DummyResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.DummyResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DummyRequest) (*milvuspb.DummyResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DummyRequest) *milvuspb.DummyResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1309,7 +1464,6 @@ func (_m *MilvusServiceServer) Dummy(_a0 context.Context, _a1 *milvuspb.DummyReq
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DummyRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1325,8 +1479,8 @@ type MilvusServiceServer_Dummy_Call struct {
 }
 
 // Dummy is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DummyRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DummyRequest
 func (_e *MilvusServiceServer_Expecter) Dummy(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_Dummy_Call {
 	return &MilvusServiceServer_Dummy_Call{Call: _e.mock.On("Dummy", _a0, _a1)}
 }
@@ -1343,11 +1497,20 @@ func (_c *MilvusServiceServer_Dummy_Call) Return(_a0 *milvuspb.DummyResponse, _a
 	return _c
 }
 
+func (_c *MilvusServiceServer_Dummy_Call) RunAndReturn(run func(context.Context, *milvuspb.DummyRequest) (*milvuspb.DummyResponse, error)) *MilvusServiceServer_Dummy_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // Flush provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) Flush(_a0 context.Context, _a1 *milvuspb.FlushRequest) (*milvuspb.FlushResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.FlushResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.FlushRequest) (*milvuspb.FlushResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.FlushRequest) *milvuspb.FlushResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1356,7 +1519,6 @@ func (_m *MilvusServiceServer) Flush(_a0 context.Context, _a1 *milvuspb.FlushReq
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.FlushRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1372,8 +1534,8 @@ type MilvusServiceServer_Flush_Call struct {
 }
 
 // Flush is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.FlushRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.FlushRequest
 func (_e *MilvusServiceServer_Expecter) Flush(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_Flush_Call {
 	return &MilvusServiceServer_Flush_Call{Call: _e.mock.On("Flush", _a0, _a1)}
 }
@@ -1390,11 +1552,20 @@ func (_c *MilvusServiceServer_Flush_Call) Return(_a0 *milvuspb.FlushResponse, _a
 	return _c
 }
 
+func (_c *MilvusServiceServer_Flush_Call) RunAndReturn(run func(context.Context, *milvuspb.FlushRequest) (*milvuspb.FlushResponse, error)) *MilvusServiceServer_Flush_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // FlushAll provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) FlushAll(_a0 context.Context, _a1 *milvuspb.FlushAllRequest) (*milvuspb.FlushAllResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.FlushAllResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.FlushAllRequest) (*milvuspb.FlushAllResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.FlushAllRequest) *milvuspb.FlushAllResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1403,7 +1574,6 @@ func (_m *MilvusServiceServer) FlushAll(_a0 context.Context, _a1 *milvuspb.Flush
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.FlushAllRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1419,8 +1589,8 @@ type MilvusServiceServer_FlushAll_Call struct {
 }
 
 // FlushAll is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.FlushAllRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.FlushAllRequest
 func (_e *MilvusServiceServer_Expecter) FlushAll(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_FlushAll_Call {
 	return &MilvusServiceServer_FlushAll_Call{Call: _e.mock.On("FlushAll", _a0, _a1)}
 }
@@ -1437,11 +1607,20 @@ func (_c *MilvusServiceServer_FlushAll_Call) Return(_a0 *milvuspb.FlushAllRespon
 	return _c
 }
 
+func (_c *MilvusServiceServer_FlushAll_Call) RunAndReturn(run func(context.Context, *milvuspb.FlushAllRequest) (*milvuspb.FlushAllResponse, error)) *MilvusServiceServer_FlushAll_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetCollectionStatistics provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetCollectionStatistics(_a0 context.Context, _a1 *milvuspb.GetCollectionStatisticsRequest) (*milvuspb.GetCollectionStatisticsResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetCollectionStatisticsResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetCollectionStatisticsRequest) (*milvuspb.GetCollectionStatisticsResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetCollectionStatisticsRequest) *milvuspb.GetCollectionStatisticsResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1450,7 +1629,6 @@ func (_m *MilvusServiceServer) GetCollectionStatistics(_a0 context.Context, _a1
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetCollectionStatisticsRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1466,8 +1644,8 @@ type MilvusServiceServer_GetCollectionStatistics_Call struct {
 }
 
 // GetCollectionStatistics is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetCollectionStatisticsRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetCollectionStatisticsRequest
 func (_e *MilvusServiceServer_Expecter) GetCollectionStatistics(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetCollectionStatistics_Call {
 	return &MilvusServiceServer_GetCollectionStatistics_Call{Call: _e.mock.On("GetCollectionStatistics", _a0, _a1)}
 }
@@ -1484,11 +1662,20 @@ func (_c *MilvusServiceServer_GetCollectionStatistics_Call) Return(_a0 *milvuspb
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetCollectionStatistics_Call) RunAndReturn(run func(context.Context, *milvuspb.GetCollectionStatisticsRequest) (*milvuspb.GetCollectionStatisticsResponse, error)) *MilvusServiceServer_GetCollectionStatistics_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetCompactionState provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetCompactionState(_a0 context.Context, _a1 *milvuspb.GetCompactionStateRequest) (*milvuspb.GetCompactionStateResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetCompactionStateResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetCompactionStateRequest) (*milvuspb.GetCompactionStateResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetCompactionStateRequest) *milvuspb.GetCompactionStateResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1497,7 +1684,6 @@ func (_m *MilvusServiceServer) GetCompactionState(_a0 context.Context, _a1 *milv
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetCompactionStateRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1513,8 +1699,8 @@ type MilvusServiceServer_GetCompactionState_Call struct {
 }
 
 // GetCompactionState is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetCompactionStateRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetCompactionStateRequest
 func (_e *MilvusServiceServer_Expecter) GetCompactionState(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetCompactionState_Call {
 	return &MilvusServiceServer_GetCompactionState_Call{Call: _e.mock.On("GetCompactionState", _a0, _a1)}
 }
@@ -1531,11 +1717,20 @@ func (_c *MilvusServiceServer_GetCompactionState_Call) Return(_a0 *milvuspb.GetC
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetCompactionState_Call) RunAndReturn(run func(context.Context, *milvuspb.GetCompactionStateRequest) (*milvuspb.GetCompactionStateResponse, error)) *MilvusServiceServer_GetCompactionState_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetCompactionStateWithPlans provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetCompactionStateWithPlans(_a0 context.Context, _a1 *milvuspb.GetCompactionPlansRequest) (*milvuspb.GetCompactionPlansResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetCompactionPlansResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetCompactionPlansRequest) (*milvuspb.GetCompactionPlansResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetCompactionPlansRequest) *milvuspb.GetCompactionPlansResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1544,7 +1739,6 @@ func (_m *MilvusServiceServer) GetCompactionStateWithPlans(_a0 context.Context,
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetCompactionPlansRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1560,8 +1754,8 @@ type MilvusServiceServer_GetCompactionStateWithPlans_Call struct {
 }
 
 // GetCompactionStateWithPlans is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetCompactionPlansRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetCompactionPlansRequest
 func (_e *MilvusServiceServer_Expecter) GetCompactionStateWithPlans(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetCompactionStateWithPlans_Call {
 	return &MilvusServiceServer_GetCompactionStateWithPlans_Call{Call: _e.mock.On("GetCompactionStateWithPlans", _a0, _a1)}
 }
@@ -1578,11 +1772,20 @@ func (_c *MilvusServiceServer_GetCompactionStateWithPlans_Call) Return(_a0 *milv
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetCompactionStateWithPlans_Call) RunAndReturn(run func(context.Context, *milvuspb.GetCompactionPlansRequest) (*milvuspb.GetCompactionPlansResponse, error)) *MilvusServiceServer_GetCompactionStateWithPlans_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetComponentStates provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetComponentStates(_a0 context.Context, _a1 *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.ComponentStates
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetComponentStatesRequest) *milvuspb.ComponentStates); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1591,7 +1794,6 @@ func (_m *MilvusServiceServer) GetComponentStates(_a0 context.Context, _a1 *milv
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetComponentStatesRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1607,8 +1809,8 @@ type MilvusServiceServer_GetComponentStates_Call struct {
 }
 
 // GetComponentStates is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetComponentStatesRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetComponentStatesRequest
 func (_e *MilvusServiceServer_Expecter) GetComponentStates(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetComponentStates_Call {
 	return &MilvusServiceServer_GetComponentStates_Call{Call: _e.mock.On("GetComponentStates", _a0, _a1)}
 }
@@ -1625,11 +1827,20 @@ func (_c *MilvusServiceServer_GetComponentStates_Call) Return(_a0 *milvuspb.Comp
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetComponentStates_Call) RunAndReturn(run func(context.Context, *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error)) *MilvusServiceServer_GetComponentStates_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetFlushAllState provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetFlushAllState(_a0 context.Context, _a1 *milvuspb.GetFlushAllStateRequest) (*milvuspb.GetFlushAllStateResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetFlushAllStateResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetFlushAllStateRequest) (*milvuspb.GetFlushAllStateResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetFlushAllStateRequest) *milvuspb.GetFlushAllStateResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1638,7 +1849,6 @@ func (_m *MilvusServiceServer) GetFlushAllState(_a0 context.Context, _a1 *milvus
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetFlushAllStateRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1654,8 +1864,8 @@ type MilvusServiceServer_GetFlushAllState_Call struct {
 }
 
 // GetFlushAllState is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetFlushAllStateRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetFlushAllStateRequest
 func (_e *MilvusServiceServer_Expecter) GetFlushAllState(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetFlushAllState_Call {
 	return &MilvusServiceServer_GetFlushAllState_Call{Call: _e.mock.On("GetFlushAllState", _a0, _a1)}
 }
@@ -1672,11 +1882,20 @@ func (_c *MilvusServiceServer_GetFlushAllState_Call) Return(_a0 *milvuspb.GetFlu
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetFlushAllState_Call) RunAndReturn(run func(context.Context, *milvuspb.GetFlushAllStateRequest) (*milvuspb.GetFlushAllStateResponse, error)) *MilvusServiceServer_GetFlushAllState_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetFlushState provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetFlushState(_a0 context.Context, _a1 *milvuspb.GetFlushStateRequest) (*milvuspb.GetFlushStateResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetFlushStateResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetFlushStateRequest) (*milvuspb.GetFlushStateResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetFlushStateRequest) *milvuspb.GetFlushStateResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1685,7 +1904,6 @@ func (_m *MilvusServiceServer) GetFlushState(_a0 context.Context, _a1 *milvuspb.
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetFlushStateRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1701,8 +1919,8 @@ type MilvusServiceServer_GetFlushState_Call struct {
 }
 
 // GetFlushState is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetFlushStateRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetFlushStateRequest
 func (_e *MilvusServiceServer_Expecter) GetFlushState(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetFlushState_Call {
 	return &MilvusServiceServer_GetFlushState_Call{Call: _e.mock.On("GetFlushState", _a0, _a1)}
 }
@@ -1719,11 +1937,20 @@ func (_c *MilvusServiceServer_GetFlushState_Call) Return(_a0 *milvuspb.GetFlushS
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetFlushState_Call) RunAndReturn(run func(context.Context, *milvuspb.GetFlushStateRequest) (*milvuspb.GetFlushStateResponse, error)) *MilvusServiceServer_GetFlushState_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetImportState provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetImportState(_a0 context.Context, _a1 *milvuspb.GetImportStateRequest) (*milvuspb.GetImportStateResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetImportStateResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetImportStateRequest) (*milvuspb.GetImportStateResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetImportStateRequest) *milvuspb.GetImportStateResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1732,7 +1959,6 @@ func (_m *MilvusServiceServer) GetImportState(_a0 context.Context, _a1 *milvuspb
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetImportStateRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1748,8 +1974,8 @@ type MilvusServiceServer_GetImportState_Call struct {
 }
 
 // GetImportState is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetImportStateRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetImportStateRequest
 func (_e *MilvusServiceServer_Expecter) GetImportState(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetImportState_Call {
 	return &MilvusServiceServer_GetImportState_Call{Call: _e.mock.On("GetImportState", _a0, _a1)}
 }
@@ -1766,11 +1992,20 @@ func (_c *MilvusServiceServer_GetImportState_Call) Return(_a0 *milvuspb.GetImpor
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetImportState_Call) RunAndReturn(run func(context.Context, *milvuspb.GetImportStateRequest) (*milvuspb.GetImportStateResponse, error)) *MilvusServiceServer_GetImportState_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetIndexBuildProgress provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetIndexBuildProgress(_a0 context.Context, _a1 *milvuspb.GetIndexBuildProgressRequest) (*milvuspb.GetIndexBuildProgressResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetIndexBuildProgressResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetIndexBuildProgressRequest) (*milvuspb.GetIndexBuildProgressResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetIndexBuildProgressRequest) *milvuspb.GetIndexBuildProgressResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1779,7 +2014,6 @@ func (_m *MilvusServiceServer) GetIndexBuildProgress(_a0 context.Context, _a1 *m
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetIndexBuildProgressRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1795,8 +2029,8 @@ type MilvusServiceServer_GetIndexBuildProgress_Call struct {
 }
 
 // GetIndexBuildProgress is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetIndexBuildProgressRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetIndexBuildProgressRequest
 func (_e *MilvusServiceServer_Expecter) GetIndexBuildProgress(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetIndexBuildProgress_Call {
 	return &MilvusServiceServer_GetIndexBuildProgress_Call{Call: _e.mock.On("GetIndexBuildProgress", _a0, _a1)}
 }
@@ -1813,11 +2047,20 @@ func (_c *MilvusServiceServer_GetIndexBuildProgress_Call) Return(_a0 *milvuspb.G
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetIndexBuildProgress_Call) RunAndReturn(run func(context.Context, *milvuspb.GetIndexBuildProgressRequest) (*milvuspb.GetIndexBuildProgressResponse, error)) *MilvusServiceServer_GetIndexBuildProgress_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetIndexState provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetIndexState(_a0 context.Context, _a1 *milvuspb.GetIndexStateRequest) (*milvuspb.GetIndexStateResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetIndexStateResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetIndexStateRequest) (*milvuspb.GetIndexStateResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetIndexStateRequest) *milvuspb.GetIndexStateResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1826,7 +2069,6 @@ func (_m *MilvusServiceServer) GetIndexState(_a0 context.Context, _a1 *milvuspb.
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetIndexStateRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1842,8 +2084,8 @@ type MilvusServiceServer_GetIndexState_Call struct {
 }
 
 // GetIndexState is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetIndexStateRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetIndexStateRequest
 func (_e *MilvusServiceServer_Expecter) GetIndexState(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetIndexState_Call {
 	return &MilvusServiceServer_GetIndexState_Call{Call: _e.mock.On("GetIndexState", _a0, _a1)}
 }
@@ -1912,6 +2154,10 @@ func (_m *MilvusServiceServer) GetLoadState(_a0 context.Context, _a1 *milvuspb.G
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetLoadStateResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetLoadStateRequest) (*milvuspb.GetLoadStateResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetLoadStateRequest) *milvuspb.GetLoadStateResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1920,7 +2166,6 @@ func (_m *MilvusServiceServer) GetLoadState(_a0 context.Context, _a1 *milvuspb.G
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetLoadStateRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1936,8 +2181,8 @@ type MilvusServiceServer_GetLoadState_Call struct {
 }
 
 // GetLoadState is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetLoadStateRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetLoadStateRequest
 func (_e *MilvusServiceServer_Expecter) GetLoadState(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetLoadState_Call {
 	return &MilvusServiceServer_GetLoadState_Call{Call: _e.mock.On("GetLoadState", _a0, _a1)}
 }
@@ -1954,11 +2199,20 @@ func (_c *MilvusServiceServer_GetLoadState_Call) Return(_a0 *milvuspb.GetLoadSta
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetLoadState_Call) RunAndReturn(run func(context.Context, *milvuspb.GetLoadStateRequest) (*milvuspb.GetLoadStateResponse, error)) *MilvusServiceServer_GetLoadState_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetLoadingProgress provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetLoadingProgress(_a0 context.Context, _a1 *milvuspb.GetLoadingProgressRequest) (*milvuspb.GetLoadingProgressResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetLoadingProgressResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetLoadingProgressRequest) (*milvuspb.GetLoadingProgressResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetLoadingProgressRequest) *milvuspb.GetLoadingProgressResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1967,7 +2221,6 @@ func (_m *MilvusServiceServer) GetLoadingProgress(_a0 context.Context, _a1 *milv
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetLoadingProgressRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1983,8 +2236,8 @@ type MilvusServiceServer_GetLoadingProgress_Call struct {
 }
 
 // GetLoadingProgress is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetLoadingProgressRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetLoadingProgressRequest
 func (_e *MilvusServiceServer_Expecter) GetLoadingProgress(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetLoadingProgress_Call {
 	return &MilvusServiceServer_GetLoadingProgress_Call{Call: _e.mock.On("GetLoadingProgress", _a0, _a1)}
 }
@@ -2001,11 +2254,20 @@ func (_c *MilvusServiceServer_GetLoadingProgress_Call) Return(_a0 *milvuspb.GetL
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetLoadingProgress_Call) RunAndReturn(run func(context.Context, *milvuspb.GetLoadingProgressRequest) (*milvuspb.GetLoadingProgressResponse, error)) *MilvusServiceServer_GetLoadingProgress_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetMetrics provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetMetrics(_a0 context.Context, _a1 *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetMetricsResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetMetricsRequest) *milvuspb.GetMetricsResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2014,7 +2276,6 @@ func (_m *MilvusServiceServer) GetMetrics(_a0 context.Context, _a1 *milvuspb.Get
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetMetricsRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2030,8 +2291,8 @@ type MilvusServiceServer_GetMetrics_Call struct {
 }
 
 // GetMetrics is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetMetricsRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetMetricsRequest
 func (_e *MilvusServiceServer_Expecter) GetMetrics(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetMetrics_Call {
 	return &MilvusServiceServer_GetMetrics_Call{Call: _e.mock.On("GetMetrics", _a0, _a1)}
 }
@@ -2048,11 +2309,20 @@ func (_c *MilvusServiceServer_GetMetrics_Call) Return(_a0 *milvuspb.GetMetricsRe
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetMetrics_Call) RunAndReturn(run func(context.Context, *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error)) *MilvusServiceServer_GetMetrics_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetPartitionStatistics provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetPartitionStatistics(_a0 context.Context, _a1 *milvuspb.GetPartitionStatisticsRequest) (*milvuspb.GetPartitionStatisticsResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetPartitionStatisticsResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetPartitionStatisticsRequest) (*milvuspb.GetPartitionStatisticsResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetPartitionStatisticsRequest) *milvuspb.GetPartitionStatisticsResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2061,7 +2331,6 @@ func (_m *MilvusServiceServer) GetPartitionStatistics(_a0 context.Context, _a1 *
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetPartitionStatisticsRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2077,8 +2346,8 @@ type MilvusServiceServer_GetPartitionStatistics_Call struct {
 }
 
 // GetPartitionStatistics is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetPartitionStatisticsRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetPartitionStatisticsRequest
 func (_e *MilvusServiceServer_Expecter) GetPartitionStatistics(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetPartitionStatistics_Call {
 	return &MilvusServiceServer_GetPartitionStatistics_Call{Call: _e.mock.On("GetPartitionStatistics", _a0, _a1)}
 }
@@ -2095,11 +2364,20 @@ func (_c *MilvusServiceServer_GetPartitionStatistics_Call) Return(_a0 *milvuspb.
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetPartitionStatistics_Call) RunAndReturn(run func(context.Context, *milvuspb.GetPartitionStatisticsRequest) (*milvuspb.GetPartitionStatisticsResponse, error)) *MilvusServiceServer_GetPartitionStatistics_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetPersistentSegmentInfo provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetPersistentSegmentInfo(_a0 context.Context, _a1 *milvuspb.GetPersistentSegmentInfoRequest) (*milvuspb.GetPersistentSegmentInfoResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetPersistentSegmentInfoResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetPersistentSegmentInfoRequest) (*milvuspb.GetPersistentSegmentInfoResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetPersistentSegmentInfoRequest) *milvuspb.GetPersistentSegmentInfoResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2108,7 +2386,6 @@ func (_m *MilvusServiceServer) GetPersistentSegmentInfo(_a0 context.Context, _a1
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetPersistentSegmentInfoRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2124,8 +2401,8 @@ type MilvusServiceServer_GetPersistentSegmentInfo_Call struct {
 }
 
 // GetPersistentSegmentInfo is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetPersistentSegmentInfoRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetPersistentSegmentInfoRequest
 func (_e *MilvusServiceServer_Expecter) GetPersistentSegmentInfo(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetPersistentSegmentInfo_Call {
 	return &MilvusServiceServer_GetPersistentSegmentInfo_Call{Call: _e.mock.On("GetPersistentSegmentInfo", _a0, _a1)}
 }
@@ -2142,11 +2419,20 @@ func (_c *MilvusServiceServer_GetPersistentSegmentInfo_Call) Return(_a0 *milvusp
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetPersistentSegmentInfo_Call) RunAndReturn(run func(context.Context, *milvuspb.GetPersistentSegmentInfoRequest) (*milvuspb.GetPersistentSegmentInfoResponse, error)) *MilvusServiceServer_GetPersistentSegmentInfo_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetQuerySegmentInfo provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetQuerySegmentInfo(_a0 context.Context, _a1 *milvuspb.GetQuerySegmentInfoRequest) (*milvuspb.GetQuerySegmentInfoResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetQuerySegmentInfoResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetQuerySegmentInfoRequest) (*milvuspb.GetQuerySegmentInfoResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetQuerySegmentInfoRequest) *milvuspb.GetQuerySegmentInfoResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2155,7 +2441,6 @@ func (_m *MilvusServiceServer) GetQuerySegmentInfo(_a0 context.Context, _a1 *mil
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetQuerySegmentInfoRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2171,8 +2456,8 @@ type MilvusServiceServer_GetQuerySegmentInfo_Call struct {
 }
 
 // GetQuerySegmentInfo is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetQuerySegmentInfoRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetQuerySegmentInfoRequest
 func (_e *MilvusServiceServer_Expecter) GetQuerySegmentInfo(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetQuerySegmentInfo_Call {
 	return &MilvusServiceServer_GetQuerySegmentInfo_Call{Call: _e.mock.On("GetQuerySegmentInfo", _a0, _a1)}
 }
@@ -2189,11 +2474,20 @@ func (_c *MilvusServiceServer_GetQuerySegmentInfo_Call) Return(_a0 *milvuspb.Get
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetQuerySegmentInfo_Call) RunAndReturn(run func(context.Context, *milvuspb.GetQuerySegmentInfoRequest) (*milvuspb.GetQuerySegmentInfoResponse, error)) *MilvusServiceServer_GetQuerySegmentInfo_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetReplicas provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetReplicas(_a0 context.Context, _a1 *milvuspb.GetReplicasRequest) (*milvuspb.GetReplicasResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetReplicasResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetReplicasRequest) (*milvuspb.GetReplicasResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetReplicasRequest) *milvuspb.GetReplicasResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2202,7 +2496,6 @@ func (_m *MilvusServiceServer) GetReplicas(_a0 context.Context, _a1 *milvuspb.Ge
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetReplicasRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2218,8 +2511,8 @@ type MilvusServiceServer_GetReplicas_Call struct {
 }
 
 // GetReplicas is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetReplicasRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetReplicasRequest
 func (_e *MilvusServiceServer_Expecter) GetReplicas(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetReplicas_Call {
 	return &MilvusServiceServer_GetReplicas_Call{Call: _e.mock.On("GetReplicas", _a0, _a1)}
 }
@@ -2236,11 +2529,20 @@ func (_c *MilvusServiceServer_GetReplicas_Call) Return(_a0 *milvuspb.GetReplicas
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetReplicas_Call) RunAndReturn(run func(context.Context, *milvuspb.GetReplicasRequest) (*milvuspb.GetReplicasResponse, error)) *MilvusServiceServer_GetReplicas_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetVersion provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetVersion(_a0 context.Context, _a1 *milvuspb.GetVersionRequest) (*milvuspb.GetVersionResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetVersionResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetVersionRequest) (*milvuspb.GetVersionResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetVersionRequest) *milvuspb.GetVersionResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2249,7 +2551,6 @@ func (_m *MilvusServiceServer) GetVersion(_a0 context.Context, _a1 *milvuspb.Get
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetVersionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2265,8 +2566,8 @@ type MilvusServiceServer_GetVersion_Call struct {
 }
 
 // GetVersion is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetVersionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetVersionRequest
 func (_e *MilvusServiceServer_Expecter) GetVersion(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetVersion_Call {
 	return &MilvusServiceServer_GetVersion_Call{Call: _e.mock.On("GetVersion", _a0, _a1)}
 }
@@ -2283,11 +2584,20 @@ func (_c *MilvusServiceServer_GetVersion_Call) Return(_a0 *milvuspb.GetVersionRe
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetVersion_Call) RunAndReturn(run func(context.Context, *milvuspb.GetVersionRequest) (*milvuspb.GetVersionResponse, error)) *MilvusServiceServer_GetVersion_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // HasCollection provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) HasCollection(_a0 context.Context, _a1 *milvuspb.HasCollectionRequest) (*milvuspb.BoolResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.BoolResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.HasCollectionRequest) (*milvuspb.BoolResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.HasCollectionRequest) *milvuspb.BoolResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2296,7 +2606,6 @@ func (_m *MilvusServiceServer) HasCollection(_a0 context.Context, _a1 *milvuspb.
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.HasCollectionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2312,8 +2621,8 @@ type MilvusServiceServer_HasCollection_Call struct {
 }
 
 // HasCollection is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.HasCollectionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.HasCollectionRequest
 func (_e *MilvusServiceServer_Expecter) HasCollection(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_HasCollection_Call {
 	return &MilvusServiceServer_HasCollection_Call{Call: _e.mock.On("HasCollection", _a0, _a1)}
 }
@@ -2330,11 +2639,20 @@ func (_c *MilvusServiceServer_HasCollection_Call) Return(_a0 *milvuspb.BoolRespo
 	return _c
 }
 
+func (_c *MilvusServiceServer_HasCollection_Call) RunAndReturn(run func(context.Context, *milvuspb.HasCollectionRequest) (*milvuspb.BoolResponse, error)) *MilvusServiceServer_HasCollection_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // HasPartition provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) HasPartition(_a0 context.Context, _a1 *milvuspb.HasPartitionRequest) (*milvuspb.BoolResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.BoolResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.HasPartitionRequest) (*milvuspb.BoolResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.HasPartitionRequest) *milvuspb.BoolResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2343,7 +2661,6 @@ func (_m *MilvusServiceServer) HasPartition(_a0 context.Context, _a1 *milvuspb.H
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.HasPartitionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2359,8 +2676,8 @@ type MilvusServiceServer_HasPartition_Call struct {
 }
 
 // HasPartition is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.HasPartitionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.HasPartitionRequest
 func (_e *MilvusServiceServer_Expecter) HasPartition(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_HasPartition_Call {
 	return &MilvusServiceServer_HasPartition_Call{Call: _e.mock.On("HasPartition", _a0, _a1)}
 }
@@ -2377,11 +2694,20 @@ func (_c *MilvusServiceServer_HasPartition_Call) Return(_a0 *milvuspb.BoolRespon
 	return _c
 }
 
+func (_c *MilvusServiceServer_HasPartition_Call) RunAndReturn(run func(context.Context, *milvuspb.HasPartitionRequest) (*milvuspb.BoolResponse, error)) *MilvusServiceServer_HasPartition_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // Import provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) Import(_a0 context.Context, _a1 *milvuspb.ImportRequest) (*milvuspb.ImportResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.ImportResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ImportRequest) (*milvuspb.ImportResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ImportRequest) *milvuspb.ImportResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2390,7 +2716,6 @@ func (_m *MilvusServiceServer) Import(_a0 context.Context, _a1 *milvuspb.ImportR
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.ImportRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2406,8 +2731,8 @@ type MilvusServiceServer_Import_Call struct {
 }
 
 // Import is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.ImportRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.ImportRequest
 func (_e *MilvusServiceServer_Expecter) Import(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_Import_Call {
 	return &MilvusServiceServer_Import_Call{Call: _e.mock.On("Import", _a0, _a1)}
 }
@@ -2424,11 +2749,20 @@ func (_c *MilvusServiceServer_Import_Call) Return(_a0 *milvuspb.ImportResponse,
 	return _c
 }
 
+func (_c *MilvusServiceServer_Import_Call) RunAndReturn(run func(context.Context, *milvuspb.ImportRequest) (*milvuspb.ImportResponse, error)) *MilvusServiceServer_Import_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // Insert provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) Insert(_a0 context.Context, _a1 *milvuspb.InsertRequest) (*milvuspb.MutationResult, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.MutationResult
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.InsertRequest) (*milvuspb.MutationResult, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.InsertRequest) *milvuspb.MutationResult); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2437,7 +2771,6 @@ func (_m *MilvusServiceServer) Insert(_a0 context.Context, _a1 *milvuspb.InsertR
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.InsertRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2453,8 +2786,8 @@ type MilvusServiceServer_Insert_Call struct {
 }
 
 // Insert is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.InsertRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.InsertRequest
 func (_e *MilvusServiceServer_Expecter) Insert(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_Insert_Call {
 	return &MilvusServiceServer_Insert_Call{Call: _e.mock.On("Insert", _a0, _a1)}
 }
@@ -2523,6 +2856,10 @@ func (_m *MilvusServiceServer) ListCredUsers(_a0 context.Context, _a1 *milvuspb.
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.ListCredUsersResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ListCredUsersRequest) (*milvuspb.ListCredUsersResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ListCredUsersRequest) *milvuspb.ListCredUsersResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2531,7 +2868,6 @@ func (_m *MilvusServiceServer) ListCredUsers(_a0 context.Context, _a1 *milvuspb.
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.ListCredUsersRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2547,8 +2883,8 @@ type MilvusServiceServer_ListCredUsers_Call struct {
 }
 
 // ListCredUsers is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.ListCredUsersRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.ListCredUsersRequest
 func (_e *MilvusServiceServer_Expecter) ListCredUsers(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_ListCredUsers_Call {
 	return &MilvusServiceServer_ListCredUsers_Call{Call: _e.mock.On("ListCredUsers", _a0, _a1)}
 }
@@ -2617,6 +2953,10 @@ func (_m *MilvusServiceServer) ListImportTasks(_a0 context.Context, _a1 *milvusp
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.ListImportTasksResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ListImportTasksRequest) (*milvuspb.ListImportTasksResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ListImportTasksRequest) *milvuspb.ListImportTasksResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2625,7 +2965,6 @@ func (_m *MilvusServiceServer) ListImportTasks(_a0 context.Context, _a1 *milvusp
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.ListImportTasksRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2641,8 +2980,8 @@ type MilvusServiceServer_ListImportTasks_Call struct {
 }
 
 // ListImportTasks is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.ListImportTasksRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.ListImportTasksRequest
 func (_e *MilvusServiceServer_Expecter) ListImportTasks(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_ListImportTasks_Call {
 	return &MilvusServiceServer_ListImportTasks_Call{Call: _e.mock.On("ListImportTasks", _a0, _a1)}
 }
@@ -2711,6 +3050,10 @@ func (_m *MilvusServiceServer) ListResourceGroups(_a0 context.Context, _a1 *milv
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.ListResourceGroupsResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ListResourceGroupsRequest) (*milvuspb.ListResourceGroupsResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ListResourceGroupsRequest) *milvuspb.ListResourceGroupsResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2719,7 +3062,6 @@ func (_m *MilvusServiceServer) ListResourceGroups(_a0 context.Context, _a1 *milv
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.ListResourceGroupsRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2735,8 +3077,8 @@ type MilvusServiceServer_ListResourceGroups_Call struct {
 }
 
 // ListResourceGroups is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.ListResourceGroupsRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.ListResourceGroupsRequest
 func (_e *MilvusServiceServer_Expecter) ListResourceGroups(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_ListResourceGroups_Call {
 	return &MilvusServiceServer_ListResourceGroups_Call{Call: _e.mock.On("ListResourceGroups", _a0, _a1)}
 }
@@ -2753,11 +3095,20 @@ func (_c *MilvusServiceServer_ListResourceGroups_Call) Return(_a0 *milvuspb.List
 	return _c
 }
 
+func (_c *MilvusServiceServer_ListResourceGroups_Call) RunAndReturn(run func(context.Context, *milvuspb.ListResourceGroupsRequest) (*milvuspb.ListResourceGroupsResponse, error)) *MilvusServiceServer_ListResourceGroups_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // LoadBalance provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) LoadBalance(_a0 context.Context, _a1 *milvuspb.LoadBalanceRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.LoadBalanceRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.LoadBalanceRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2766,7 +3117,6 @@ func (_m *MilvusServiceServer) LoadBalance(_a0 context.Context, _a1 *milvuspb.Lo
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.LoadBalanceRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2782,8 +3132,8 @@ type MilvusServiceServer_LoadBalance_Call struct {
 }
 
 // LoadBalance is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.LoadBalanceRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.LoadBalanceRequest
 func (_e *MilvusServiceServer_Expecter) LoadBalance(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_LoadBalance_Call {
 	return &MilvusServiceServer_LoadBalance_Call{Call: _e.mock.On("LoadBalance", _a0, _a1)}
 }
@@ -2800,11 +3150,20 @@ func (_c *MilvusServiceServer_LoadBalance_Call) Return(_a0 *commonpb.Status, _a1
 	return _c
 }
 
+func (_c *MilvusServiceServer_LoadBalance_Call) RunAndReturn(run func(context.Context, *milvuspb.LoadBalanceRequest) (*commonpb.Status, error)) *MilvusServiceServer_LoadBalance_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // LoadCollection provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) LoadCollection(_a0 context.Context, _a1 *milvuspb.LoadCollectionRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.LoadCollectionRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.LoadCollectionRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2813,7 +3172,6 @@ func (_m *MilvusServiceServer) LoadCollection(_a0 context.Context, _a1 *milvuspb
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.LoadCollectionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2829,8 +3187,8 @@ type MilvusServiceServer_LoadCollection_Call struct {
 }
 
 // LoadCollection is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.LoadCollectionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.LoadCollectionRequest
 func (_e *MilvusServiceServer_Expecter) LoadCollection(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_LoadCollection_Call {
 	return &MilvusServiceServer_LoadCollection_Call{Call: _e.mock.On("LoadCollection", _a0, _a1)}
 }
@@ -2847,11 +3205,20 @@ func (_c *MilvusServiceServer_LoadCollection_Call) Return(_a0 *commonpb.Status,
 	return _c
 }
 
+func (_c *MilvusServiceServer_LoadCollection_Call) RunAndReturn(run func(context.Context, *milvuspb.LoadCollectionRequest) (*commonpb.Status, error)) *MilvusServiceServer_LoadCollection_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // LoadPartitions provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) LoadPartitions(_a0 context.Context, _a1 *milvuspb.LoadPartitionsRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.LoadPartitionsRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.LoadPartitionsRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2860,7 +3227,6 @@ func (_m *MilvusServiceServer) LoadPartitions(_a0 context.Context, _a1 *milvuspb
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.LoadPartitionsRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2876,8 +3242,8 @@ type MilvusServiceServer_LoadPartitions_Call struct {
 }
 
 // LoadPartitions is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.LoadPartitionsRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.LoadPartitionsRequest
 func (_e *MilvusServiceServer_Expecter) LoadPartitions(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_LoadPartitions_Call {
 	return &MilvusServiceServer_LoadPartitions_Call{Call: _e.mock.On("LoadPartitions", _a0, _a1)}
 }
@@ -2894,11 +3260,20 @@ func (_c *MilvusServiceServer_LoadPartitions_Call) Return(_a0 *commonpb.Status,
 	return _c
 }
 
+func (_c *MilvusServiceServer_LoadPartitions_Call) RunAndReturn(run func(context.Context, *milvuspb.LoadPartitionsRequest) (*commonpb.Status, error)) *MilvusServiceServer_LoadPartitions_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // ManualCompaction provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) ManualCompaction(_a0 context.Context, _a1 *milvuspb.ManualCompactionRequest) (*milvuspb.ManualCompactionResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.ManualCompactionResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ManualCompactionRequest) (*milvuspb.ManualCompactionResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ManualCompactionRequest) *milvuspb.ManualCompactionResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2907,7 +3282,6 @@ func (_m *MilvusServiceServer) ManualCompaction(_a0 context.Context, _a1 *milvus
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.ManualCompactionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2923,8 +3297,8 @@ type MilvusServiceServer_ManualCompaction_Call struct {
 }
 
 // ManualCompaction is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.ManualCompactionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.ManualCompactionRequest
 func (_e *MilvusServiceServer_Expecter) ManualCompaction(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_ManualCompaction_Call {
 	return &MilvusServiceServer_ManualCompaction_Call{Call: _e.mock.On("ManualCompaction", _a0, _a1)}
 }
@@ -2941,11 +3315,20 @@ func (_c *MilvusServiceServer_ManualCompaction_Call) Return(_a0 *milvuspb.Manual
 	return _c
 }
 
+func (_c *MilvusServiceServer_ManualCompaction_Call) RunAndReturn(run func(context.Context, *milvuspb.ManualCompactionRequest) (*milvuspb.ManualCompactionResponse, error)) *MilvusServiceServer_ManualCompaction_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // OperatePrivilege provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) OperatePrivilege(_a0 context.Context, _a1 *milvuspb.OperatePrivilegeRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.OperatePrivilegeRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.OperatePrivilegeRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2954,7 +3337,6 @@ func (_m *MilvusServiceServer) OperatePrivilege(_a0 context.Context, _a1 *milvus
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.OperatePrivilegeRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2970,8 +3352,8 @@ type MilvusServiceServer_OperatePrivilege_Call struct {
 }
 
 // OperatePrivilege is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.OperatePrivilegeRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.OperatePrivilegeRequest
 func (_e *MilvusServiceServer_Expecter) OperatePrivilege(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_OperatePrivilege_Call {
 	return &MilvusServiceServer_OperatePrivilege_Call{Call: _e.mock.On("OperatePrivilege", _a0, _a1)}
 }
@@ -2988,11 +3370,20 @@ func (_c *MilvusServiceServer_OperatePrivilege_Call) Return(_a0 *commonpb.Status
 	return _c
 }
 
+func (_c *MilvusServiceServer_OperatePrivilege_Call) RunAndReturn(run func(context.Context, *milvuspb.OperatePrivilegeRequest) (*commonpb.Status, error)) *MilvusServiceServer_OperatePrivilege_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // OperateUserRole provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) OperateUserRole(_a0 context.Context, _a1 *milvuspb.OperateUserRoleRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.OperateUserRoleRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.OperateUserRoleRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3001,7 +3392,6 @@ func (_m *MilvusServiceServer) OperateUserRole(_a0 context.Context, _a1 *milvusp
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.OperateUserRoleRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3017,8 +3407,8 @@ type MilvusServiceServer_OperateUserRole_Call struct {
 }
 
 // OperateUserRole is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.OperateUserRoleRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.OperateUserRoleRequest
 func (_e *MilvusServiceServer_Expecter) OperateUserRole(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_OperateUserRole_Call {
 	return &MilvusServiceServer_OperateUserRole_Call{Call: _e.mock.On("OperateUserRole", _a0, _a1)}
 }
@@ -3035,11 +3425,20 @@ func (_c *MilvusServiceServer_OperateUserRole_Call) Return(_a0 *commonpb.Status,
 	return _c
 }
 
+func (_c *MilvusServiceServer_OperateUserRole_Call) RunAndReturn(run func(context.Context, *milvuspb.OperateUserRoleRequest) (*commonpb.Status, error)) *MilvusServiceServer_OperateUserRole_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // Query provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) Query(_a0 context.Context, _a1 *milvuspb.QueryRequest) (*milvuspb.QueryResults, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.QueryResults
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.QueryRequest) (*milvuspb.QueryResults, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.QueryRequest) *milvuspb.QueryResults); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3048,7 +3447,6 @@ func (_m *MilvusServiceServer) Query(_a0 context.Context, _a1 *milvuspb.QueryReq
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.QueryRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3064,8 +3462,8 @@ type MilvusServiceServer_Query_Call struct {
 }
 
 // Query is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.QueryRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.QueryRequest
 func (_e *MilvusServiceServer_Expecter) Query(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_Query_Call {
 	return &MilvusServiceServer_Query_Call{Call: _e.mock.On("Query", _a0, _a1)}
 }
@@ -3082,11 +3480,20 @@ func (_c *MilvusServiceServer_Query_Call) Return(_a0 *milvuspb.QueryResults, _a1
 	return _c
 }
 
+func (_c *MilvusServiceServer_Query_Call) RunAndReturn(run func(context.Context, *milvuspb.QueryRequest) (*milvuspb.QueryResults, error)) *MilvusServiceServer_Query_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // RegisterLink provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) RegisterLink(_a0 context.Context, _a1 *milvuspb.RegisterLinkRequest) (*milvuspb.RegisterLinkResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.RegisterLinkResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.RegisterLinkRequest) (*milvuspb.RegisterLinkResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.RegisterLinkRequest) *milvuspb.RegisterLinkResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3095,7 +3502,6 @@ func (_m *MilvusServiceServer) RegisterLink(_a0 context.Context, _a1 *milvuspb.R
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.RegisterLinkRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3111,8 +3517,8 @@ type MilvusServiceServer_RegisterLink_Call struct {
 }
 
 // RegisterLink is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.RegisterLinkRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.RegisterLinkRequest
 func (_e *MilvusServiceServer_Expecter) RegisterLink(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_RegisterLink_Call {
 	return &MilvusServiceServer_RegisterLink_Call{Call: _e.mock.On("RegisterLink", _a0, _a1)}
 }
@@ -3129,11 +3535,20 @@ func (_c *MilvusServiceServer_RegisterLink_Call) Return(_a0 *milvuspb.RegisterLi
 	return _c
 }
 
+func (_c *MilvusServiceServer_RegisterLink_Call) RunAndReturn(run func(context.Context, *milvuspb.RegisterLinkRequest) (*milvuspb.RegisterLinkResponse, error)) *MilvusServiceServer_RegisterLink_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // ReleaseCollection provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) ReleaseCollection(_a0 context.Context, _a1 *milvuspb.ReleaseCollectionRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ReleaseCollectionRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ReleaseCollectionRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3142,7 +3557,6 @@ func (_m *MilvusServiceServer) ReleaseCollection(_a0 context.Context, _a1 *milvu
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.ReleaseCollectionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3158,8 +3572,8 @@ type MilvusServiceServer_ReleaseCollection_Call struct {
 }
 
 // ReleaseCollection is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.ReleaseCollectionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.ReleaseCollectionRequest
 func (_e *MilvusServiceServer_Expecter) ReleaseCollection(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_ReleaseCollection_Call {
 	return &MilvusServiceServer_ReleaseCollection_Call{Call: _e.mock.On("ReleaseCollection", _a0, _a1)}
 }
@@ -3176,11 +3590,20 @@ func (_c *MilvusServiceServer_ReleaseCollection_Call) Return(_a0 *commonpb.Statu
 	return _c
 }
 
+func (_c *MilvusServiceServer_ReleaseCollection_Call) RunAndReturn(run func(context.Context, *milvuspb.ReleaseCollectionRequest) (*commonpb.Status, error)) *MilvusServiceServer_ReleaseCollection_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // ReleasePartitions provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) ReleasePartitions(_a0 context.Context, _a1 *milvuspb.ReleasePartitionsRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ReleasePartitionsRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ReleasePartitionsRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3189,7 +3612,6 @@ func (_m *MilvusServiceServer) ReleasePartitions(_a0 context.Context, _a1 *milvu
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.ReleasePartitionsRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3205,8 +3627,8 @@ type MilvusServiceServer_ReleasePartitions_Call struct {
 }
 
 // ReleasePartitions is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.ReleasePartitionsRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.ReleasePartitionsRequest
 func (_e *MilvusServiceServer_Expecter) ReleasePartitions(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_ReleasePartitions_Call {
 	return &MilvusServiceServer_ReleasePartitions_Call{Call: _e.mock.On("ReleasePartitions", _a0, _a1)}
 }
@@ -3223,11 +3645,20 @@ func (_c *MilvusServiceServer_ReleasePartitions_Call) Return(_a0 *commonpb.Statu
 	return _c
 }
 
+func (_c *MilvusServiceServer_ReleasePartitions_Call) RunAndReturn(run func(context.Context, *milvuspb.ReleasePartitionsRequest) (*commonpb.Status, error)) *MilvusServiceServer_ReleasePartitions_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // RenameCollection provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) RenameCollection(_a0 context.Context, _a1 *milvuspb.RenameCollectionRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.RenameCollectionRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.RenameCollectionRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3236,7 +3667,6 @@ func (_m *MilvusServiceServer) RenameCollection(_a0 context.Context, _a1 *milvus
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.RenameCollectionRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3252,8 +3682,8 @@ type MilvusServiceServer_RenameCollection_Call struct {
 }
 
 // RenameCollection is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.RenameCollectionRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.RenameCollectionRequest
 func (_e *MilvusServiceServer_Expecter) RenameCollection(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_RenameCollection_Call {
 	return &MilvusServiceServer_RenameCollection_Call{Call: _e.mock.On("RenameCollection", _a0, _a1)}
 }
@@ -3270,11 +3700,20 @@ func (_c *MilvusServiceServer_RenameCollection_Call) Return(_a0 *commonpb.Status
 	return _c
 }
 
+func (_c *MilvusServiceServer_RenameCollection_Call) RunAndReturn(run func(context.Context, *milvuspb.RenameCollectionRequest) (*commonpb.Status, error)) *MilvusServiceServer_RenameCollection_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // Search provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) Search(_a0 context.Context, _a1 *milvuspb.SearchRequest) (*milvuspb.SearchResults, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.SearchResults
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.SearchRequest) (*milvuspb.SearchResults, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.SearchRequest) *milvuspb.SearchResults); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3283,7 +3722,6 @@ func (_m *MilvusServiceServer) Search(_a0 context.Context, _a1 *milvuspb.SearchR
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.SearchRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3299,8 +3737,8 @@ type MilvusServiceServer_Search_Call struct {
 }
 
 // Search is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.SearchRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.SearchRequest
 func (_e *MilvusServiceServer_Expecter) Search(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_Search_Call {
 	return &MilvusServiceServer_Search_Call{Call: _e.mock.On("Search", _a0, _a1)}
 }
@@ -3317,11 +3755,20 @@ func (_c *MilvusServiceServer_Search_Call) Return(_a0 *milvuspb.SearchResults, _
 	return _c
 }
 
+func (_c *MilvusServiceServer_Search_Call) RunAndReturn(run func(context.Context, *milvuspb.SearchRequest) (*milvuspb.SearchResults, error)) *MilvusServiceServer_Search_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // SelectGrant provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) SelectGrant(_a0 context.Context, _a1 *milvuspb.SelectGrantRequest) (*milvuspb.SelectGrantResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.SelectGrantResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.SelectGrantRequest) (*milvuspb.SelectGrantResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.SelectGrantRequest) *milvuspb.SelectGrantResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3330,7 +3777,6 @@ func (_m *MilvusServiceServer) SelectGrant(_a0 context.Context, _a1 *milvuspb.Se
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.SelectGrantRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3346,8 +3792,8 @@ type MilvusServiceServer_SelectGrant_Call struct {
 }
 
 // SelectGrant is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.SelectGrantRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.SelectGrantRequest
 func (_e *MilvusServiceServer_Expecter) SelectGrant(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_SelectGrant_Call {
 	return &MilvusServiceServer_SelectGrant_Call{Call: _e.mock.On("SelectGrant", _a0, _a1)}
 }
@@ -3364,11 +3810,20 @@ func (_c *MilvusServiceServer_SelectGrant_Call) Return(_a0 *milvuspb.SelectGrant
 	return _c
 }
 
+func (_c *MilvusServiceServer_SelectGrant_Call) RunAndReturn(run func(context.Context, *milvuspb.SelectGrantRequest) (*milvuspb.SelectGrantResponse, error)) *MilvusServiceServer_SelectGrant_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // SelectRole provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) SelectRole(_a0 context.Context, _a1 *milvuspb.SelectRoleRequest) (*milvuspb.SelectRoleResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.SelectRoleResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.SelectRoleRequest) (*milvuspb.SelectRoleResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.SelectRoleRequest) *milvuspb.SelectRoleResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3377,7 +3832,6 @@ func (_m *MilvusServiceServer) SelectRole(_a0 context.Context, _a1 *milvuspb.Sel
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.SelectRoleRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3393,8 +3847,8 @@ type MilvusServiceServer_SelectRole_Call struct {
 }
 
 // SelectRole is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.SelectRoleRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.SelectRoleRequest
 func (_e *MilvusServiceServer_Expecter) SelectRole(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_SelectRole_Call {
 	return &MilvusServiceServer_SelectRole_Call{Call: _e.mock.On("SelectRole", _a0, _a1)}
 }
@@ -3411,11 +3865,20 @@ func (_c *MilvusServiceServer_SelectRole_Call) Return(_a0 *milvuspb.SelectRoleRe
 	return _c
 }
 
+func (_c *MilvusServiceServer_SelectRole_Call) RunAndReturn(run func(context.Context, *milvuspb.SelectRoleRequest) (*milvuspb.SelectRoleResponse, error)) *MilvusServiceServer_SelectRole_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // SelectUser provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) SelectUser(_a0 context.Context, _a1 *milvuspb.SelectUserRequest) (*milvuspb.SelectUserResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.SelectUserResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.SelectUserRequest) (*milvuspb.SelectUserResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.SelectUserRequest) *milvuspb.SelectUserResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3424,7 +3887,6 @@ func (_m *MilvusServiceServer) SelectUser(_a0 context.Context, _a1 *milvuspb.Sel
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.SelectUserRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3440,8 +3902,8 @@ type MilvusServiceServer_SelectUser_Call struct {
 }
 
 // SelectUser is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.SelectUserRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.SelectUserRequest
 func (_e *MilvusServiceServer_Expecter) SelectUser(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_SelectUser_Call {
 	return &MilvusServiceServer_SelectUser_Call{Call: _e.mock.On("SelectUser", _a0, _a1)}
 }
@@ -3458,11 +3920,20 @@ func (_c *MilvusServiceServer_SelectUser_Call) Return(_a0 *milvuspb.SelectUserRe
 	return _c
 }
 
+func (_c *MilvusServiceServer_SelectUser_Call) RunAndReturn(run func(context.Context, *milvuspb.SelectUserRequest) (*milvuspb.SelectUserResponse, error)) *MilvusServiceServer_SelectUser_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // ShowCollections provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) ShowCollections(_a0 context.Context, _a1 *milvuspb.ShowCollectionsRequest) (*milvuspb.ShowCollectionsResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.ShowCollectionsResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ShowCollectionsRequest) (*milvuspb.ShowCollectionsResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ShowCollectionsRequest) *milvuspb.ShowCollectionsResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3471,7 +3942,6 @@ func (_m *MilvusServiceServer) ShowCollections(_a0 context.Context, _a1 *milvusp
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.ShowCollectionsRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3487,8 +3957,8 @@ type MilvusServiceServer_ShowCollections_Call struct {
 }
 
 // ShowCollections is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.ShowCollectionsRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.ShowCollectionsRequest
 func (_e *MilvusServiceServer_Expecter) ShowCollections(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_ShowCollections_Call {
 	return &MilvusServiceServer_ShowCollections_Call{Call: _e.mock.On("ShowCollections", _a0, _a1)}
 }
@@ -3505,11 +3975,20 @@ func (_c *MilvusServiceServer_ShowCollections_Call) Return(_a0 *milvuspb.ShowCol
 	return _c
 }
 
+func (_c *MilvusServiceServer_ShowCollections_Call) RunAndReturn(run func(context.Context, *milvuspb.ShowCollectionsRequest) (*milvuspb.ShowCollectionsResponse, error)) *MilvusServiceServer_ShowCollections_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // ShowPartitions provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) ShowPartitions(_a0 context.Context, _a1 *milvuspb.ShowPartitionsRequest) (*milvuspb.ShowPartitionsResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.ShowPartitionsResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ShowPartitionsRequest) (*milvuspb.ShowPartitionsResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ShowPartitionsRequest) *milvuspb.ShowPartitionsResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3518,7 +3997,6 @@ func (_m *MilvusServiceServer) ShowPartitions(_a0 context.Context, _a1 *milvuspb
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.ShowPartitionsRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3534,8 +4012,8 @@ type MilvusServiceServer_ShowPartitions_Call struct {
 }
 
 // ShowPartitions is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.ShowPartitionsRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.ShowPartitionsRequest
 func (_e *MilvusServiceServer_Expecter) ShowPartitions(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_ShowPartitions_Call {
 	return &MilvusServiceServer_ShowPartitions_Call{Call: _e.mock.On("ShowPartitions", _a0, _a1)}
 }
@@ -3552,11 +4030,20 @@ func (_c *MilvusServiceServer_ShowPartitions_Call) Return(_a0 *milvuspb.ShowPart
 	return _c
 }
 
+func (_c *MilvusServiceServer_ShowPartitions_Call) RunAndReturn(run func(context.Context, *milvuspb.ShowPartitionsRequest) (*milvuspb.ShowPartitionsResponse, error)) *MilvusServiceServer_ShowPartitions_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // TransferNode provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) TransferNode(_a0 context.Context, _a1 *milvuspb.TransferNodeRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.TransferNodeRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.TransferNodeRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3565,7 +4052,6 @@ func (_m *MilvusServiceServer) TransferNode(_a0 context.Context, _a1 *milvuspb.T
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.TransferNodeRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3581,8 +4067,8 @@ type MilvusServiceServer_TransferNode_Call struct {
 }
 
 // TransferNode is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.TransferNodeRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.TransferNodeRequest
 func (_e *MilvusServiceServer_Expecter) TransferNode(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_TransferNode_Call {
 	return &MilvusServiceServer_TransferNode_Call{Call: _e.mock.On("TransferNode", _a0, _a1)}
 }
@@ -3599,11 +4085,20 @@ func (_c *MilvusServiceServer_TransferNode_Call) Return(_a0 *commonpb.Status, _a
 	return _c
 }
 
+func (_c *MilvusServiceServer_TransferNode_Call) RunAndReturn(run func(context.Context, *milvuspb.TransferNodeRequest) (*commonpb.Status, error)) *MilvusServiceServer_TransferNode_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // TransferReplica provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) TransferReplica(_a0 context.Context, _a1 *milvuspb.TransferReplicaRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.TransferReplicaRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.TransferReplicaRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3612,7 +4107,6 @@ func (_m *MilvusServiceServer) TransferReplica(_a0 context.Context, _a1 *milvusp
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.TransferReplicaRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3628,8 +4122,8 @@ type MilvusServiceServer_TransferReplica_Call struct {
 }
 
 // TransferReplica is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.TransferReplicaRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.TransferReplicaRequest
 func (_e *MilvusServiceServer_Expecter) TransferReplica(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_TransferReplica_Call {
 	return &MilvusServiceServer_TransferReplica_Call{Call: _e.mock.On("TransferReplica", _a0, _a1)}
 }
@@ -3646,11 +4140,20 @@ func (_c *MilvusServiceServer_TransferReplica_Call) Return(_a0 *commonpb.Status,
 	return _c
 }
 
+func (_c *MilvusServiceServer_TransferReplica_Call) RunAndReturn(run func(context.Context, *milvuspb.TransferReplicaRequest) (*commonpb.Status, error)) *MilvusServiceServer_TransferReplica_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // UpdateCredential provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) UpdateCredential(_a0 context.Context, _a1 *milvuspb.UpdateCredentialRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *commonpb.Status
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.UpdateCredentialRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.UpdateCredentialRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3659,7 +4162,6 @@ func (_m *MilvusServiceServer) UpdateCredential(_a0 context.Context, _a1 *milvus
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.UpdateCredentialRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3675,8 +4177,8 @@ type MilvusServiceServer_UpdateCredential_Call struct {
 }
 
 // UpdateCredential is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.UpdateCredentialRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.UpdateCredentialRequest
 func (_e *MilvusServiceServer_Expecter) UpdateCredential(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_UpdateCredential_Call {
 	return &MilvusServiceServer_UpdateCredential_Call{Call: _e.mock.On("UpdateCredential", _a0, _a1)}
 }


Test patch:
diff --git a/client/client_mock_test.go b/client/client_mock_test.go
index e8b543d..2583a05 100644
--- a/client/client_mock_test.go
+++ b/client/client_mock_test.go
@@ -17,7 +17,6 @@ import (
 	"github.com/stretchr/testify/mock"
 	"github.com/stretchr/testify/suite"
 	"google.golang.org/grpc"
-	"google.golang.org/grpc/credentials/insecure"
 	"google.golang.org/grpc/test/bufconn"
 )
 
@@ -58,11 +57,15 @@ func (s *MockSuiteBase) mockDialer(context.Context, string) (net.Conn, error) {
 }
 
 func (s *MockSuiteBase) SetupTest() {
-	c, err := NewGrpcClient(context.Background(), "bufnet2",
-		grpc.WithBlock(),
-		grpc.WithContextDialer(s.mockDialer),
-		grpc.WithTransportCredentials(insecure.NewCredentials()),
-	)
+	c, err := NewClient(context.Background(), Config{
+		Address:     "bufnet2",
+		DisableConn: true,
+		DialOptions: []grpc.DialOption{
+			grpc.WithBlock(),
+			grpc.WithInsecure(),
+			grpc.WithContextDialer(s.mockDialer),
+		},
+	})
 	s.Require().NoError(err)
 	s.setupConnect()
 
@@ -220,9 +223,7 @@ func (s *MockSuiteBase) getFloatVectorFieldData(name string, dim int64, data []f
 
 // ref https://stackoverflow.com/questions/42102496/testing-a-grpc-service
 
-var (
-	errNotImplemented = errors.New("not implemented")
-)
+var errNotImplemented = errors.New("not implemented")
 
 // type alias for Service method
 type ServiceMethod int
@@ -283,6 +284,10 @@ const (
 	MGetComponentStates ServiceMethod = 900
 	MGetVersion         ServiceMethod = 901
 	MCheckHealth        ServiceMethod = 902
+
+	MListDatabase   ServiceMethod = 1000
+	MCreateDatabase ServiceMethod = 1001
+	MDropDatabase   ServiceMethod = 1002
 )
 
 // injection function definition
@@ -320,6 +325,40 @@ func (m *MockServer) DelInjection(n ServiceMethod) {
 	delete(m.Injections, n)
 }
 
+// -- database --
+// ListDatabases list all database in milvus cluster.
+func (m *MockServer) ListDatabases(ctx context.Context, req *server.ListDatabasesRequest) (*server.ListDatabasesResponse, error) {
+	f := m.GetInjection(MListDatabase)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*server.ListDatabasesResponse), err
+	}
+	r := &server.ListDatabasesResponse{}
+	s, err := SuccessStatus()
+	r.Status = s
+	return r, err
+}
+
+// CreateDatabase create database with the given name.
+func (m *MockServer) CreateDatabase(ctx context.Context, req *server.CreateDatabaseRequest) (*common.Status, error) {
+	f := m.GetInjection(MCreateDatabase)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
+// DropDatabase drop database with the given db name.
+func (m *MockServer) DropDatabase(ctx context.Context, req *server.DropDatabaseRequest) (*common.Status, error) {
+	f := m.GetInjection(MDropDatabase)
+	if f != nil {
+		r, err := f(ctx, req)
+		return r.(*common.Status), err
+	}
+	return SuccessStatus()
+}
+
 func (m *MockServer) CreateCollection(ctx context.Context, req *server.CreateCollectionRequest) (*common.Status, error) {
 	f := m.GetInjection(MCreateCollection)
 	if f != nil {
@@ -417,7 +456,6 @@ func (m *MockServer) CreatePartition(ctx context.Context, req *server.CreatePart
 		return r.(*common.Status), err
 	}
 	return SuccessStatus()
-
 }
 
 func (m *MockServer) DropPartition(ctx context.Context, req *server.DropPartitionRequest) (*common.Status, error) {
@@ -518,7 +556,6 @@ func (m *MockServer) GetIndexState(ctx context.Context, req *server.GetIndexStat
 	}
 	s, err := SuccessStatus()
 	return &server.GetIndexStateResponse{Status: s}, err
-
 }
 
 func (m *MockServer) GetIndexBuildProgress(ctx context.Context, req *server.GetIndexBuildProgressRequest) (*server.GetIndexBuildProgressResponse, error) {
@@ -529,7 +566,6 @@ func (m *MockServer) GetIndexBuildProgress(ctx context.Context, req *server.GetI
 	}
 	s, err := SuccessStatus()
 	return &server.GetIndexBuildProgressResponse{Status: s}, err
-
 }
 
 func (m *MockServer) DropIndex(ctx context.Context, req *server.DropIndexRequest) (*common.Status, error) {
@@ -872,18 +908,6 @@ func (m *MockServer) GetIndexStatistics(_ context.Context, _ *server.GetIndexSta
 	panic("not implemented") // TODO: Implement
 }
 
-func (m *MockServer) CreateDatabase(_a0 context.Context, _a1 *server.CreateDatabaseRequest) (*common.Status, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *MockServer) DropDatabase(_a0 context.Context, _a1 *server.DropDatabaseRequest) (*common.Status, error) {
-	panic("not implemented") // TODO: Implement
-}
-
-func (m *MockServer) ListDatabases(_a0 context.Context, _a1 *server.ListDatabasesRequest) (*server.ListDatabasesResponse, error) {
-	panic("not implemented") // TODO: Implement
-}
-
 func (m *MockServer) Connect(_ context.Context, _ *server.ConnectRequest) (*server.ConnectResponse, error) {
 	return &server.ConnectResponse{
 		Status:     &common.Status{ErrorCode: common.ErrorCode_Success},
diff --git a/client/client_test.go b/client/client_test.go
index cab3ff3..47ddb13 100644
--- a/client/client_test.go
+++ b/client/client_test.go
@@ -12,7 +12,6 @@ import (
 	"time"
 
 	"github.com/stretchr/testify/assert"
-	"github.com/stretchr/testify/require"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc/codes"
 	"google.golang.org/grpc/examples/helloworld/helloworld"
@@ -73,7 +72,6 @@ func (r defaultRow) Collection() string {
 
 // TestMain establishes mock grpc server to testing client behavior
 func TestMain(m *testing.M) {
-
 	rand.Seed(time.Now().Unix())
 	lis = bufconn.Listen(bufSize)
 	s := grpc.NewServer()
@@ -96,8 +94,15 @@ func bufDialer(context.Context, string) (net.Conn, error) {
 }
 
 func testClient(ctx context.Context, t *testing.T) Client {
-	c, err := NewGrpcClient(ctx, "bufnet", grpc.WithBlock(),
-		grpc.WithInsecure(), grpc.WithContextDialer(bufDialer))
+	c, err := NewClient(ctx,
+		Config{
+			Address: "bufnet",
+			DialOptions: []grpc.DialOption{
+				grpc.WithBlock(),
+				grpc.WithInsecure(),
+				grpc.WithContextDialer(bufDialer),
+			},
+		})
 
 	if !assert.Nil(t, err) || !assert.NotNil(t, c) {
 		t.FailNow()
@@ -143,6 +148,7 @@ func TestGrpcClientNil(t *testing.T) {
 		t.Run(fmt.Sprintf("TestGrpcClientNil_%s", m.Name), func(t *testing.T) {
 			mt := m.Type                                   // type of function
 			if m.Name == "Close" || m.Name == "Connect" || // skip connect & close
+				m.Name == "UsingDatabase" || // skip use database
 				m.Name == "Search" || // type alias MetricType treated as string
 				m.Name == "CalcDistance" ||
 				m.Name == "ManualCompaction" || // time.Duration hard to detect in reflect
@@ -152,7 +158,7 @@ func TestGrpcClientNil(t *testing.T) {
 			ins := make([]reflect.Value, 0, mt.NumIn())
 			for j := 1; j < mt.NumIn(); j++ { // idx == 0, is the receiver v
 				if j == 1 {
-					//non-general solution, hard code context!
+					// non-general solution, hard code context!
 					ins = append(ins, reflect.ValueOf(ctx))
 					continue
 				}
@@ -203,7 +209,6 @@ func TestGrpcClientNil(t *testing.T) {
 				assert.True(t, len(outs) > 0)
 				assert.False(t, outs[len(outs)-1].IsNil())
 			}
-
 		})
 	}
 }
@@ -212,13 +217,21 @@ func TestGrpcClientConnect(t *testing.T) {
 	ctx := context.Background()
 
 	t.Run("Use bufconn dailer, testing case", func(t *testing.T) {
-		c, err := NewGrpcClient(ctx, "bufnet", grpc.WithBlock(), grpc.WithInsecure(), grpc.WithContextDialer(bufDialer)) // uses in memory buf connection
+		c, err := NewClient(ctx,
+			Config{
+				Address: "bufnet",
+				DialOptions: []grpc.DialOption{
+					grpc.WithBlock(), grpc.WithInsecure(), grpc.WithContextDialer(bufDialer),
+				},
+			})
 		assert.Nil(t, err)
 		assert.NotNil(t, c)
 	})
 
 	t.Run("Test empty addr, using default timeout", func(t *testing.T) {
-		c, err := NewGrpcClient(ctx, "")
+		c, err := NewClient(ctx, Config{
+			Address: "",
+		})
 		assert.NotNil(t, err)
 		assert.Nil(t, c)
 	})
@@ -263,11 +276,11 @@ func TestGrpcClientRetryPolicy(t *testing.T) {
 	if err != nil {
 		log.Fatalf("failed to listen: %v", err)
 	}
-	var kaep = keepalive.EnforcementPolicy{
+	kaep := keepalive.EnforcementPolicy{
 		MinTime:             5 * time.Second,
 		PermitWithoutStream: true,
 	}
-	var kasp = keepalive.ServerParameters{
+	kasp := keepalive.ServerParameters{
 		Time:    60 * time.Second,
 		Timeout: 60 * time.Second,
 	}
@@ -286,11 +299,11 @@ func TestGrpcClientRetryPolicy(t *testing.T) {
 	}()
 	defer s.Stop()
 
-	c := &GrpcClient{}
-	err = c.dial(context.Background(), address, c.getDefaultDialOpts()...)
-	require.NoError(t, err)
+	client, err := NewClient(context.TODO(), Config{Address: address, DisableConn: true})
+	assert.Nil(t, err)
+	defer client.Close()
 
-	greeterClient := helloworld.NewGreeterClient(c.Conn)
+	greeterClient := helloworld.NewGreeterClient(client.(*GrpcClient).Conn)
 	ctx := context.Background()
 	name := fmt.Sprintf("hello world %d", time.Now().Second())
 	res, err := greeterClient.SayHello(ctx, &helloworld.HelloRequest{Name: name})
@@ -298,17 +311,6 @@ func TestGrpcClientRetryPolicy(t *testing.T) {
 	assert.Equal(t, res.Message, strings.ToUpper(name))
 }
 
-func TestClient_getDefaultAuthOpts(t *testing.T) {
-	username := "u"
-	password := "pwd"
-	c := &GrpcClient{}
-	defaultOpts := c.getDefaultAuthDialOpts(username, password, true)
-	assert.True(t, len(defaultOpts) == 6)
-
-	defaultOpts = c.getDefaultAuthDialOpts(username, password, false)
-	assert.True(t, len(defaultOpts) == 6)
-}
-
 func TestClient_NewDefaultGrpcClientWithURI(t *testing.T) {
 	username := "u"
 	password := "p"
@@ -321,48 +323,6 @@ func TestClient_NewDefaultGrpcClientWithURI(t *testing.T) {
 	})
 }
 
-func TestClient_parseURI(t *testing.T) {
-	t.Run("https uri parse ok", func(t *testing.T) {
-		uri := "https://localhost:8080"
-		addr, inSecure, err := parseURI(uri)
-		assert.Equal(t, "localhost:8080", addr)
-		assert.True(t, inSecure)
-		assert.Nil(t, err)
-	})
-
-	t.Run("https uri parse fail", func(t *testing.T) {
-		uri := "https://localhost:port"
-		addr, inSecure, err := parseURI(uri)
-		assert.Equal(t, "", addr)
-		assert.True(t, inSecure)
-		assert.NotNil(t, err)
-	})
-
-	t.Run("http uri parse ok", func(t *testing.T) {
-		uri := "http://localhost:8080"
-		addr, inSecure, err := parseURI(uri)
-		assert.Equal(t, "localhost:8080", addr)
-		assert.False(t, inSecure)
-		assert.Nil(t, err)
-	})
-
-	t.Run("http uri parse fail", func(t *testing.T) {
-		uri := "http://localhost:port"
-		addr, inSecure, err := parseURI(uri)
-		assert.Equal(t, "", addr)
-		assert.False(t, inSecure)
-		assert.NotNil(t, err)
-	})
-
-	t.Run("no prefix uri parse ok", func(t *testing.T) {
-		uri := "localhost:8080"
-		addr, inSecure, err := parseURI(uri)
-		assert.Equal(t, "localhost:8080", addr)
-		assert.False(t, inSecure)
-		assert.Nil(t, err)
-	})
-}
-
 var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
 
 func randStr(n int) string {
diff --git a/client/config_test.go b/client/config_test.go
new file mode 100644
index 0000000..0f33ed6
--- /dev/null
+++ b/client/config_test.go
@@ -0,0 +1,131 @@
+package client
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestClientConfig(t *testing.T) {
+	// empty config.
+	assertConfig(
+		t,
+		&Config{},
+		"", "", false, true,
+	)
+	// local host
+	assertConfig(
+		t,
+		&Config{
+			Address: "localhost:19540",
+		},
+		"localhost:19540", "", false, false,
+	)
+	// local secure host
+	assertConfig(
+		t,
+		&Config{
+			Address:       "localhost:19540",
+			EnableTLSAuth: true,
+		},
+		"localhost:19540", "", true, false,
+	)
+	// local http host
+	assertConfig(
+		t,
+		&Config{
+			Address: "http://localhost:19540",
+		},
+		"localhost:19540", "", false, false,
+	)
+	// local https host
+	assertConfig(
+		t,
+		&Config{
+			Address: "https://localhost:19540",
+		},
+		"localhost:19540", "", true, false,
+	)
+	// remote https host
+	assertConfig(
+		t,
+		&Config{
+			Address: "https://xxxx-xxxx-xxxxx.com",
+		},
+		"xxxx-xxxx-xxxxx.com", "", true, false,
+	)
+	// remote https host with dbname
+	assertConfig(
+		t,
+		&Config{
+			Address: "https://xxxx-xxxxxxxxxxxxxx-xxxxxx.aws-us-west-2.vectordb-sit.zillizcloud.com:19530/database_name",
+			APIKey:  "test-token",
+		},
+		"xxxx-xxxxxxxxxxxxxx-xxxxxx.aws-us-west-2.vectordb-sit.zillizcloud.com:19530", "database_name", true, false,
+	)
+
+	// local secure host
+	assertConfig(
+		t,
+		&Config{
+			Address: "https://localhost:19540",
+		},
+		"localhost:19540", "", true, false,
+	)
+
+	assertConfig(
+		t,
+		&Config{
+			Address: "https://localhost:8080",
+		},
+		"localhost:8080", "", true, false,
+	)
+	assertConfig(
+		t,
+		&Config{
+			Address: "https://localhost:port",
+		},
+		"", "", false, true,
+	)
+	assertConfig(
+		t,
+		&Config{
+			Address: "http://localhost:8080",
+		},
+		"localhost:8080", "", false, false,
+	)
+	assertConfig(
+		t,
+		&Config{
+			Address: "http://localhost:port",
+		},
+		"", "", false, true,
+	)
+	assertConfig(
+		t,
+		&Config{
+			Address: "localhost:8080",
+		},
+		"localhost:8080", "", false, false,
+	)
+	assertConfig(
+		t,
+		&Config{
+			Address: "localhost:8080",
+			DBName:  "test_db",
+		},
+		"localhost:8080", "test_db", false, false,
+	)
+}
+
+func assertConfig(t *testing.T, c *Config, host string, db string, secure bool, isErr bool) {
+	err := c.parse()
+	if isErr {
+		assert.NotNil(t, err)
+		return
+	}
+	assert.Nil(t, err)
+	assert.Equal(t, c.EnableTLSAuth, secure)
+	assert.Equal(t, c.DBName, db)
+	assert.Equal(t, c.getParsedAddress(), host)
+}
diff --git a/client/database_test.go b/client/database_test.go
new file mode 100644
index 0000000..cf99884
--- /dev/null
+++ b/client/database_test.go
@@ -0,0 +1,60 @@
+package client
+
+import (
+	"context"
+	"testing"
+
+	"github.com/go-faker/faker/v4"
+	"github.com/go-faker/faker/v4/pkg/options"
+	"github.com/golang/protobuf/proto"
+	server "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
+	"github.com/stretchr/testify/assert"
+)
+
+func TestGrpcClientListDatabases(t *testing.T) {
+	ctx := context.Background()
+	c := testClient(ctx, t)
+
+	type testCase struct {
+		DBName []string
+	}
+	caseList := []testCase{}
+	faker.FakeData(&caseList, options.WithRandomMapAndSliceMaxSize(25))
+
+	for _, singleCase := range caseList {
+		mockServer.SetInjection(MListDatabase, func(ctx context.Context, m proto.Message) (proto.Message, error) {
+			s, err := SuccessStatus()
+			resp := &server.ListDatabasesResponse{
+				Status:  s,
+				DbNames: singleCase.DBName,
+			}
+			return resp, err
+		})
+		dbNames, err := c.ListDatabases(ctx)
+		assert.Nil(t, err)
+		assert.Equal(t, len(singleCase.DBName), len(dbNames))
+		for i, db := range singleCase.DBName {
+			assert.Equal(t, db, dbNames[i].Name)
+		}
+	}
+}
+
+func TestGrpcClientCreateDatabase(t *testing.T) {
+	ctx := context.Background()
+	c := testClient(ctx, t)
+	mockServer.SetInjection(MCreateDatabase, func(ctx context.Context, m proto.Message) (proto.Message, error) {
+		return SuccessStatus()
+	})
+	err := c.CreateDatabase(ctx, "a")
+	assert.Nil(t, err)
+}
+
+func TestGrpcClientDropDatabase(t *testing.T) {
+	ctx := context.Background()
+	c := testClient(ctx, t)
+	mockServer.SetInjection(MDropDatabase, func(ctx context.Context, m proto.Message) (proto.Message, error) {
+		return SuccessStatus()
+	})
+	err := c.DropDatabase(ctx, "a")
+	assert.Nil(t, err)
+}
diff --git a/client/interceptor_test.go b/client/interceptor_test.go
index e9bb982..cdd9379 100644
--- a/client/interceptor_test.go
+++ b/client/interceptor_test.go
@@ -11,16 +11,34 @@ import (
 )
 
 const (
-	TestUsername = "TestUsername"
-	TestPassword = "TestPassword"
+	testDBName = "TestDBName"
 )
 
 func TestAuthenticationInterceptor(t *testing.T) {
 	ctx := context.Background()
-	ctx = AuthenticationInterceptor(ctx, TestUsername, TestPassword)
+	ctx = authenticationInterceptor(ctx, testUsername, testPassword)
 	md, ok := metadata.FromOutgoingContext(ctx)
-	value := crypto.Base64Encode(fmt.Sprintf("%s:%s", TestUsername, TestPassword))
+	value := crypto.Base64Encode(fmt.Sprintf("%s:%s", testUsername, testPassword))
 	assert.True(t, ok)
 	assert.Equal(t, 1, len(md["authorization"]))
 	assert.Equal(t, value, md["authorization"][0])
 }
+
+func TestDBNameInterceptor(t *testing.T) {
+	ctx := context.Background()
+	ctx = databaseNameInterceptor(ctx, func() string { return testDBName })
+	md, ok := metadata.FromOutgoingContext(ctx)
+	assert.True(t, ok)
+	assert.Equal(t, 1, len(md["dbname"]))
+	assert.Equal(t, testDBName, md["dbname"][0])
+}
+
+func TestAPIInterceptor(t *testing.T) {
+	ctx := context.Background()
+	ctx = apiKeyInterceptor(ctx, "test-token")
+	md, ok := metadata.FromOutgoingContext(ctx)
+	value := crypto.Base64Encode(fmt.Sprintf("Bearer: %s", "test-token"))
+	assert.True(t, ok)
+	assert.Equal(t, 1, len(md[authorizationHeader]))
+	assert.Equal(t, value, md[authorizationHeader][0])
+}
diff --git a/test/base/milvus_client.go b/test/base/milvus_client.go
index 971a68e..2b0f4e2 100644
--- a/test/base/milvus_client.go
+++ b/test/base/milvus_client.go
@@ -8,8 +8,6 @@ import (
 
 	"github.com/milvus-io/milvus-sdk-go/v2/client"
 	"github.com/milvus-io/milvus-sdk-go/v2/entity"
-
-	"google.golang.org/grpc"
 )
 
 func preRequest(funcName string, args ...interface{}) {
@@ -22,17 +20,16 @@ func postResponse(funcName string, err error, res ...interface{}) {
 	} else {
 		log.Printf("(ApiResponse): func [%s], results: %v\n", funcName, res)
 	}
-
 }
 
 type MilvusClient struct {
 	mClient client.Client
 }
 
-func NewMilvusClient(ctx context.Context, addr string, dialOptions ...grpc.DialOption) (*MilvusClient, error) {
-	preRequest("NewGrpcClient", ctx, addr, dialOptions)
-	mClient, err := client.NewGrpcClient(ctx, addr, dialOptions...)
-	postResponse("NewGrpcClient", err, mClient)
+func NewMilvusClient(ctx context.Context, cfg client.Config) (*MilvusClient, error) {
+	preRequest("NewClient", ctx, cfg)
+	mClient, err := client.NewClient(ctx, cfg)
+	postResponse("NewClient", err, mClient)
 	return &MilvusClient{
 		mClient,
 	}, err
@@ -81,6 +78,45 @@ func (mc *MilvusClient) Close() error {
 	return err
 }
 
+// -- database --
+// UsingDatabase for database operation after this function call.
+// All request in any goroutine will be applied to new database on the same client. e.g.
+// 1. goroutine A access DB1.
+// 2. goroutine B call UsingDatabase(ctx, "DB2").
+// 3. goroutine A access DB2 after 2.
+func (mc *MilvusClient) UsingDatabase(ctx context.Context, dbName string) error {
+	preRequest("UsingDatabase", ctx, dbName)
+	mc.mClient.UsingDatabase(ctx, dbName)
+	postResponse("UsingDatabase", nil)
+	return nil
+}
+
+// -- database --
+
+// ListDatabases list all database in milvus cluster.
+func (mc *MilvusClient) ListDatabases(ctx context.Context) ([]entity.Database, error) {
+	preRequest("ListDatabases", ctx)
+	dbs, err := mc.mClient.ListDatabases(ctx)
+	postResponse("ListDatabases", err, dbs)
+	return dbs, err
+}
+
+// CreateDatabase create database with the given name.
+func (mc *MilvusClient) CreateDatabase(ctx context.Context, dbName string) error {
+	preRequest("CreateDatabase", ctx)
+	err := mc.mClient.CreateDatabase(ctx, dbName)
+	postResponse("CreateDatabase", err)
+	return err
+}
+
+// DropDatabase drop database with the given db name.
+func (mc *MilvusClient) DropDatabase(ctx context.Context, dbName string) error {
+	preRequest("DropDatabase", ctx)
+	err := mc.mClient.DropDatabase(ctx, dbName)
+	postResponse("DropDatabase", err)
+	return err
+}
+
 // -- collection --
 
 // Create Collection
@@ -129,8 +165,8 @@ func (mc *MilvusClient) GetCollectionStatistics(ctx context.Context, collName st
 
 // Load Collection
 func (mc *MilvusClient) LoadCollection(ctx context.Context, collName string, async bool, opts ...client.LoadCollectionOption) error {
-	var funcName = "LoadCollection"
-	preRequest(funcName, ctx, collName)
+	funcName := "LoadCollection"
+	preRequest(funcName, ctx, collName, opts)
 	err := mc.mClient.LoadCollection(ctx, collName, async, opts...)
 	postResponse(funcName, err)
 	return err
@@ -338,8 +374,9 @@ func (mc *MilvusClient) DeleteByPks(ctx context.Context, collName string, partit
 
 // Search
 func (mc *MilvusClient) Search(ctx context.Context, collName string, partitions []string, expr string,
-	outputFields []string, vectors []entity.Vector, vectorField string, metricType entity.MetricType, topK int, sp entity.SearchParam, opts ...client.SearchQueryOptionFunc) ([]client.SearchResult, error) {
-	var funcName = "Search"
+	outputFields []string, vectors []entity.Vector, vectorField string, metricType entity.MetricType, topK int, sp entity.SearchParam, opts ...client.SearchQueryOptionFunc,
+) ([]client.SearchResult, error) {
+	funcName := "Search"
 	preRequest(funcName, ctx, collName, partitions, expr, outputFields, fmt.Sprintf("nq=%d", len(vectors)), vectorField, metricType, topK, sp, opts)
 
 	searchResult, err := mc.mClient.Search(ctx, collName, partitions, expr, outputFields, vectors, vectorField, metricType, topK, sp, opts...)
@@ -350,8 +387,9 @@ func (mc *MilvusClient) Search(ctx context.Context, collName string, partitions
 
 // Query
 func (mc *MilvusClient) Query(ctx context.Context, collName string, partitions []string, ids entity.Column,
-	outputFields []string, opts ...client.SearchQueryOptionFunc) ([]entity.Column, error) {
-	var funcName = "QueryByPks"
+	outputFields []string, opts ...client.SearchQueryOptionFunc,
+) ([]entity.Column, error) {
+	funcName := "QueryByPks"
 	preRequest(funcName, ctx, collName, partitions, ids, outputFields, opts)
 
 	queryResults, err := mc.mClient.QueryByPks(ctx, collName, partitions, ids, outputFields, opts...)
diff --git a/test/testcases/database_test.go b/test/testcases/database_test.go
new file mode 100644
index 0000000..4b405db
--- /dev/null
+++ b/test/testcases/database_test.go
@@ -0,0 +1,82 @@
+package testcases
+
+import (
+	"context"
+	"testing"
+	"time"
+
+	"github.com/milvus-io/milvus-sdk-go/v2/client"
+	"github.com/milvus-io/milvus-sdk-go/v2/test/common"
+)
+
+func TestDatabase(t *testing.T) {
+	ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
+	defer cancel()
+
+	clientDefault := createMilvusClient(ctx, t)
+	defer clientDefault.Close()
+
+	err := clientDefault.CreateDatabase(ctx, "db1")
+	common.CheckErr(t, err, true)
+
+	dbs, err := clientDefault.ListDatabases(ctx)
+	common.CheckErr(t, err, true)
+	if len(dbs) != 2 {
+		t.Fatalf("unexpected db number, %d, %+v", len(dbs), dbs)
+	}
+	clientDB1 := createMilvusClient(ctx, t, client.Config{
+		DBName: "db1",
+	})
+	defer clientDB1.Close()
+	db1Col1, _ := createCollectionAllFields(ctx, t, clientDB1, common.DefaultNb, 0)
+	db1Col2, _ := createCollectionAllFields(ctx, t, clientDB1, common.DefaultNb, 0)
+	collections, err := clientDB1.ListCollections(ctx)
+	common.CheckErr(t, err, true)
+	if len(collections) != 2 {
+		t.Fatalf("unexpected count of db1, %d", len(collections))
+	}
+
+	clientDefault.CreateDatabase(ctx, "db2")
+	common.CheckErr(t, err, true)
+	dbs, err = clientDefault.ListDatabases(ctx)
+	common.CheckErr(t, err, true)
+	if len(dbs) != 3 {
+		t.Fatalf("unexpected db number, %d, %+v", len(dbs), dbs)
+	}
+
+	clientDefault.UsingDatabase(ctx, "db2")
+	db2Col1, _ := createCollectionAllFields(ctx, t, clientDefault, common.DefaultNb, 0)
+	err = clientDefault.DropCollection(ctx, db2Col1)
+	common.CheckErr(t, err, true)
+
+	clientDefault.UsingDatabase(ctx, "")
+	err = clientDefault.DropDatabase(ctx, "db2")
+	common.CheckErr(t, err, true)
+
+	dbs, err = clientDefault.ListDatabases(ctx)
+	common.CheckErr(t, err, true)
+	if len(dbs) != 2 {
+		t.Fatalf("unexpected db number, %d, %+v", len(dbs), dbs)
+	}
+
+	err = clientDB1.DropDatabase(ctx, "db1")
+	common.CheckErr(t, err, false, "must drop all collections before drop database")
+
+	err = clientDB1.DropCollection(ctx, db1Col1)
+	common.CheckErr(t, err, true)
+
+	err = clientDB1.DropCollection(ctx, db1Col2)
+	common.CheckErr(t, err, true)
+
+	err = clientDB1.DropDatabase(ctx, "db1")
+	common.CheckErr(t, err, true)
+
+	err = clientDefault.DropDatabase(ctx, "default")
+	common.CheckErr(t, err, false, "can not drop default database")
+
+	dbs, err = clientDefault.ListDatabases(ctx)
+	common.CheckErr(t, err, true)
+	if len(dbs) != 1 {
+		t.Fatalf("unexpected db number, %d, %+v", len(dbs), dbs)
+	}
+}
diff --git a/test/testcases/main_test.go b/test/testcases/main_test.go
index c068de6..4a2abce 100644
--- a/test/testcases/main_test.go
+++ b/test/testcases/main_test.go
@@ -37,7 +37,6 @@ func teardown() {
 	defer mc.Close()
 }
 
-//
 func createContext(t *testing.T, timeout time.Duration) context.Context {
 	ctx, cancel := context.WithTimeout(context.Background(), timeout)
 	t.Cleanup(func() {
@@ -47,10 +46,19 @@ func createContext(t *testing.T, timeout time.Duration) context.Context {
 }
 
 // create connect
-func createMilvusClient(ctx context.Context, t *testing.T) *base.MilvusClient {
+func createMilvusClient(ctx context.Context, t *testing.T, cfg ...client.Config) *base.MilvusClient {
 	t.Helper()
 
-	mc, err := base.NewDefaultMilvusClient(ctx, *addr)
+	var (
+		mc  *base.MilvusClient
+		err error
+	)
+	if len(cfg) == 0 {
+		mc, err = base.NewDefaultMilvusClient(ctx, *addr)
+	} else {
+		cfg[0].Address = *addr
+		mc, err = base.NewMilvusClient(ctx, cfg[0])
+	}
 	common.CheckErr(t, err, true)
 
 	t.Cleanup(func() {
@@ -96,7 +104,7 @@ func createDefaultBinaryCollection(ctx context.Context, t *testing.T, mc *base.M
 	// close connect and drop collection after each case
 	t.Cleanup(func() {
 		mc.DropCollection(ctx, collName)
-		//mc.Close()
+		// mc.Close()
 	})
 	return collName
 }
@@ -117,7 +125,7 @@ func createDefaultVarcharCollection(ctx context.Context, t *testing.T, mc *base.
 	// close connect and drop collection after each case
 	t.Cleanup(func() {
 		mc.DropCollection(ctx, collName)
-		//mc.Close()
+		// mc.Close()
 	})
 	return collName
 }