github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/grpc/grpc_test/echo/echo.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // source: echo.proto 3 4 /* 5 Package echo is a generated protocol buffer package. 6 7 It is generated from these files: 8 echo.proto 9 10 It has these top-level messages: 11 EchoRequest 12 EchoResponse 13 */ 14 package echo 15 16 import ( 17 math "math" 18 fmt "fmt" 19 proto "github.com/golang/protobuf/proto" 20 context "golang.org/x/net/context" 21 grpc "github.com/hxx258456/ccgo/grpc" 22 ) 23 24 // Reference imports to suppress errors if they are not otherwise used. 25 var _ = proto.Marshal 26 var _ = fmt.Errorf 27 var _ = math.Inf 28 29 // This is a compile-time assertion to ensure that this generated file 30 // is compatible with the proto package it is being compiled against. 31 // A compilation error at this line likely means your copy of the 32 // proto package needs to be updated. 33 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 34 35 type EchoRequest struct { 36 Req string `protobuf:"bytes,1,opt,name=req" json:"req,omitempty"` 37 } 38 39 func (m *EchoRequest) Reset() { *m = EchoRequest{} } 40 func (m *EchoRequest) String() string { return proto.CompactTextString(m) } 41 func (*EchoRequest) ProtoMessage() {} 42 func (*EchoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } 43 44 func (m *EchoRequest) GetReq() string { 45 if m != nil { 46 return m.Req 47 } 48 return "" 49 } 50 51 type EchoResponse struct { 52 Result string `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` 53 } 54 55 func (m *EchoResponse) Reset() { *m = EchoResponse{} } 56 func (m *EchoResponse) String() string { return proto.CompactTextString(m) } 57 func (*EchoResponse) ProtoMessage() {} 58 func (*EchoResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } 59 60 func (m *EchoResponse) GetResult() string { 61 if m != nil { 62 return m.Result 63 } 64 return "" 65 } 66 67 func init() { 68 proto.RegisterType((*EchoRequest)(nil), "echo.EchoRequest") 69 proto.RegisterType((*EchoResponse)(nil), "echo.EchoResponse") 70 } 71 72 // Reference imports to suppress errors if they are not otherwise used. 73 var _ context.Context 74 var _ grpc.ClientConn 75 76 // This is a compile-time assertion to ensure that this generated file 77 // is compatible with the grpc package it is being compiled against. 78 const _ = grpc.SupportPackageIsVersion4 79 80 // Client API for Echo service 81 82 type EchoClient interface { 83 Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) 84 } 85 86 type echoClient struct { 87 cc *grpc.ClientConn 88 } 89 90 func NewEchoClient(cc *grpc.ClientConn) EchoClient { 91 return &echoClient{cc} 92 } 93 94 func (c *echoClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) { 95 out := new(EchoResponse) 96 err := grpc.Invoke(ctx, "/echo.Echo/Echo", in, out, c.cc, opts...) 97 if err != nil { 98 return nil, err 99 } 100 return out, nil 101 } 102 103 // Server API for Echo service 104 105 type EchoServer interface { 106 Echo(context.Context, *EchoRequest) (*EchoResponse, error) 107 } 108 109 func RegisterEchoServer(s *grpc.Server, srv EchoServer) { 110 s.RegisterService(&_Echo_serviceDesc, srv) 111 } 112 113 func _Echo_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 114 in := new(EchoRequest) 115 if err := dec(in); err != nil { 116 return nil, err 117 } 118 if interceptor == nil { 119 return srv.(EchoServer).Echo(ctx, in) 120 } 121 info := &grpc.UnaryServerInfo{ 122 Server: srv, 123 FullMethod: "/echo.Echo/Echo", 124 } 125 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 126 return srv.(EchoServer).Echo(ctx, req.(*EchoRequest)) 127 } 128 return interceptor(ctx, in, info, handler) 129 } 130 131 var _Echo_serviceDesc = grpc.ServiceDesc{ 132 ServiceName: "echo.Echo", 133 HandlerType: (*EchoServer)(nil), 134 Methods: []grpc.MethodDesc{ 135 { 136 MethodName: "Echo", 137 Handler: _Echo_Echo_Handler, 138 }, 139 }, 140 Streams: []grpc.StreamDesc{}, 141 Metadata: "echo.proto", 142 } 143 144 func init() { proto.RegisterFile("echo.proto", fileDescriptor0) } 145 146 var fileDescriptor0 = []byte{ 147 // 126 bytes of a gzipped FileDescriptorProto 148 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0x4d, 0xce, 0xc8, 149 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x01, 0xb1, 0x95, 0xe4, 0xb9, 0xb8, 0x5d, 0x93, 150 0x33, 0xf2, 0x83, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x04, 0xb8, 0x98, 0x8b, 0x52, 0x0b, 151 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x40, 0x4c, 0x25, 0x35, 0x2e, 0x1e, 0x88, 0x82, 0xe2, 152 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0x21, 0x31, 0x2e, 0xb6, 0xa2, 0xd4, 0xe2, 0xd2, 0x9c, 0x12, 0xa8, 153 0x22, 0x28, 0xcf, 0xc8, 0x9c, 0x8b, 0x05, 0xa4, 0x4e, 0x48, 0x1f, 0x4a, 0x0b, 0xea, 0x81, 0xed, 154 0x42, 0x32, 0x5c, 0x4a, 0x08, 0x59, 0x08, 0x62, 0x9c, 0x12, 0x43, 0x12, 0x1b, 0xd8, 0x39, 0xc6, 155 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1b, 0x48, 0x20, 0x0f, 0x9c, 0x00, 0x00, 0x00, 156 }