2020-12-26 17:17:20 +02:00
|
|
|
package mock
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2021-01-20 23:28:48 +02:00
|
|
|
proto "github.com/asim/go-micro/examples/v3/helloworld/proto"
|
2021-01-20 15:54:31 +02:00
|
|
|
"github.com/asim/go-micro/v3/client"
|
2020-12-26 17:17:20 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type mockGreeterService struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockGreeterService) Hello(ctx context.Context, req *proto.Request, opts ...client.CallOption) (*proto.Response, error) {
|
|
|
|
return &proto.Response{
|
|
|
|
Greeting: "Hello " + req.Name,
|
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewGreeterService() proto.GreeterService {
|
|
|
|
return new(mockGreeterService)
|
|
|
|
}
|