demo.pb.go 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.25.0-devel
  4. // protoc v3.14.0
  5. // source: proto/demo/demo.proto
  6. package demo
  7. import (
  8. context "context"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  13. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  14. reflect "reflect"
  15. sync "sync"
  16. )
  17. const (
  18. // Verify that this generated code is sufficiently up-to-date.
  19. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  20. // Verify that runtime/protoimpl is sufficiently up-to-date.
  21. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  22. )
  23. type DemoRequest struct {
  24. state protoimpl.MessageState
  25. sizeCache protoimpl.SizeCache
  26. unknownFields protoimpl.UnknownFields
  27. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  28. }
  29. func (x *DemoRequest) Reset() {
  30. *x = DemoRequest{}
  31. if protoimpl.UnsafeEnabled {
  32. mi := &file_proto_demo_demo_proto_msgTypes[0]
  33. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  34. ms.StoreMessageInfo(mi)
  35. }
  36. }
  37. func (x *DemoRequest) String() string {
  38. return protoimpl.X.MessageStringOf(x)
  39. }
  40. func (*DemoRequest) ProtoMessage() {}
  41. func (x *DemoRequest) ProtoReflect() protoreflect.Message {
  42. mi := &file_proto_demo_demo_proto_msgTypes[0]
  43. if protoimpl.UnsafeEnabled && x != nil {
  44. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  45. if ms.LoadMessageInfo() == nil {
  46. ms.StoreMessageInfo(mi)
  47. }
  48. return ms
  49. }
  50. return mi.MessageOf(x)
  51. }
  52. // Deprecated: Use DemoRequest.ProtoReflect.Descriptor instead.
  53. func (*DemoRequest) Descriptor() ([]byte, []int) {
  54. return file_proto_demo_demo_proto_rawDescGZIP(), []int{0}
  55. }
  56. func (x *DemoRequest) GetName() string {
  57. if x != nil {
  58. return x.Name
  59. }
  60. return ""
  61. }
  62. type DemoResponse struct {
  63. state protoimpl.MessageState
  64. sizeCache protoimpl.SizeCache
  65. unknownFields protoimpl.UnknownFields
  66. Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
  67. }
  68. func (x *DemoResponse) Reset() {
  69. *x = DemoResponse{}
  70. if protoimpl.UnsafeEnabled {
  71. mi := &file_proto_demo_demo_proto_msgTypes[1]
  72. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  73. ms.StoreMessageInfo(mi)
  74. }
  75. }
  76. func (x *DemoResponse) String() string {
  77. return protoimpl.X.MessageStringOf(x)
  78. }
  79. func (*DemoResponse) ProtoMessage() {}
  80. func (x *DemoResponse) ProtoReflect() protoreflect.Message {
  81. mi := &file_proto_demo_demo_proto_msgTypes[1]
  82. if protoimpl.UnsafeEnabled && x != nil {
  83. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  84. if ms.LoadMessageInfo() == nil {
  85. ms.StoreMessageInfo(mi)
  86. }
  87. return ms
  88. }
  89. return mi.MessageOf(x)
  90. }
  91. // Deprecated: Use DemoResponse.ProtoReflect.Descriptor instead.
  92. func (*DemoResponse) Descriptor() ([]byte, []int) {
  93. return file_proto_demo_demo_proto_rawDescGZIP(), []int{1}
  94. }
  95. func (x *DemoResponse) GetText() string {
  96. if x != nil {
  97. return x.Text
  98. }
  99. return ""
  100. }
  101. var File_proto_demo_demo_proto protoreflect.FileDescriptor
  102. var file_proto_demo_demo_proto_rawDesc = []byte{
  103. 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x65, 0x6d, 0x6f, 0x2f, 0x64, 0x65, 0x6d,
  104. 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x64, 0x65, 0x6d, 0x6f, 0x22, 0x21, 0x0a,
  105. 0x0b, 0x44, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04,
  106. 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
  107. 0x22, 0x22, 0x0a, 0x0c, 0x44, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
  108. 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
  109. 0x74, 0x65, 0x78, 0x74, 0x32, 0x42, 0x0a, 0x0b, 0x44, 0x65, 0x6d, 0x6f, 0x53, 0x65, 0x72, 0x76,
  110. 0x69, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12,
  111. 0x11, 0x2e, 0x64, 0x65, 0x6d, 0x6f, 0x2e, 0x44, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65,
  112. 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x64, 0x65, 0x6d, 0x6f, 0x2e, 0x44, 0x65, 0x6d, 0x6f, 0x52, 0x65,
  113. 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
  114. }
  115. var (
  116. file_proto_demo_demo_proto_rawDescOnce sync.Once
  117. file_proto_demo_demo_proto_rawDescData = file_proto_demo_demo_proto_rawDesc
  118. )
  119. func file_proto_demo_demo_proto_rawDescGZIP() []byte {
  120. file_proto_demo_demo_proto_rawDescOnce.Do(func() {
  121. file_proto_demo_demo_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_demo_demo_proto_rawDescData)
  122. })
  123. return file_proto_demo_demo_proto_rawDescData
  124. }
  125. var file_proto_demo_demo_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
  126. var file_proto_demo_demo_proto_goTypes = []interface{}{
  127. (*DemoRequest)(nil), // 0: demo.DemoRequest
  128. (*DemoResponse)(nil), // 1: demo.DemoResponse
  129. }
  130. var file_proto_demo_demo_proto_depIdxs = []int32{
  131. 0, // 0: demo.DemoService.SayHello:input_type -> demo.DemoRequest
  132. 1, // 1: demo.DemoService.SayHello:output_type -> demo.DemoResponse
  133. 1, // [1:2] is the sub-list for method output_type
  134. 0, // [0:1] is the sub-list for method input_type
  135. 0, // [0:0] is the sub-list for extension type_name
  136. 0, // [0:0] is the sub-list for extension extendee
  137. 0, // [0:0] is the sub-list for field type_name
  138. }
  139. func init() { file_proto_demo_demo_proto_init() }
  140. func file_proto_demo_demo_proto_init() {
  141. if File_proto_demo_demo_proto != nil {
  142. return
  143. }
  144. if !protoimpl.UnsafeEnabled {
  145. file_proto_demo_demo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  146. switch v := v.(*DemoRequest); i {
  147. case 0:
  148. return &v.state
  149. case 1:
  150. return &v.sizeCache
  151. case 2:
  152. return &v.unknownFields
  153. default:
  154. return nil
  155. }
  156. }
  157. file_proto_demo_demo_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  158. switch v := v.(*DemoResponse); i {
  159. case 0:
  160. return &v.state
  161. case 1:
  162. return &v.sizeCache
  163. case 2:
  164. return &v.unknownFields
  165. default:
  166. return nil
  167. }
  168. }
  169. }
  170. type x struct{}
  171. out := protoimpl.TypeBuilder{
  172. File: protoimpl.DescBuilder{
  173. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  174. RawDescriptor: file_proto_demo_demo_proto_rawDesc,
  175. NumEnums: 0,
  176. NumMessages: 2,
  177. NumExtensions: 0,
  178. NumServices: 1,
  179. },
  180. GoTypes: file_proto_demo_demo_proto_goTypes,
  181. DependencyIndexes: file_proto_demo_demo_proto_depIdxs,
  182. MessageInfos: file_proto_demo_demo_proto_msgTypes,
  183. }.Build()
  184. File_proto_demo_demo_proto = out.File
  185. file_proto_demo_demo_proto_rawDesc = nil
  186. file_proto_demo_demo_proto_goTypes = nil
  187. file_proto_demo_demo_proto_depIdxs = nil
  188. }
  189. // Reference imports to suppress errors if they are not otherwise used.
  190. var _ context.Context
  191. var _ grpc.ClientConnInterface
  192. // This is a compile-time assertion to ensure that this generated file
  193. // is compatible with the grpc package it is being compiled against.
  194. const _ = grpc.SupportPackageIsVersion6
  195. // DemoServiceClient is the client API for DemoService service.
  196. //
  197. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  198. type DemoServiceClient interface {
  199. SayHello(ctx context.Context, in *DemoRequest, opts ...grpc.CallOption) (*DemoResponse, error)
  200. }
  201. type demoServiceClient struct {
  202. cc grpc.ClientConnInterface
  203. }
  204. func NewDemoServiceClient(cc grpc.ClientConnInterface) DemoServiceClient {
  205. return &demoServiceClient{cc}
  206. }
  207. func (c *demoServiceClient) SayHello(ctx context.Context, in *DemoRequest, opts ...grpc.CallOption) (*DemoResponse, error) {
  208. out := new(DemoResponse)
  209. err := c.cc.Invoke(ctx, "/demo.DemoService/SayHello", in, out, opts...)
  210. if err != nil {
  211. return nil, err
  212. }
  213. return out, nil
  214. }
  215. // DemoServiceServer is the server API for DemoService service.
  216. type DemoServiceServer interface {
  217. SayHello(context.Context, *DemoRequest) (*DemoResponse, error)
  218. }
  219. // UnimplementedDemoServiceServer can be embedded to have forward compatible implementations.
  220. type UnimplementedDemoServiceServer struct {
  221. }
  222. func (*UnimplementedDemoServiceServer) SayHello(context.Context, *DemoRequest) (*DemoResponse, error) {
  223. return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
  224. }
  225. func RegisterDemoServiceServer(s *grpc.Server, srv DemoServiceServer) {
  226. s.RegisterService(&_DemoService_serviceDesc, srv)
  227. }
  228. func _DemoService_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  229. in := new(DemoRequest)
  230. if err := dec(in); err != nil {
  231. return nil, err
  232. }
  233. if interceptor == nil {
  234. return srv.(DemoServiceServer).SayHello(ctx, in)
  235. }
  236. info := &grpc.UnaryServerInfo{
  237. Server: srv,
  238. FullMethod: "/demo.DemoService/SayHello",
  239. }
  240. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  241. return srv.(DemoServiceServer).SayHello(ctx, req.(*DemoRequest))
  242. }
  243. return interceptor(ctx, in, info, handler)
  244. }
  245. var _DemoService_serviceDesc = grpc.ServiceDesc{
  246. ServiceName: "demo.DemoService",
  247. HandlerType: (*DemoServiceServer)(nil),
  248. Methods: []grpc.MethodDesc{
  249. {
  250. MethodName: "SayHello",
  251. Handler: _DemoService_SayHello_Handler,
  252. },
  253. },
  254. Streams: []grpc.StreamDesc{},
  255. Metadata: "proto/demo/demo.proto",
  256. }