2021-07-05 16:26:57 +03:00
|
|
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
2023-02-22 00:12:01 +03:00
|
|
|
// protoc-gen-go-micro version: v3.10.1
|
2021-07-05 16:26:57 +03:00
|
|
|
// source: test.proto
|
|
|
|
|
|
|
|
package pb
|
|
|
|
|
|
|
|
import (
|
|
|
|
context "context"
|
2023-02-22 00:12:01 +03:00
|
|
|
v3 "go.unistack.org/micro-server-http/v3"
|
2021-10-27 01:24:35 +03:00
|
|
|
client "go.unistack.org/micro/v3/client"
|
|
|
|
server "go.unistack.org/micro/v3/server"
|
2021-07-05 16:26:57 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
2023-02-22 00:12:01 +03:00
|
|
|
nopts = append(nopts, v3.HandlerEndpoints(TestServiceServerEndpoints))
|
2021-07-05 16:26:57 +03:00
|
|
|
return s.Handle(s.NewHandler(&TestService{h}, append(nopts, opts...)...))
|
|
|
|
}
|