mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-12 08:23:58 +02:00
d94936f6c9
* v3 * revert plugins * fixup some issues
22 lines
454 B
Go
22 lines
454 B
Go
package mock
|
|
|
|
import (
|
|
"context"
|
|
|
|
proto "github.com/micro/go-micro/examples/helloworld/proto"
|
|
"github.com/asim/go-micro/v3/client"
|
|
)
|
|
|
|
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)
|
|
}
|