Repository: milvus-io/milvus-sdk-go
Pull request #561 (2023-08-22 14:33:34)

Bump proto version to 2.3.0
/kind improvement

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/561#" title="Author self-approved">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":[]} -->
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/561#" title="Author self-approved">congqixia</a>*, *<a href="https://github.com/milvus-io/milvus-sdk-go/pull/561#pullrequestreview-1590606534" title="LGTM">yah01</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,yah01]

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/Makefile b/Makefile
index adb5f37..d513495 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ endif
 install-tool:
 	@mkdir -p $(INSTALL_PATH)
 	@$(INSTALL_PATH)/golangci-lint --version 2>&1 1>/dev/null || (echo "Installing golangci-lint into ./bin/" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(INSTALL_PATH) v1.46.2)
-	@$(INSTALL_PATH)/mockery --version 2>&1 1>/dev/null || (echo "Installing mockery v2.16.0 to ./bin/" && GOBIN=$(INSTALL_PATH)/ go install github.com/vektra/mockery/v2@v2.16.0)
+	@$(INSTALL_PATH)/mockery --version 2>&1 1>/dev/null || (echo "Installing mockery v2.32.4 to ./bin/" && GOBIN=$(INSTALL_PATH)/ go install github.com/vektra/mockery/v2@v2.32.4)
 
 
 check-protoc-version: check-protoc
