update tests and deps
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
67
client/drpc/proto/test_micro_rpc.pb.go
Normal file
67
client/drpc/proto/test_micro_rpc.pb.go
Normal file
@@ -0,0 +1,67 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.4.0
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
api "github.com/unistack-org/micro/v3/api"
|
||||
client "github.com/unistack-org/micro/v3/client"
|
||||
server "github.com/unistack-org/micro/v3/server"
|
||||
)
|
||||
|
||||
type testServiceClient struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewTestServiceClient(name string, c client.Client) TestServiceClient {
|
||||
return &testServiceClient{c: c, name: name}
|
||||
}
|
||||
|
||||
func (c *testServiceClient) Call(ctx context.Context, req *CallReq, opts ...client.CallOption) (*CallRsp, error) {
|
||||
rsp := &CallRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.Call", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *testServiceClient) Hello(ctx context.Context, req *CallReq, opts ...client.CallOption) (*CallRsp, error) {
|
||||
rsp := &CallRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.Hello", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
type testServiceServer struct {
|
||||
TestServiceServer
|
||||
}
|
||||
|
||||
func (h *testServiceServer) Call(ctx context.Context, req *CallReq, rsp *CallRsp) error {
|
||||
return h.TestServiceServer.Call(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *testServiceServer) Hello(ctx context.Context, req *CallReq, rsp *CallRsp) error {
|
||||
return h.TestServiceServer.Hello(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func RegisterTestServiceServer(s server.Server, sh TestServiceServer, opts ...server.HandlerOption) error {
|
||||
type testService interface {
|
||||
Call(ctx context.Context, req *CallReq, rsp *CallRsp) error
|
||||
Hello(ctx context.Context, req *CallReq, rsp *CallRsp) error
|
||||
}
|
||||
type TestService struct {
|
||||
testService
|
||||
}
|
||||
h := &testServiceServer{sh}
|
||||
var nopts []server.HandlerOption
|
||||
for _, endpoint := range TestServiceEndpoints {
|
||||
nopts = append(nopts, api.WithEndpoint(&endpoint))
|
||||
}
|
||||
return s.Handle(s.NewHandler(&TestService{h}, append(nopts, opts...)...))
|
||||
}
|
Reference in New Issue
Block a user