greet.pb.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.26.0
  4. // protoc v3.20.0
  5. // source: greet.proto
  6. package greet
  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 GreetRequest 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 *GreetRequest) Reset() {
  30. *x = GreetRequest{}
  31. if protoimpl.UnsafeEnabled {
  32. mi := &file_greet_proto_msgTypes[0]
  33. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  34. ms.StoreMessageInfo(mi)
  35. }
  36. }
  37. func (x *GreetRequest) String() string {
  38. return protoimpl.X.MessageStringOf(x)
  39. }
  40. func (*GreetRequest) ProtoMessage() {}
  41. func (x *GreetRequest) ProtoReflect() protoreflect.Message {
  42. mi := &file_greet_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 GreetRequest.ProtoReflect.Descriptor instead.
  53. func (*GreetRequest) Descriptor() ([]byte, []int) {
  54. return file_greet_proto_rawDescGZIP(), []int{0}
  55. }
  56. func (x *GreetRequest) GetName() string {
  57. if x != nil {
  58. return x.Name
  59. }
  60. return ""
  61. }
  62. type GreetResponse struct {
  63. state protoimpl.MessageState
  64. sizeCache protoimpl.SizeCache
  65. unknownFields protoimpl.UnknownFields
  66. Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
  67. From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`
  68. }
  69. func (x *GreetResponse) Reset() {
  70. *x = GreetResponse{}
  71. if protoimpl.UnsafeEnabled {
  72. mi := &file_greet_proto_msgTypes[1]
  73. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  74. ms.StoreMessageInfo(mi)
  75. }
  76. }
  77. func (x *GreetResponse) String() string {
  78. return protoimpl.X.MessageStringOf(x)
  79. }
  80. func (*GreetResponse) ProtoMessage() {}
  81. func (x *GreetResponse) ProtoReflect() protoreflect.Message {
  82. mi := &file_greet_proto_msgTypes[1]
  83. if protoimpl.UnsafeEnabled && x != nil {
  84. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  85. if ms.LoadMessageInfo() == nil {
  86. ms.StoreMessageInfo(mi)
  87. }
  88. return ms
  89. }
  90. return mi.MessageOf(x)
  91. }
  92. // Deprecated: Use GreetResponse.ProtoReflect.Descriptor instead.
  93. func (*GreetResponse) Descriptor() ([]byte, []int) {
  94. return file_greet_proto_rawDescGZIP(), []int{1}
  95. }
  96. func (x *GreetResponse) GetMessage() string {
  97. if x != nil {
  98. return x.Message
  99. }
  100. return ""
  101. }
  102. func (x *GreetResponse) GetFrom() string {
  103. if x != nil {
  104. return x.From
  105. }
  106. return ""
  107. }
  108. var File_greet_proto protoreflect.FileDescriptor
  109. var file_greet_proto_rawDesc = []byte{
  110. 0x0a, 0x0b, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x22, 0x0a,
  111. 0x0c, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a,
  112. 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
  113. 0x65, 0x22, 0x3d, 0x0a, 0x0d, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
  114. 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20,
  115. 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04,
  116. 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d,
  117. 0x32, 0x5d, 0x0a, 0x05, 0x47, 0x72, 0x65, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x4d, 0x6f, 0x72,
  118. 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x0d, 0x2e, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75,
  119. 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
  120. 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x28, 0x0a, 0x05, 0x4e, 0x69, 0x67, 0x68, 0x74, 0x12, 0x0d,
  121. 0x2e, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e,
  122. 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42,
  123. 0x09, 0x5a, 0x07, 0x2f, 0x3b, 0x67, 0x72, 0x65, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
  124. 0x6f, 0x33,
  125. }
  126. var (
  127. file_greet_proto_rawDescOnce sync.Once
  128. file_greet_proto_rawDescData = file_greet_proto_rawDesc
  129. )
  130. func file_greet_proto_rawDescGZIP() []byte {
  131. file_greet_proto_rawDescOnce.Do(func() {
  132. file_greet_proto_rawDescData = protoimpl.X.CompressGZIP(file_greet_proto_rawDescData)
  133. })
  134. return file_greet_proto_rawDescData
  135. }
  136. var file_greet_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
  137. var file_greet_proto_goTypes = []interface{}{
  138. (*GreetRequest)(nil), // 0: GreetRequest
  139. (*GreetResponse)(nil), // 1: GreetResponse
  140. }
  141. var file_greet_proto_depIdxs = []int32{
  142. 0, // 0: Greet.Morning:input_type -> GreetRequest
  143. 0, // 1: Greet.Night:input_type -> GreetRequest
  144. 1, // 2: Greet.Morning:output_type -> GreetResponse
  145. 1, // 3: Greet.Night:output_type -> GreetResponse
  146. 2, // [2:4] is the sub-list for method output_type
  147. 0, // [0:2] is the sub-list for method input_type
  148. 0, // [0:0] is the sub-list for extension type_name
  149. 0, // [0:0] is the sub-list for extension extendee
  150. 0, // [0:0] is the sub-list for field type_name
  151. }
  152. func init() { file_greet_proto_init() }
  153. func file_greet_proto_init() {
  154. if File_greet_proto != nil {
  155. return
  156. }
  157. if !protoimpl.UnsafeEnabled {
  158. file_greet_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  159. switch v := v.(*GreetRequest); i {
  160. case 0:
  161. return &v.state
  162. case 1:
  163. return &v.sizeCache
  164. case 2:
  165. return &v.unknownFields
  166. default:
  167. return nil
  168. }
  169. }
  170. file_greet_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  171. switch v := v.(*GreetResponse); i {
  172. case 0:
  173. return &v.state
  174. case 1:
  175. return &v.sizeCache
  176. case 2:
  177. return &v.unknownFields
  178. default:
  179. return nil
  180. }
  181. }
  182. }
  183. type x struct{}
  184. out := protoimpl.TypeBuilder{
  185. File: protoimpl.DescBuilder{
  186. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  187. RawDescriptor: file_greet_proto_rawDesc,
  188. NumEnums: 0,
  189. NumMessages: 2,
  190. NumExtensions: 0,
  191. NumServices: 1,
  192. },
  193. GoTypes: file_greet_proto_goTypes,
  194. DependencyIndexes: file_greet_proto_depIdxs,
  195. MessageInfos: file_greet_proto_msgTypes,
  196. }.Build()
  197. File_greet_proto = out.File
  198. file_greet_proto_rawDesc = nil
  199. file_greet_proto_goTypes = nil
  200. file_greet_proto_depIdxs = nil
  201. }
  202. // Reference imports to suppress errors if they are not otherwise used.
  203. var _ context.Context
  204. var _ grpc.ClientConnInterface
  205. // This is a compile-time assertion to ensure that this generated file
  206. // is compatible with the grpc package it is being compiled against.
  207. const _ = grpc.SupportPackageIsVersion6
  208. // GreetClient is the client API for Greet service.
  209. //
  210. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  211. type GreetClient interface {
  212. Morning(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error)
  213. Night(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error)
  214. }
  215. type greetClient struct {
  216. cc grpc.ClientConnInterface
  217. }
  218. func NewGreetClient(cc grpc.ClientConnInterface) GreetClient {
  219. return &greetClient{cc}
  220. }
  221. func (c *greetClient) Morning(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error) {
  222. out := new(GreetResponse)
  223. err := c.cc.Invoke(ctx, "/Greet/Morning", in, out, opts...)
  224. if err != nil {
  225. return nil, err
  226. }
  227. return out, nil
  228. }
  229. func (c *greetClient) Night(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error) {
  230. out := new(GreetResponse)
  231. err := c.cc.Invoke(ctx, "/Greet/Night", in, out, opts...)
  232. if err != nil {
  233. return nil, err
  234. }
  235. return out, nil
  236. }
  237. // GreetServer is the server API for Greet service.
  238. type GreetServer interface {
  239. Morning(context.Context, *GreetRequest) (*GreetResponse, error)
  240. Night(context.Context, *GreetRequest) (*GreetResponse, error)
  241. }
  242. // UnimplementedGreetServer can be embedded to have forward compatible implementations.
  243. type UnimplementedGreetServer struct {
  244. }
  245. func (*UnimplementedGreetServer) Morning(context.Context, *GreetRequest) (*GreetResponse, error) {
  246. return nil, status.Errorf(codes.Unimplemented, "method Morning not implemented")
  247. }
  248. func (*UnimplementedGreetServer) Night(context.Context, *GreetRequest) (*GreetResponse, error) {
  249. return nil, status.Errorf(codes.Unimplemented, "method Night not implemented")
  250. }
  251. func RegisterGreetServer(s *grpc.Server, srv GreetServer) {
  252. s.RegisterService(&_Greet_serviceDesc, srv)
  253. }
  254. func _Greet_Morning_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  255. in := new(GreetRequest)
  256. if err := dec(in); err != nil {
  257. return nil, err
  258. }
  259. if interceptor == nil {
  260. return srv.(GreetServer).Morning(ctx, in)
  261. }
  262. info := &grpc.UnaryServerInfo{
  263. Server: srv,
  264. FullMethod: "/Greet/Morning",
  265. }
  266. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  267. return srv.(GreetServer).Morning(ctx, req.(*GreetRequest))
  268. }
  269. return interceptor(ctx, in, info, handler)
  270. }
  271. func _Greet_Night_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  272. in := new(GreetRequest)
  273. if err := dec(in); err != nil {
  274. return nil, err
  275. }
  276. if interceptor == nil {
  277. return srv.(GreetServer).Night(ctx, in)
  278. }
  279. info := &grpc.UnaryServerInfo{
  280. Server: srv,
  281. FullMethod: "/Greet/Night",
  282. }
  283. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  284. return srv.(GreetServer).Night(ctx, req.(*GreetRequest))
  285. }
  286. return interceptor(ctx, in, info, handler)
  287. }
  288. var _Greet_serviceDesc = grpc.ServiceDesc{
  289. ServiceName: "Greet",
  290. HandlerType: (*GreetServer)(nil),
  291. Methods: []grpc.MethodDesc{
  292. {
  293. MethodName: "Morning",
  294. Handler: _Greet_Morning_Handler,
  295. },
  296. {
  297. MethodName: "Night",
  298. Handler: _Greet_Night_Handler,
  299. },
  300. },
  301. Streams: []grpc.StreamDesc{},
  302. Metadata: "greet.proto",
  303. }