diff --git a/go.mod b/go.mod
index 4d3f721..aee21ab 100644
--- a/go.mod
+++ b/go.mod
@@ -7,7 +7,7 @@ require (
 	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
+	github.com/milvus-io/milvus-proto/go-api/v2 v2.3.0
 	github.com/stretchr/testify v1.8.1
 	github.com/tidwall/gjson v1.14.4
 	google.golang.org/grpc v1.48.0
diff --git a/go.sum b/go.sum
index ef7d95a..f7a1e9f 100644
--- a/go.sum
+++ b/go.sum
@@ -159,6 +159,8 @@ github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i
 github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc=
 github.com/milvus-io/milvus-proto/go-api/v2 v2.3.0-dev.1 h1:x6vhrVyK3wEuXIDHt0uk2l/UFPa/RRGWk1nkjgN5jkI=
 github.com/milvus-io/milvus-proto/go-api/v2 v2.3.0-dev.1/go.mod h1:1OIl0v5PQeNxIJhCvY+K55CBUOYDZevw9g9380u1Wek=
+github.com/milvus-io/milvus-proto/go-api/v2 v2.3.0 h1:t5CKm7+FXuD2rDLv/H8tpN9iY8F2dZvHF87xWBx8muU=
+github.com/milvus-io/milvus-proto/go-api/v2 v2.3.0/go.mod h1:1OIl0v5PQeNxIJhCvY+K55CBUOYDZevw9g9380u1Wek=
 github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
 github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
diff --git a/mocks/MilvusServiceServer.go b/mocks/MilvusServiceServer.go
index 092e3bd..28dc6bf 100644
--- a/mocks/MilvusServiceServer.go
+++ b/mocks/MilvusServiceServer.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.26.1. DO NOT EDIT.
+// Code generated by mockery v2.32.4. DO NOT EDIT.
 
 package mocks
 
@@ -27,6 +27,61 @@ func (_m *MilvusServiceServer) EXPECT() *MilvusServiceServer_Expecter {
 	return &MilvusServiceServer_Expecter{mock: &_m.Mock}
 }
 
+// AllocTimestamp provides a mock function with given fields: _a0, _a1
+func (_m *MilvusServiceServer) AllocTimestamp(_a0 context.Context, _a1 *milvuspb.AllocTimestampRequest) (*milvuspb.AllocTimestampResponse, error) {
+	ret := _m.Called(_a0, _a1)
+
+	var r0 *milvuspb.AllocTimestampResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.AllocTimestampRequest) (*milvuspb.AllocTimestampResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.AllocTimestampRequest) *milvuspb.AllocTimestampResponse); ok {
+		r0 = rf(_a0, _a1)
+	} else {
+		if ret.Get(0) != nil {
+			r0 = ret.Get(0).(*milvuspb.AllocTimestampResponse)
+		}
+	}
+
+	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.AllocTimestampRequest) error); ok {
+		r1 = rf(_a0, _a1)
+	} else {
+		r1 = ret.Error(1)
+	}
+
+	return r0, r1
+}
+
+// MilvusServiceServer_AllocTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllocTimestamp'
+type MilvusServiceServer_AllocTimestamp_Call struct {
+	*mock.Call
+}
+
+// AllocTimestamp is a helper method to define mock.On call
+//   - _a0 context.Context
+//   - _a1 *milvuspb.AllocTimestampRequest
+func (_e *MilvusServiceServer_Expecter) AllocTimestamp(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_AllocTimestamp_Call {
+	return &MilvusServiceServer_AllocTimestamp_Call{Call: _e.mock.On("AllocTimestamp", _a0, _a1)}
+}
+
+func (_c *MilvusServiceServer_AllocTimestamp_Call) Run(run func(_a0 context.Context, _a1 *milvuspb.AllocTimestampRequest)) *MilvusServiceServer_AllocTimestamp_Call {
+	_c.Call.Run(func(args mock.Arguments) {
+		run(args[0].(context.Context), args[1].(*milvuspb.AllocTimestampRequest))
+	})
+	return _c
+}
+
+func (_c *MilvusServiceServer_AllocTimestamp_Call) Return(_a0 *milvuspb.AllocTimestampResponse, _a1 error) *MilvusServiceServer_AllocTimestamp_Call {
+	_c.Call.Return(_a0, _a1)
+	return _c
+}
+
+func (_c *MilvusServiceServer_AllocTimestamp_Call) RunAndReturn(run func(context.Context, *milvuspb.AllocTimestampRequest) (*milvuspb.AllocTimestampResponse, error)) *MilvusServiceServer_AllocTimestamp_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // AlterAlias provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) AlterAlias(_a0 context.Context, _a1 *milvuspb.AlterAliasRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
@@ -242,11 +297,20 @@ func (_c *MilvusServiceServer_CheckHealth_Call) Return(_a0 *milvuspb.CheckHealth
 	return _c
 }
 
+func (_c *MilvusServiceServer_CheckHealth_Call) RunAndReturn(run func(context.Context, *milvuspb.CheckHealthRequest) (*milvuspb.CheckHealthResponse, error)) *MilvusServiceServer_CheckHealth_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // Connect provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) Connect(_a0 context.Context, _a1 *milvuspb.ConnectRequest) (*milvuspb.ConnectResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.ConnectResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ConnectRequest) (*milvuspb.ConnectResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ConnectRequest) *milvuspb.ConnectResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -255,7 +319,6 @@ func (_m *MilvusServiceServer) Connect(_a0 context.Context, _a1 *milvuspb.Connec
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.ConnectRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -271,8 +334,8 @@ type MilvusServiceServer_Connect_Call struct {
 }
 
 // Connect is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.ConnectRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.ConnectRequest
 func (_e *MilvusServiceServer_Expecter) Connect(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_Connect_Call {
 	return &MilvusServiceServer_Connect_Call{Call: _e.mock.On("Connect", _a0, _a1)}
 }
@@ -289,6 +352,11 @@ func (_c *MilvusServiceServer_Connect_Call) Return(_a0 *milvuspb.ConnectResponse
 	return _c
 }
 
+func (_c *MilvusServiceServer_Connect_Call) RunAndReturn(run func(context.Context, *milvuspb.ConnectRequest) (*milvuspb.ConnectResponse, error)) *MilvusServiceServer_Connect_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // CreateAlias provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) CreateAlias(_a0 context.Context, _a1 *milvuspb.CreateAliasRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
@@ -449,11 +517,20 @@ func (_c *MilvusServiceServer_CreateCredential_Call) Return(_a0 *commonpb.Status
 	return _c
 }
 
+func (_c *MilvusServiceServer_CreateCredential_Call) RunAndReturn(run func(context.Context, *milvuspb.CreateCredentialRequest) (*commonpb.Status, error)) *MilvusServiceServer_CreateCredential_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // CreateDatabase provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) CreateDatabase(_a0 context.Context, _a1 *milvuspb.CreateDatabaseRequest) (*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.CreateDatabaseRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.CreateDatabaseRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -462,7 +539,6 @@ func (_m *MilvusServiceServer) CreateDatabase(_a0 context.Context, _a1 *milvuspb
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.CreateDatabaseRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -478,8 +554,8 @@ type MilvusServiceServer_CreateDatabase_Call struct {
 }
 
 // CreateDatabase is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.CreateDatabaseRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.CreateDatabaseRequest
 func (_e *MilvusServiceServer_Expecter) CreateDatabase(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_CreateDatabase_Call {
 	return &MilvusServiceServer_CreateDatabase_Call{Call: _e.mock.On("CreateDatabase", _a0, _a1)}
 }
@@ -496,6 +572,11 @@ func (_c *MilvusServiceServer_CreateDatabase_Call) Return(_a0 *commonpb.Status,
 	return _c
 }
 
+func (_c *MilvusServiceServer_CreateDatabase_Call) RunAndReturn(run func(context.Context, *milvuspb.CreateDatabaseRequest) (*commonpb.Status, error)) *MilvusServiceServer_CreateDatabase_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // CreateIndex provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) CreateIndex(_a0 context.Context, _a1 *milvuspb.CreateIndexRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
@@ -821,11 +902,20 @@ func (_c *MilvusServiceServer_DeleteCredential_Call) Return(_a0 *commonpb.Status
 	return _c
 }
 
+func (_c *MilvusServiceServer_DeleteCredential_Call) RunAndReturn(run func(context.Context, *milvuspb.DeleteCredentialRequest) (*commonpb.Status, error)) *MilvusServiceServer_DeleteCredential_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DescribeAlias provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DescribeAlias(_a0 context.Context, _a1 *milvuspb.DescribeAliasRequest) (*milvuspb.DescribeAliasResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.DescribeAliasResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DescribeAliasRequest) (*milvuspb.DescribeAliasResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DescribeAliasRequest) *milvuspb.DescribeAliasResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -834,7 +924,6 @@ func (_m *MilvusServiceServer) DescribeAlias(_a0 context.Context, _a1 *milvuspb.
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DescribeAliasRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -850,8 +939,8 @@ type MilvusServiceServer_DescribeAlias_Call struct {
 }
 
 // DescribeAlias is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DescribeAliasRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DescribeAliasRequest
 func (_e *MilvusServiceServer_Expecter) DescribeAlias(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DescribeAlias_Call {
 	return &MilvusServiceServer_DescribeAlias_Call{Call: _e.mock.On("DescribeAlias", _a0, _a1)}
 }
@@ -868,6 +957,11 @@ func (_c *MilvusServiceServer_DescribeAlias_Call) Return(_a0 *milvuspb.DescribeA
 	return _c
 }
 
+func (_c *MilvusServiceServer_DescribeAlias_Call) RunAndReturn(run func(context.Context, *milvuspb.DescribeAliasRequest) (*milvuspb.DescribeAliasResponse, error)) *MilvusServiceServer_DescribeAlias_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DescribeCollection provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DescribeCollection(_a0 context.Context, _a1 *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error) {
 	ret := _m.Called(_a0, _a1)
@@ -1028,11 +1122,20 @@ func (_c *MilvusServiceServer_DescribeResourceGroup_Call) Return(_a0 *milvuspb.D
 	return _c
 }
 
+func (_c *MilvusServiceServer_DescribeResourceGroup_Call) RunAndReturn(run func(context.Context, *milvuspb.DescribeResourceGroupRequest) (*milvuspb.DescribeResourceGroupResponse, error)) *MilvusServiceServer_DescribeResourceGroup_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DescribeSegmentIndexData provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DescribeSegmentIndexData(_a0 context.Context, _a1 *federpb.DescribeSegmentIndexDataRequest) (*federpb.DescribeSegmentIndexDataResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *federpb.DescribeSegmentIndexDataResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *federpb.DescribeSegmentIndexDataRequest) (*federpb.DescribeSegmentIndexDataResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *federpb.DescribeSegmentIndexDataRequest) *federpb.DescribeSegmentIndexDataResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1041,7 +1144,6 @@ func (_m *MilvusServiceServer) DescribeSegmentIndexData(_a0 context.Context, _a1
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *federpb.DescribeSegmentIndexDataRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1057,8 +1159,8 @@ type MilvusServiceServer_DescribeSegmentIndexData_Call struct {
 }
 
 // DescribeSegmentIndexData is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *federpb.DescribeSegmentIndexDataRequest
+//   - _a0 context.Context
+//   - _a1 *federpb.DescribeSegmentIndexDataRequest
 func (_e *MilvusServiceServer_Expecter) DescribeSegmentIndexData(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DescribeSegmentIndexData_Call {
 	return &MilvusServiceServer_DescribeSegmentIndexData_Call{Call: _e.mock.On("DescribeSegmentIndexData", _a0, _a1)}
 }
@@ -1075,6 +1177,11 @@ func (_c *MilvusServiceServer_DescribeSegmentIndexData_Call) Return(_a0 *federpb
 	return _c
 }
 
+func (_c *MilvusServiceServer_DescribeSegmentIndexData_Call) RunAndReturn(run func(context.Context, *federpb.DescribeSegmentIndexDataRequest) (*federpb.DescribeSegmentIndexDataResponse, error)) *MilvusServiceServer_DescribeSegmentIndexData_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DropAlias provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DropAlias(_a0 context.Context, _a1 *milvuspb.DropAliasRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
@@ -1180,11 +1287,20 @@ func (_c *MilvusServiceServer_DropCollection_Call) Return(_a0 *commonpb.Status,
 	return _c
 }
 
+func (_c *MilvusServiceServer_DropCollection_Call) RunAndReturn(run func(context.Context, *milvuspb.DropCollectionRequest) (*commonpb.Status, error)) *MilvusServiceServer_DropCollection_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DropDatabase provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DropDatabase(_a0 context.Context, _a1 *milvuspb.DropDatabaseRequest) (*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.DropDatabaseRequest) (*commonpb.Status, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropDatabaseRequest) *commonpb.Status); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -1193,7 +1309,6 @@ func (_m *MilvusServiceServer) DropDatabase(_a0 context.Context, _a1 *milvuspb.D
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DropDatabaseRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -1209,8 +1324,8 @@ type MilvusServiceServer_DropDatabase_Call struct {
 }
 
 // DropDatabase is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.DropDatabaseRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.DropDatabaseRequest
 func (_e *MilvusServiceServer_Expecter) DropDatabase(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_DropDatabase_Call {
 	return &MilvusServiceServer_DropDatabase_Call{Call: _e.mock.On("DropDatabase", _a0, _a1)}
 }
@@ -1227,6 +1342,11 @@ func (_c *MilvusServiceServer_DropDatabase_Call) Return(_a0 *commonpb.Status, _a
 	return _c
 }
 
+func (_c *MilvusServiceServer_DropDatabase_Call) RunAndReturn(run func(context.Context, *milvuspb.DropDatabaseRequest) (*commonpb.Status, error)) *MilvusServiceServer_DropDatabase_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // DropIndex provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) DropIndex(_a0 context.Context, _a1 *milvuspb.DropIndexRequest) (*commonpb.Status, error) {
 	ret := _m.Called(_a0, _a1)
@@ -2102,11 +2222,20 @@ func (_c *MilvusServiceServer_GetIndexState_Call) Return(_a0 *milvuspb.GetIndexS
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetIndexState_Call) RunAndReturn(run func(context.Context, *milvuspb.GetIndexStateRequest) (*milvuspb.GetIndexStateResponse, error)) *MilvusServiceServer_GetIndexState_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetIndexStatistics provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetIndexStatistics(_a0 context.Context, _a1 *milvuspb.GetIndexStatisticsRequest) (*milvuspb.GetIndexStatisticsResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.GetIndexStatisticsResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetIndexStatisticsRequest) (*milvuspb.GetIndexStatisticsResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.GetIndexStatisticsRequest) *milvuspb.GetIndexStatisticsResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2115,7 +2244,6 @@ func (_m *MilvusServiceServer) GetIndexStatistics(_a0 context.Context, _a1 *milv
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.GetIndexStatisticsRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2131,8 +2259,8 @@ type MilvusServiceServer_GetIndexStatistics_Call struct {
 }
 
 // GetIndexStatistics is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.GetIndexStatisticsRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.GetIndexStatisticsRequest
 func (_e *MilvusServiceServer_Expecter) GetIndexStatistics(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_GetIndexStatistics_Call {
 	return &MilvusServiceServer_GetIndexStatistics_Call{Call: _e.mock.On("GetIndexStatistics", _a0, _a1)}
 }
@@ -2149,6 +2277,11 @@ func (_c *MilvusServiceServer_GetIndexStatistics_Call) Return(_a0 *milvuspb.GetI
 	return _c
 }
 
+func (_c *MilvusServiceServer_GetIndexStatistics_Call) RunAndReturn(run func(context.Context, *milvuspb.GetIndexStatisticsRequest) (*milvuspb.GetIndexStatisticsResponse, error)) *MilvusServiceServer_GetIndexStatistics_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // GetLoadState provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) GetLoadState(_a0 context.Context, _a1 *milvuspb.GetLoadStateRequest) (*milvuspb.GetLoadStateResponse, error) {
 	ret := _m.Called(_a0, _a1)
@@ -2804,11 +2937,20 @@ func (_c *MilvusServiceServer_Insert_Call) Return(_a0 *milvuspb.MutationResult,
 	return _c
 }
 
+func (_c *MilvusServiceServer_Insert_Call) RunAndReturn(run func(context.Context, *milvuspb.InsertRequest) (*milvuspb.MutationResult, error)) *MilvusServiceServer_Insert_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // ListAliases provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) ListAliases(_a0 context.Context, _a1 *milvuspb.ListAliasesRequest) (*milvuspb.ListAliasesResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.ListAliasesResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ListAliasesRequest) (*milvuspb.ListAliasesResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ListAliasesRequest) *milvuspb.ListAliasesResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2817,7 +2959,6 @@ func (_m *MilvusServiceServer) ListAliases(_a0 context.Context, _a1 *milvuspb.Li
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.ListAliasesRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2833,8 +2974,8 @@ type MilvusServiceServer_ListAliases_Call struct {
 }
 
 // ListAliases is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.ListAliasesRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.ListAliasesRequest
 func (_e *MilvusServiceServer_Expecter) ListAliases(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_ListAliases_Call {
 	return &MilvusServiceServer_ListAliases_Call{Call: _e.mock.On("ListAliases", _a0, _a1)}
 }
@@ -2851,6 +2992,11 @@ func (_c *MilvusServiceServer_ListAliases_Call) Return(_a0 *milvuspb.ListAliases
 	return _c
 }
 
+func (_c *MilvusServiceServer_ListAliases_Call) RunAndReturn(run func(context.Context, *milvuspb.ListAliasesRequest) (*milvuspb.ListAliasesResponse, error)) *MilvusServiceServer_ListAliases_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // ListCredUsers provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) ListCredUsers(_a0 context.Context, _a1 *milvuspb.ListCredUsersRequest) (*milvuspb.ListCredUsersResponse, error) {
 	ret := _m.Called(_a0, _a1)
@@ -2901,11 +3047,20 @@ func (_c *MilvusServiceServer_ListCredUsers_Call) Return(_a0 *milvuspb.ListCredU
 	return _c
 }
 
+func (_c *MilvusServiceServer_ListCredUsers_Call) RunAndReturn(run func(context.Context, *milvuspb.ListCredUsersRequest) (*milvuspb.ListCredUsersResponse, error)) *MilvusServiceServer_ListCredUsers_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // ListDatabases provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) ListDatabases(_a0 context.Context, _a1 *milvuspb.ListDatabasesRequest) (*milvuspb.ListDatabasesResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *milvuspb.ListDatabasesResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ListDatabasesRequest) (*milvuspb.ListDatabasesResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.ListDatabasesRequest) *milvuspb.ListDatabasesResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -2914,7 +3069,6 @@ func (_m *MilvusServiceServer) ListDatabases(_a0 context.Context, _a1 *milvuspb.
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.ListDatabasesRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -2930,8 +3084,8 @@ type MilvusServiceServer_ListDatabases_Call struct {
 }
 
 // ListDatabases is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.ListDatabasesRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.ListDatabasesRequest
 func (_e *MilvusServiceServer_Expecter) ListDatabases(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_ListDatabases_Call {
 	return &MilvusServiceServer_ListDatabases_Call{Call: _e.mock.On("ListDatabases", _a0, _a1)}
 }
@@ -2948,6 +3102,11 @@ func (_c *MilvusServiceServer_ListDatabases_Call) Return(_a0 *milvuspb.ListDatab
 	return _c
 }
 
+func (_c *MilvusServiceServer_ListDatabases_Call) RunAndReturn(run func(context.Context, *milvuspb.ListDatabasesRequest) (*milvuspb.ListDatabasesResponse, error)) *MilvusServiceServer_ListDatabases_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // ListImportTasks provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) ListImportTasks(_a0 context.Context, _a1 *milvuspb.ListImportTasksRequest) (*milvuspb.ListImportTasksResponse, error) {
 	ret := _m.Called(_a0, _a1)
@@ -2998,11 +3157,20 @@ func (_c *MilvusServiceServer_ListImportTasks_Call) Return(_a0 *milvuspb.ListImp
 	return _c
 }
 
+func (_c *MilvusServiceServer_ListImportTasks_Call) RunAndReturn(run func(context.Context, *milvuspb.ListImportTasksRequest) (*milvuspb.ListImportTasksResponse, error)) *MilvusServiceServer_ListImportTasks_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // ListIndexedSegment provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) ListIndexedSegment(_a0 context.Context, _a1 *federpb.ListIndexedSegmentRequest) (*federpb.ListIndexedSegmentResponse, error) {
 	ret := _m.Called(_a0, _a1)
 
 	var r0 *federpb.ListIndexedSegmentResponse
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *federpb.ListIndexedSegmentRequest) (*federpb.ListIndexedSegmentResponse, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *federpb.ListIndexedSegmentRequest) *federpb.ListIndexedSegmentResponse); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -3011,7 +3179,6 @@ func (_m *MilvusServiceServer) ListIndexedSegment(_a0 context.Context, _a1 *fede
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *federpb.ListIndexedSegmentRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -3027,8 +3194,8 @@ type MilvusServiceServer_ListIndexedSegment_Call struct {
 }
 
 // ListIndexedSegment is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *federpb.ListIndexedSegmentRequest
+//   - _a0 context.Context
+//   - _a1 *federpb.ListIndexedSegmentRequest
 func (_e *MilvusServiceServer_Expecter) ListIndexedSegment(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_ListIndexedSegment_Call {
 	return &MilvusServiceServer_ListIndexedSegment_Call{Call: _e.mock.On("ListIndexedSegment", _a0, _a1)}
 }
@@ -3045,6 +3212,11 @@ func (_c *MilvusServiceServer_ListIndexedSegment_Call) Return(_a0 *federpb.ListI
 	return _c
 }
 
+func (_c *MilvusServiceServer_ListIndexedSegment_Call) RunAndReturn(run func(context.Context, *federpb.ListIndexedSegmentRequest) (*federpb.ListIndexedSegmentResponse, error)) *MilvusServiceServer_ListIndexedSegment_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // ListResourceGroups provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) ListResourceGroups(_a0 context.Context, _a1 *milvuspb.ListResourceGroupsRequest) (*milvuspb.ListResourceGroupsResponse, error) {
 	ret := _m.Called(_a0, _a1)
@@ -4195,11 +4367,20 @@ func (_c *MilvusServiceServer_UpdateCredential_Call) Return(_a0 *commonpb.Status
 	return _c
 }
 
+func (_c *MilvusServiceServer_UpdateCredential_Call) RunAndReturn(run func(context.Context, *milvuspb.UpdateCredentialRequest) (*commonpb.Status, error)) *MilvusServiceServer_UpdateCredential_Call {
+	_c.Call.Return(run)
+	return _c
+}
+
 // Upsert provides a mock function with given fields: _a0, _a1
 func (_m *MilvusServiceServer) Upsert(_a0 context.Context, _a1 *milvuspb.UpsertRequest) (*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.UpsertRequest) (*milvuspb.MutationResult, error)); ok {
+		return rf(_a0, _a1)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.UpsertRequest) *milvuspb.MutationResult); ok {
 		r0 = rf(_a0, _a1)
 	} else {
@@ -4208,7 +4389,6 @@ func (_m *MilvusServiceServer) Upsert(_a0 context.Context, _a1 *milvuspb.UpsertR
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.UpsertRequest) error); ok {
 		r1 = rf(_a0, _a1)
 	} else {
@@ -4224,8 +4404,8 @@ type MilvusServiceServer_Upsert_Call struct {
 }
 
 // Upsert is a helper method to define mock.On call
-//  - _a0 context.Context
-//  - _a1 *milvuspb.UpsertRequest
+//   - _a0 context.Context
+//   - _a1 *milvuspb.UpsertRequest
 func (_e *MilvusServiceServer_Expecter) Upsert(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_Upsert_Call {
 	return &MilvusServiceServer_Upsert_Call{Call: _e.mock.On("Upsert", _a0, _a1)}
 }
@@ -4242,13 +4422,17 @@ func (_c *MilvusServiceServer_Upsert_Call) Return(_a0 *milvuspb.MutationResult,
 	return _c
 }
 
-type mockConstructorTestingTNewMilvusServiceServer interface {
-	mock.TestingT
-	Cleanup(func())
+func (_c *MilvusServiceServer_Upsert_Call) RunAndReturn(run func(context.Context, *milvuspb.UpsertRequest) (*milvuspb.MutationResult, error)) *MilvusServiceServer_Upsert_Call {
+	_c.Call.Return(run)
+	return _c
 }
 
 // NewMilvusServiceServer creates a new instance of MilvusServiceServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
-func NewMilvusServiceServer(t mockConstructorTestingTNewMilvusServiceServer) *MilvusServiceServer {
+// The first argument is typically a *testing.T value.
+func NewMilvusServiceServer(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *MilvusServiceServer {
 	mock := &MilvusServiceServer{}
 	mock.Mock.Test(t)
 


Test patch:
diff --git a/client/client_mock_test.go b/client/client_mock_test.go
index eab5128..0fdd3d6 100644
--- a/client/client_mock_test.go
+++ b/client/client_mock_test.go
@@ -908,6 +908,10 @@ func (m *MockServer) GetIndexStatistics(_ context.Context, _ *server.GetIndexSta
 	panic("not implemented") // TODO: Implement
 }
 
+func (m *MockServer) AllocTimestamp(_ context.Context, _ *server.AllocTimestampRequest) (*server.AllocTimestampResponse, error) {
+	panic("not implemented")
+}
+
 func (m *MockServer) Connect(_ context.Context, _ *server.ConnectRequest) (*server.ConnectResponse, error) {
 	return &server.ConnectResponse{
 		Status:     &common.Status{ErrorCode: common.ErrorCode_Success},