helloworld.pb.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: examples/helloworld/api/helloworld.proto
  3. package v1
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import _ "google.golang.org/genproto/googleapis/api/annotations"
  8. import (
  9. context "golang.org/x/net/context"
  10. grpc "google.golang.org/grpc"
  11. )
  12. // Reference imports to suppress errors if they are not otherwise used.
  13. var _ = proto.Marshal
  14. var _ = fmt.Errorf
  15. var _ = math.Inf
  16. // This is a compile-time assertion to ensure that this generated file
  17. // is compatible with the proto package it is being compiled against.
  18. // A compilation error at this line likely means your copy of the
  19. // proto package needs to be updated.
  20. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  21. // The request message containing the user's name.
  22. type HelloRequest struct {
  23. Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
  24. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  25. XXX_unrecognized []byte `json:"-"`
  26. XXX_sizecache int32 `json:"-"`
  27. }
  28. func (m *HelloRequest) Reset() { *m = HelloRequest{} }
  29. func (m *HelloRequest) String() string { return proto.CompactTextString(m) }
  30. func (*HelloRequest) ProtoMessage() {}
  31. func (*HelloRequest) Descriptor() ([]byte, []int) {
  32. return fileDescriptor_helloworld_240ffe8e5d7496cc, []int{0}
  33. }
  34. func (m *HelloRequest) XXX_Unmarshal(b []byte) error {
  35. return xxx_messageInfo_HelloRequest.Unmarshal(m, b)
  36. }
  37. func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  38. return xxx_messageInfo_HelloRequest.Marshal(b, m, deterministic)
  39. }
  40. func (dst *HelloRequest) XXX_Merge(src proto.Message) {
  41. xxx_messageInfo_HelloRequest.Merge(dst, src)
  42. }
  43. func (m *HelloRequest) XXX_Size() int {
  44. return xxx_messageInfo_HelloRequest.Size(m)
  45. }
  46. func (m *HelloRequest) XXX_DiscardUnknown() {
  47. xxx_messageInfo_HelloRequest.DiscardUnknown(m)
  48. }
  49. var xxx_messageInfo_HelloRequest proto.InternalMessageInfo
  50. func (m *HelloRequest) GetName() string {
  51. if m != nil {
  52. return m.Name
  53. }
  54. return ""
  55. }
  56. // The response message containing the greetings
  57. type HelloReply struct {
  58. Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
  59. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  60. XXX_unrecognized []byte `json:"-"`
  61. XXX_sizecache int32 `json:"-"`
  62. }
  63. func (m *HelloReply) Reset() { *m = HelloReply{} }
  64. func (m *HelloReply) String() string { return proto.CompactTextString(m) }
  65. func (*HelloReply) ProtoMessage() {}
  66. func (*HelloReply) Descriptor() ([]byte, []int) {
  67. return fileDescriptor_helloworld_240ffe8e5d7496cc, []int{1}
  68. }
  69. func (m *HelloReply) XXX_Unmarshal(b []byte) error {
  70. return xxx_messageInfo_HelloReply.Unmarshal(m, b)
  71. }
  72. func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  73. return xxx_messageInfo_HelloReply.Marshal(b, m, deterministic)
  74. }
  75. func (dst *HelloReply) XXX_Merge(src proto.Message) {
  76. xxx_messageInfo_HelloReply.Merge(dst, src)
  77. }
  78. func (m *HelloReply) XXX_Size() int {
  79. return xxx_messageInfo_HelloReply.Size(m)
  80. }
  81. func (m *HelloReply) XXX_DiscardUnknown() {
  82. xxx_messageInfo_HelloReply.DiscardUnknown(m)
  83. }
  84. var xxx_messageInfo_HelloReply proto.InternalMessageInfo
  85. func (m *HelloReply) GetMessage() string {
  86. if m != nil {
  87. return m.Message
  88. }
  89. return ""
  90. }
  91. type EchoRequest struct {
  92. Content string `protobuf:"bytes,1,opt,name=content" json:"content,omitempty"`
  93. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  94. XXX_unrecognized []byte `json:"-"`
  95. XXX_sizecache int32 `json:"-"`
  96. }
  97. func (m *EchoRequest) Reset() { *m = EchoRequest{} }
  98. func (m *EchoRequest) String() string { return proto.CompactTextString(m) }
  99. func (*EchoRequest) ProtoMessage() {}
  100. func (*EchoRequest) Descriptor() ([]byte, []int) {
  101. return fileDescriptor_helloworld_240ffe8e5d7496cc, []int{2}
  102. }
  103. func (m *EchoRequest) XXX_Unmarshal(b []byte) error {
  104. return xxx_messageInfo_EchoRequest.Unmarshal(m, b)
  105. }
  106. func (m *EchoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  107. return xxx_messageInfo_EchoRequest.Marshal(b, m, deterministic)
  108. }
  109. func (dst *EchoRequest) XXX_Merge(src proto.Message) {
  110. xxx_messageInfo_EchoRequest.Merge(dst, src)
  111. }
  112. func (m *EchoRequest) XXX_Size() int {
  113. return xxx_messageInfo_EchoRequest.Size(m)
  114. }
  115. func (m *EchoRequest) XXX_DiscardUnknown() {
  116. xxx_messageInfo_EchoRequest.DiscardUnknown(m)
  117. }
  118. var xxx_messageInfo_EchoRequest proto.InternalMessageInfo
  119. func (m *EchoRequest) GetContent() string {
  120. if m != nil {
  121. return m.Content
  122. }
  123. return ""
  124. }
  125. type EchoReply struct {
  126. Content string `protobuf:"bytes,1,opt,name=content" json:"content,omitempty"`
  127. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  128. XXX_unrecognized []byte `json:"-"`
  129. XXX_sizecache int32 `json:"-"`
  130. }
  131. func (m *EchoReply) Reset() { *m = EchoReply{} }
  132. func (m *EchoReply) String() string { return proto.CompactTextString(m) }
  133. func (*EchoReply) ProtoMessage() {}
  134. func (*EchoReply) Descriptor() ([]byte, []int) {
  135. return fileDescriptor_helloworld_240ffe8e5d7496cc, []int{3}
  136. }
  137. func (m *EchoReply) XXX_Unmarshal(b []byte) error {
  138. return xxx_messageInfo_EchoReply.Unmarshal(m, b)
  139. }
  140. func (m *EchoReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  141. return xxx_messageInfo_EchoReply.Marshal(b, m, deterministic)
  142. }
  143. func (dst *EchoReply) XXX_Merge(src proto.Message) {
  144. xxx_messageInfo_EchoReply.Merge(dst, src)
  145. }
  146. func (m *EchoReply) XXX_Size() int {
  147. return xxx_messageInfo_EchoReply.Size(m)
  148. }
  149. func (m *EchoReply) XXX_DiscardUnknown() {
  150. xxx_messageInfo_EchoReply.DiscardUnknown(m)
  151. }
  152. var xxx_messageInfo_EchoReply proto.InternalMessageInfo
  153. func (m *EchoReply) GetContent() string {
  154. if m != nil {
  155. return m.Content
  156. }
  157. return ""
  158. }
  159. func init() {
  160. proto.RegisterType((*HelloRequest)(nil), "helloworld.v1.HelloRequest")
  161. proto.RegisterType((*HelloReply)(nil), "helloworld.v1.HelloReply")
  162. proto.RegisterType((*EchoRequest)(nil), "helloworld.v1.EchoRequest")
  163. proto.RegisterType((*EchoReply)(nil), "helloworld.v1.EchoReply")
  164. }
  165. // Reference imports to suppress errors if they are not otherwise used.
  166. var _ context.Context
  167. var _ grpc.ClientConn
  168. // This is a compile-time assertion to ensure that this generated file
  169. // is compatible with the grpc package it is being compiled against.
  170. const _ = grpc.SupportPackageIsVersion4
  171. // Client API for Hello service
  172. type HelloClient interface {
  173. // Sends a greeting
  174. SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
  175. Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoReply, error)
  176. }
  177. type helloClient struct {
  178. cc *grpc.ClientConn
  179. }
  180. func NewHelloClient(cc *grpc.ClientConn) HelloClient {
  181. return &helloClient{cc}
  182. }
  183. func (c *helloClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) {
  184. out := new(HelloReply)
  185. err := grpc.Invoke(ctx, "/helloworld.v1.Hello/SayHello", in, out, c.cc, opts...)
  186. if err != nil {
  187. return nil, err
  188. }
  189. return out, nil
  190. }
  191. func (c *helloClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoReply, error) {
  192. out := new(EchoReply)
  193. err := grpc.Invoke(ctx, "/helloworld.v1.Hello/Echo", in, out, c.cc, opts...)
  194. if err != nil {
  195. return nil, err
  196. }
  197. return out, nil
  198. }
  199. // Server API for Hello service
  200. type HelloServer interface {
  201. // Sends a greeting
  202. SayHello(context.Context, *HelloRequest) (*HelloReply, error)
  203. Echo(context.Context, *EchoRequest) (*EchoReply, error)
  204. }
  205. func RegisterHelloServer(s *grpc.Server, srv HelloServer) {
  206. s.RegisterService(&_Hello_serviceDesc, srv)
  207. }
  208. func _Hello_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  209. in := new(HelloRequest)
  210. if err := dec(in); err != nil {
  211. return nil, err
  212. }
  213. if interceptor == nil {
  214. return srv.(HelloServer).SayHello(ctx, in)
  215. }
  216. info := &grpc.UnaryServerInfo{
  217. Server: srv,
  218. FullMethod: "/helloworld.v1.Hello/SayHello",
  219. }
  220. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  221. return srv.(HelloServer).SayHello(ctx, req.(*HelloRequest))
  222. }
  223. return interceptor(ctx, in, info, handler)
  224. }
  225. func _Hello_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  226. in := new(EchoRequest)
  227. if err := dec(in); err != nil {
  228. return nil, err
  229. }
  230. if interceptor == nil {
  231. return srv.(HelloServer).Echo(ctx, in)
  232. }
  233. info := &grpc.UnaryServerInfo{
  234. Server: srv,
  235. FullMethod: "/helloworld.v1.Hello/Echo",
  236. }
  237. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  238. return srv.(HelloServer).Echo(ctx, req.(*EchoRequest))
  239. }
  240. return interceptor(ctx, in, info, handler)
  241. }
  242. var _Hello_serviceDesc = grpc.ServiceDesc{
  243. ServiceName: "helloworld.v1.Hello",
  244. HandlerType: (*HelloServer)(nil),
  245. Methods: []grpc.MethodDesc{
  246. {
  247. MethodName: "SayHello",
  248. Handler: _Hello_SayHello_Handler,
  249. },
  250. {
  251. MethodName: "Echo",
  252. Handler: _Hello_Echo_Handler,
  253. },
  254. },
  255. Streams: []grpc.StreamDesc{},
  256. Metadata: "examples/helloworld/api/helloworld.proto",
  257. }
  258. func init() {
  259. proto.RegisterFile("examples/helloworld/api/helloworld.proto", fileDescriptor_helloworld_240ffe8e5d7496cc)
  260. }
  261. var fileDescriptor_helloworld_240ffe8e5d7496cc = []byte{
  262. // 258 bytes of a gzipped FileDescriptorProto
  263. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x48, 0xad, 0x48, 0xcc,
  264. 0x2d, 0xc8, 0x49, 0x2d, 0xd6, 0xcf, 0x48, 0xcd, 0xc9, 0xc9, 0x2f, 0xcf, 0x2f, 0xca, 0x49, 0xd1,
  265. 0x4f, 0x2c, 0xc8, 0x44, 0xe2, 0xea, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xf1, 0x22, 0x89, 0x94,
  266. 0x19, 0x4a, 0xc9, 0xa4, 0xe7, 0xe7, 0xa7, 0xe7, 0xa4, 0x82, 0xd5, 0x26, 0xe6, 0xe5, 0xe5, 0x97,
  267. 0x24, 0x96, 0x64, 0xe6, 0xe7, 0x15, 0x43, 0x14, 0x2b, 0x29, 0x71, 0xf1, 0x78, 0x80, 0x94, 0x07,
  268. 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x08, 0x09, 0x71, 0xb1, 0xe4, 0x25, 0xe6, 0xa6, 0x4a, 0x30,
  269. 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x81, 0xd9, 0x4a, 0x6a, 0x5c, 0x5c, 0x50, 0x35, 0x05, 0x39, 0x95,
  270. 0x42, 0x12, 0x5c, 0xec, 0xb9, 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0x30, 0x45, 0x30, 0xae, 0x92, 0x3a,
  271. 0x17, 0xb7, 0x6b, 0x72, 0x06, 0xdc, 0x28, 0x09, 0x2e, 0xf6, 0xe4, 0xfc, 0xbc, 0x92, 0xd4, 0xbc,
  272. 0x12, 0x98, 0x42, 0x28, 0x57, 0x49, 0x95, 0x8b, 0x13, 0xa2, 0x10, 0x6a, 0x1e, 0x76, 0x65, 0x46,
  273. 0x2b, 0x18, 0xb9, 0x58, 0xc1, 0x16, 0x0b, 0x05, 0x71, 0x71, 0x04, 0x27, 0x56, 0x42, 0xd8, 0xd2,
  274. 0x7a, 0x28, 0xfe, 0xd3, 0x43, 0x76, 0xbe, 0x94, 0x24, 0x76, 0xc9, 0x82, 0x9c, 0x4a, 0x25, 0xbe,
  275. 0xa6, 0xcb, 0x4f, 0x26, 0x33, 0x71, 0x08, 0xb1, 0x41, 0x42, 0x4c, 0xc8, 0x9b, 0x8b, 0x05, 0xe4,
  276. 0x08, 0x21, 0x29, 0x34, 0x2d, 0x48, 0x5e, 0x90, 0x92, 0xc0, 0x2a, 0x07, 0x32, 0x8d, 0x17, 0x6c,
  277. 0x1a, 0xbb, 0x12, 0xab, 0x7e, 0x6a, 0x72, 0x46, 0xbe, 0x13, 0x4b, 0x14, 0x53, 0x99, 0x61, 0x12,
  278. 0x1b, 0x38, 0x4c, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x51, 0xfb, 0x90, 0xac, 0x01,
  279. 0x00, 0x00,
  280. }