move to micro v4

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2025-03-04 22:38:41 +03:00
parent 3f5fc8ec06
commit a3bba7818d
4 changed files with 65 additions and 27 deletions

20
mock.go
View File

@@ -8,10 +8,10 @@ import (
"sync"
"time"
"go.unistack.org/micro/v3/client"
"go.unistack.org/micro/v3/codec"
"go.unistack.org/micro/v3/errors"
rutil "go.unistack.org/micro/v3/util/reflect"
"go.unistack.org/micro/v4/client"
"go.unistack.org/micro/v4/codec"
"go.unistack.org/micro/v4/errors"
rutil "go.unistack.org/micro/v4/util/reflect"
)
var _ client.Client = (*MockClient)(nil)
@@ -115,14 +115,6 @@ func (c *MockClient) ExpectRequest(req client.Request) *ExpectedRequest {
return e
}
func (c *MockClient) BatchPublish(ctx context.Context, msgs []client.Message, opts ...client.PublishOption) error {
return nil
}
func (c *MockClient) Publish(ctx context.Context, msg client.Message, opts ...client.PublishOption) error {
return nil // c.opts.Broker.Publish()
}
func (c *MockClient) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) error {
c.mu.Lock()
defer c.mu.Unlock()
@@ -237,10 +229,6 @@ func (c *MockClient) Options() client.Options {
return c.opts
}
func (c *MockClient) NewMessage(topic string, msg interface{}, opts ...client.MessageOption) client.Message {
return nil
}
func (c *MockClient) NewRequest(service, method string, req interface{}, opts ...client.RequestOption) client.Request {
return newRequest(service, method, req, c.opts.ContentType, opts...)
}