hello.pb.go 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: hello.proto
  3. package hello
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import (
  8. context "golang.org/x/net/context"
  9. grpc "google.golang.org/grpc"
  10. )
  11. // Reference imports to suppress errors if they are not otherwise used.
  12. var _ = proto.Marshal
  13. var _ = fmt.Errorf
  14. var _ = math.Inf
  15. // This is a compile-time assertion to ensure that this generated file
  16. // is compatible with the proto package it is being compiled against.
  17. // A compilation error at this line likely means your copy of the
  18. // proto package needs to be updated.
  19. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  20. // The request message containing the user's name.
  21. type HelloRequest struct {
  22. Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
  23. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  24. XXX_unrecognized []byte `json:"-"`
  25. XXX_sizecache int32 `json:"-"`
  26. }
  27. func (m *HelloRequest) Reset() { *m = HelloRequest{} }
  28. func (m *HelloRequest) String() string { return proto.CompactTextString(m) }
  29. func (*HelloRequest) ProtoMessage() {}
  30. func (*HelloRequest) Descriptor() ([]byte, []int) {
  31. return fileDescriptor_hello_4c93420831fe68fb, []int{0}
  32. }
  33. func (m *HelloRequest) XXX_Unmarshal(b []byte) error {
  34. return xxx_messageInfo_HelloRequest.Unmarshal(m, b)
  35. }
  36. func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  37. return xxx_messageInfo_HelloRequest.Marshal(b, m, deterministic)
  38. }
  39. func (dst *HelloRequest) XXX_Merge(src proto.Message) {
  40. xxx_messageInfo_HelloRequest.Merge(dst, src)
  41. }
  42. func (m *HelloRequest) XXX_Size() int {
  43. return xxx_messageInfo_HelloRequest.Size(m)
  44. }
  45. func (m *HelloRequest) XXX_DiscardUnknown() {
  46. xxx_messageInfo_HelloRequest.DiscardUnknown(m)
  47. }
  48. var xxx_messageInfo_HelloRequest proto.InternalMessageInfo
  49. func (m *HelloRequest) GetName() string {
  50. if m != nil {
  51. return m.Name
  52. }
  53. return ""
  54. }
  55. // The response message containing the greetings
  56. type HelloReply struct {
  57. Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
  58. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  59. XXX_unrecognized []byte `json:"-"`
  60. XXX_sizecache int32 `json:"-"`
  61. }
  62. func (m *HelloReply) Reset() { *m = HelloReply{} }
  63. func (m *HelloReply) String() string { return proto.CompactTextString(m) }
  64. func (*HelloReply) ProtoMessage() {}
  65. func (*HelloReply) Descriptor() ([]byte, []int) {
  66. return fileDescriptor_hello_4c93420831fe68fb, []int{1}
  67. }
  68. func (m *HelloReply) XXX_Unmarshal(b []byte) error {
  69. return xxx_messageInfo_HelloReply.Unmarshal(m, b)
  70. }
  71. func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  72. return xxx_messageInfo_HelloReply.Marshal(b, m, deterministic)
  73. }
  74. func (dst *HelloReply) XXX_Merge(src proto.Message) {
  75. xxx_messageInfo_HelloReply.Merge(dst, src)
  76. }
  77. func (m *HelloReply) XXX_Size() int {
  78. return xxx_messageInfo_HelloReply.Size(m)
  79. }
  80. func (m *HelloReply) XXX_DiscardUnknown() {
  81. xxx_messageInfo_HelloReply.DiscardUnknown(m)
  82. }
  83. var xxx_messageInfo_HelloReply proto.InternalMessageInfo
  84. func (m *HelloReply) GetMessage() string {
  85. if m != nil {
  86. return m.Message
  87. }
  88. return ""
  89. }
  90. func init() {
  91. proto.RegisterType((*HelloRequest)(nil), "HelloRequest")
  92. proto.RegisterType((*HelloReply)(nil), "HelloReply")
  93. }
  94. // Reference imports to suppress errors if they are not otherwise used.
  95. var _ context.Context
  96. var _ grpc.ClientConn
  97. // This is a compile-time assertion to ensure that this generated file
  98. // is compatible with the grpc package it is being compiled against.
  99. const _ = grpc.SupportPackageIsVersion4
  100. // Client API for Greeter service
  101. type GreeterClient interface {
  102. // Sends a greeting
  103. SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
  104. // Sends another greeting
  105. SayHelloAgain(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
  106. }
  107. type greeterClient struct {
  108. cc *grpc.ClientConn
  109. }
  110. func NewGreeterClient(cc *grpc.ClientConn) GreeterClient {
  111. return &greeterClient{cc}
  112. }
  113. func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) {
  114. out := new(HelloReply)
  115. err := grpc.Invoke(ctx, "/Greeter/SayHello", in, out, c.cc, opts...)
  116. if err != nil {
  117. return nil, err
  118. }
  119. return out, nil
  120. }
  121. func (c *greeterClient) SayHelloAgain(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) {
  122. out := new(HelloReply)
  123. err := grpc.Invoke(ctx, "/Greeter/SayHelloAgain", in, out, c.cc, opts...)
  124. if err != nil {
  125. return nil, err
  126. }
  127. return out, nil
  128. }
  129. // Server API for Greeter service
  130. type GreeterServer interface {
  131. // Sends a greeting
  132. SayHello(context.Context, *HelloRequest) (*HelloReply, error)
  133. // Sends another greeting
  134. SayHelloAgain(context.Context, *HelloRequest) (*HelloReply, error)
  135. }
  136. func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) {
  137. s.RegisterService(&_Greeter_serviceDesc, srv)
  138. }
  139. func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  140. in := new(HelloRequest)
  141. if err := dec(in); err != nil {
  142. return nil, err
  143. }
  144. if interceptor == nil {
  145. return srv.(GreeterServer).SayHello(ctx, in)
  146. }
  147. info := &grpc.UnaryServerInfo{
  148. Server: srv,
  149. FullMethod: "/Greeter/SayHello",
  150. }
  151. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  152. return srv.(GreeterServer).SayHello(ctx, req.(*HelloRequest))
  153. }
  154. return interceptor(ctx, in, info, handler)
  155. }
  156. func _Greeter_SayHelloAgain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  157. in := new(HelloRequest)
  158. if err := dec(in); err != nil {
  159. return nil, err
  160. }
  161. if interceptor == nil {
  162. return srv.(GreeterServer).SayHelloAgain(ctx, in)
  163. }
  164. info := &grpc.UnaryServerInfo{
  165. Server: srv,
  166. FullMethod: "/Greeter/SayHelloAgain",
  167. }
  168. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  169. return srv.(GreeterServer).SayHelloAgain(ctx, req.(*HelloRequest))
  170. }
  171. return interceptor(ctx, in, info, handler)
  172. }
  173. var _Greeter_serviceDesc = grpc.ServiceDesc{
  174. ServiceName: "Greeter",
  175. HandlerType: (*GreeterServer)(nil),
  176. Methods: []grpc.MethodDesc{
  177. {
  178. MethodName: "SayHello",
  179. Handler: _Greeter_SayHello_Handler,
  180. },
  181. {
  182. MethodName: "SayHelloAgain",
  183. Handler: _Greeter_SayHelloAgain_Handler,
  184. },
  185. },
  186. Streams: []grpc.StreamDesc{},
  187. Metadata: "hello.proto",
  188. }
  189. func init() { proto.RegisterFile("hello.proto", fileDescriptor_hello_4c93420831fe68fb) }
  190. var fileDescriptor_hello_4c93420831fe68fb = []byte{
  191. // 141 bytes of a gzipped FileDescriptorProto
  192. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0x48, 0xcd, 0xc9,
  193. 0xc9, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x57, 0x52, 0xe2, 0xe2, 0xf1, 0x00, 0x71, 0x83, 0x52,
  194. 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x84, 0xb8, 0x58, 0xf2, 0x12, 0x73, 0x53, 0x25, 0x18, 0x15,
  195. 0x18, 0x35, 0x38, 0x83, 0xc0, 0x6c, 0x25, 0x35, 0x2e, 0x2e, 0xa8, 0x9a, 0x82, 0x9c, 0x4a, 0x21,
  196. 0x09, 0x2e, 0xf6, 0xdc, 0xd4, 0xe2, 0xe2, 0xc4, 0x74, 0x98, 0x22, 0x18, 0xd7, 0x28, 0x89, 0x8b,
  197. 0xdd, 0xbd, 0x28, 0x35, 0xb5, 0x24, 0xb5, 0x48, 0x48, 0x83, 0x8b, 0x23, 0x38, 0xb1, 0x12, 0xac,
  198. 0x4b, 0x88, 0x57, 0x0f, 0xd9, 0x06, 0x29, 0x6e, 0x3d, 0x84, 0x61, 0x4a, 0x0c, 0x42, 0xba, 0x5c,
  199. 0xbc, 0x30, 0x95, 0x8e, 0xe9, 0x89, 0x99, 0x79, 0xf8, 0x95, 0x27, 0xb1, 0x81, 0x9d, 0x6d, 0x0c,
  200. 0x08, 0x00, 0x00, 0xff, 0xff, 0xa6, 0x84, 0x2d, 0xb6, 0xc5, 0x00, 0x00, 0x00,
  201. }