api.pb.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: app/service/bbq/comment/api/api.proto
  3. package api
  4. /*
  5. package 命名使用 {discovery_id}.{version} 的方式, version 形如 v1, v2, v1beta ..
  6. NOTE: 不知道的 discovery_id 请询问大佬, 新项目找大佬申请 discovery_id,先到先得抢注
  7. e.g. account.service.v1
  8. */
  9. import proto "github.com/gogo/protobuf/proto"
  10. import fmt "fmt"
  11. import math "math"
  12. import _ "github.com/gogo/protobuf/gogoproto"
  13. import empty "github.com/golang/protobuf/ptypes/empty"
  14. import (
  15. context "golang.org/x/net/context"
  16. grpc "google.golang.org/grpc"
  17. )
  18. import io "io"
  19. // Reference imports to suppress errors if they are not otherwise used.
  20. var _ = proto.Marshal
  21. var _ = fmt.Errorf
  22. var _ = math.Inf
  23. // This is a compile-time assertion to ensure that this generated file
  24. // is compatible with the proto package it is being compiled against.
  25. // A compilation error at this line likely means your copy of the
  26. // proto package needs to be updated.
  27. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  28. type HelloReq struct {
  29. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" form:"name" validate:"required"`
  30. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  31. XXX_unrecognized []byte `json:"-"`
  32. XXX_sizecache int32 `json:"-"`
  33. }
  34. func (m *HelloReq) Reset() { *m = HelloReq{} }
  35. func (m *HelloReq) String() string { return proto.CompactTextString(m) }
  36. func (*HelloReq) ProtoMessage() {}
  37. func (*HelloReq) Descriptor() ([]byte, []int) {
  38. return fileDescriptor_api_5f2390e391fdee70, []int{0}
  39. }
  40. func (m *HelloReq) XXX_Unmarshal(b []byte) error {
  41. return m.Unmarshal(b)
  42. }
  43. func (m *HelloReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  44. if deterministic {
  45. return xxx_messageInfo_HelloReq.Marshal(b, m, deterministic)
  46. } else {
  47. b = b[:cap(b)]
  48. n, err := m.MarshalTo(b)
  49. if err != nil {
  50. return nil, err
  51. }
  52. return b[:n], nil
  53. }
  54. }
  55. func (dst *HelloReq) XXX_Merge(src proto.Message) {
  56. xxx_messageInfo_HelloReq.Merge(dst, src)
  57. }
  58. func (m *HelloReq) XXX_Size() int {
  59. return m.Size()
  60. }
  61. func (m *HelloReq) XXX_DiscardUnknown() {
  62. xxx_messageInfo_HelloReq.DiscardUnknown(m)
  63. }
  64. var xxx_messageInfo_HelloReq proto.InternalMessageInfo
  65. func init() {
  66. proto.RegisterType((*HelloReq)(nil), "demo.service.v1.HelloReq")
  67. }
  68. // Reference imports to suppress errors if they are not otherwise used.
  69. var _ context.Context
  70. var _ grpc.ClientConn
  71. // This is a compile-time assertion to ensure that this generated file
  72. // is compatible with the grpc package it is being compiled against.
  73. const _ = grpc.SupportPackageIsVersion4
  74. // DemoClient is the client API for Demo service.
  75. //
  76. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  77. type DemoClient interface {
  78. SayHello(ctx context.Context, in *HelloReq, opts ...grpc.CallOption) (*empty.Empty, error)
  79. }
  80. type demoClient struct {
  81. cc *grpc.ClientConn
  82. }
  83. func NewDemoClient(cc *grpc.ClientConn) DemoClient {
  84. return &demoClient{cc}
  85. }
  86. func (c *demoClient) SayHello(ctx context.Context, in *HelloReq, opts ...grpc.CallOption) (*empty.Empty, error) {
  87. out := new(empty.Empty)
  88. err := c.cc.Invoke(ctx, "/demo.service.v1.Demo/SayHello", in, out, opts...)
  89. if err != nil {
  90. return nil, err
  91. }
  92. return out, nil
  93. }
  94. // DemoServer is the server API for Demo service.
  95. type DemoServer interface {
  96. SayHello(context.Context, *HelloReq) (*empty.Empty, error)
  97. }
  98. func RegisterDemoServer(s *grpc.Server, srv DemoServer) {
  99. s.RegisterService(&_Demo_serviceDesc, srv)
  100. }
  101. func _Demo_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  102. in := new(HelloReq)
  103. if err := dec(in); err != nil {
  104. return nil, err
  105. }
  106. if interceptor == nil {
  107. return srv.(DemoServer).SayHello(ctx, in)
  108. }
  109. info := &grpc.UnaryServerInfo{
  110. Server: srv,
  111. FullMethod: "/demo.service.v1.Demo/SayHello",
  112. }
  113. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  114. return srv.(DemoServer).SayHello(ctx, req.(*HelloReq))
  115. }
  116. return interceptor(ctx, in, info, handler)
  117. }
  118. var _Demo_serviceDesc = grpc.ServiceDesc{
  119. ServiceName: "demo.service.v1.Demo",
  120. HandlerType: (*DemoServer)(nil),
  121. Methods: []grpc.MethodDesc{
  122. {
  123. MethodName: "SayHello",
  124. Handler: _Demo_SayHello_Handler,
  125. },
  126. },
  127. Streams: []grpc.StreamDesc{},
  128. Metadata: "app/service/bbq/comment/api/api.proto",
  129. }
  130. func (m *HelloReq) Marshal() (dAtA []byte, err error) {
  131. size := m.Size()
  132. dAtA = make([]byte, size)
  133. n, err := m.MarshalTo(dAtA)
  134. if err != nil {
  135. return nil, err
  136. }
  137. return dAtA[:n], nil
  138. }
  139. func (m *HelloReq) MarshalTo(dAtA []byte) (int, error) {
  140. var i int
  141. _ = i
  142. var l int
  143. _ = l
  144. if len(m.Name) > 0 {
  145. dAtA[i] = 0xa
  146. i++
  147. i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
  148. i += copy(dAtA[i:], m.Name)
  149. }
  150. if m.XXX_unrecognized != nil {
  151. i += copy(dAtA[i:], m.XXX_unrecognized)
  152. }
  153. return i, nil
  154. }
  155. func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
  156. for v >= 1<<7 {
  157. dAtA[offset] = uint8(v&0x7f | 0x80)
  158. v >>= 7
  159. offset++
  160. }
  161. dAtA[offset] = uint8(v)
  162. return offset + 1
  163. }
  164. func (m *HelloReq) Size() (n int) {
  165. if m == nil {
  166. return 0
  167. }
  168. var l int
  169. _ = l
  170. l = len(m.Name)
  171. if l > 0 {
  172. n += 1 + l + sovApi(uint64(l))
  173. }
  174. if m.XXX_unrecognized != nil {
  175. n += len(m.XXX_unrecognized)
  176. }
  177. return n
  178. }
  179. func sovApi(x uint64) (n int) {
  180. for {
  181. n++
  182. x >>= 7
  183. if x == 0 {
  184. break
  185. }
  186. }
  187. return n
  188. }
  189. func sozApi(x uint64) (n int) {
  190. return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  191. }
  192. func (m *HelloReq) Unmarshal(dAtA []byte) error {
  193. l := len(dAtA)
  194. iNdEx := 0
  195. for iNdEx < l {
  196. preIndex := iNdEx
  197. var wire uint64
  198. for shift := uint(0); ; shift += 7 {
  199. if shift >= 64 {
  200. return ErrIntOverflowApi
  201. }
  202. if iNdEx >= l {
  203. return io.ErrUnexpectedEOF
  204. }
  205. b := dAtA[iNdEx]
  206. iNdEx++
  207. wire |= (uint64(b) & 0x7F) << shift
  208. if b < 0x80 {
  209. break
  210. }
  211. }
  212. fieldNum := int32(wire >> 3)
  213. wireType := int(wire & 0x7)
  214. if wireType == 4 {
  215. return fmt.Errorf("proto: HelloReq: wiretype end group for non-group")
  216. }
  217. if fieldNum <= 0 {
  218. return fmt.Errorf("proto: HelloReq: illegal tag %d (wire type %d)", fieldNum, wire)
  219. }
  220. switch fieldNum {
  221. case 1:
  222. if wireType != 2 {
  223. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  224. }
  225. var stringLen uint64
  226. for shift := uint(0); ; shift += 7 {
  227. if shift >= 64 {
  228. return ErrIntOverflowApi
  229. }
  230. if iNdEx >= l {
  231. return io.ErrUnexpectedEOF
  232. }
  233. b := dAtA[iNdEx]
  234. iNdEx++
  235. stringLen |= (uint64(b) & 0x7F) << shift
  236. if b < 0x80 {
  237. break
  238. }
  239. }
  240. intStringLen := int(stringLen)
  241. if intStringLen < 0 {
  242. return ErrInvalidLengthApi
  243. }
  244. postIndex := iNdEx + intStringLen
  245. if postIndex > l {
  246. return io.ErrUnexpectedEOF
  247. }
  248. m.Name = string(dAtA[iNdEx:postIndex])
  249. iNdEx = postIndex
  250. default:
  251. iNdEx = preIndex
  252. skippy, err := skipApi(dAtA[iNdEx:])
  253. if err != nil {
  254. return err
  255. }
  256. if skippy < 0 {
  257. return ErrInvalidLengthApi
  258. }
  259. if (iNdEx + skippy) > l {
  260. return io.ErrUnexpectedEOF
  261. }
  262. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  263. iNdEx += skippy
  264. }
  265. }
  266. if iNdEx > l {
  267. return io.ErrUnexpectedEOF
  268. }
  269. return nil
  270. }
  271. func skipApi(dAtA []byte) (n int, err error) {
  272. l := len(dAtA)
  273. iNdEx := 0
  274. for iNdEx < l {
  275. var wire uint64
  276. for shift := uint(0); ; shift += 7 {
  277. if shift >= 64 {
  278. return 0, ErrIntOverflowApi
  279. }
  280. if iNdEx >= l {
  281. return 0, io.ErrUnexpectedEOF
  282. }
  283. b := dAtA[iNdEx]
  284. iNdEx++
  285. wire |= (uint64(b) & 0x7F) << shift
  286. if b < 0x80 {
  287. break
  288. }
  289. }
  290. wireType := int(wire & 0x7)
  291. switch wireType {
  292. case 0:
  293. for shift := uint(0); ; shift += 7 {
  294. if shift >= 64 {
  295. return 0, ErrIntOverflowApi
  296. }
  297. if iNdEx >= l {
  298. return 0, io.ErrUnexpectedEOF
  299. }
  300. iNdEx++
  301. if dAtA[iNdEx-1] < 0x80 {
  302. break
  303. }
  304. }
  305. return iNdEx, nil
  306. case 1:
  307. iNdEx += 8
  308. return iNdEx, nil
  309. case 2:
  310. var length int
  311. for shift := uint(0); ; shift += 7 {
  312. if shift >= 64 {
  313. return 0, ErrIntOverflowApi
  314. }
  315. if iNdEx >= l {
  316. return 0, io.ErrUnexpectedEOF
  317. }
  318. b := dAtA[iNdEx]
  319. iNdEx++
  320. length |= (int(b) & 0x7F) << shift
  321. if b < 0x80 {
  322. break
  323. }
  324. }
  325. iNdEx += length
  326. if length < 0 {
  327. return 0, ErrInvalidLengthApi
  328. }
  329. return iNdEx, nil
  330. case 3:
  331. for {
  332. var innerWire uint64
  333. var start int = iNdEx
  334. for shift := uint(0); ; shift += 7 {
  335. if shift >= 64 {
  336. return 0, ErrIntOverflowApi
  337. }
  338. if iNdEx >= l {
  339. return 0, io.ErrUnexpectedEOF
  340. }
  341. b := dAtA[iNdEx]
  342. iNdEx++
  343. innerWire |= (uint64(b) & 0x7F) << shift
  344. if b < 0x80 {
  345. break
  346. }
  347. }
  348. innerWireType := int(innerWire & 0x7)
  349. if innerWireType == 4 {
  350. break
  351. }
  352. next, err := skipApi(dAtA[start:])
  353. if err != nil {
  354. return 0, err
  355. }
  356. iNdEx = start + next
  357. }
  358. return iNdEx, nil
  359. case 4:
  360. return iNdEx, nil
  361. case 5:
  362. iNdEx += 4
  363. return iNdEx, nil
  364. default:
  365. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  366. }
  367. }
  368. panic("unreachable")
  369. }
  370. var (
  371. ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
  372. ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
  373. )
  374. func init() {
  375. proto.RegisterFile("app/service/bbq/comment/api/api.proto", fileDescriptor_api_5f2390e391fdee70)
  376. }
  377. var fileDescriptor_api_5f2390e391fdee70 = []byte{
  378. // 251 bytes of a gzipped FileDescriptorProto
  379. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0x2c, 0x28, 0xd0,
  380. 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x4f, 0x4a, 0x2a, 0xd4, 0x4f, 0xce, 0xcf, 0xcd,
  381. 0x4d, 0xcd, 0x2b, 0xd1, 0x4f, 0x2c, 0xc8, 0x04, 0x61, 0xbd, 0x82, 0xa2, 0xfc, 0x92, 0x7c, 0x21,
  382. 0xfe, 0x94, 0xd4, 0xdc, 0x7c, 0x3d, 0xa8, 0x3a, 0xbd, 0x32, 0x43, 0x29, 0xdd, 0xf4, 0xcc, 0x92,
  383. 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xf4, 0xfc, 0xf4, 0x7c, 0x7d, 0xb0, 0xba, 0xa4,
  384. 0xd2, 0x34, 0x30, 0x0f, 0xcc, 0x01, 0xb3, 0x20, 0xfa, 0xa5, 0xa4, 0xd3, 0xf3, 0xf3, 0xd3, 0x73,
  385. 0x52, 0x11, 0xaa, 0x52, 0x73, 0x0b, 0x4a, 0x2a, 0x21, 0x92, 0x4a, 0xce, 0x5c, 0x1c, 0x1e, 0xa9,
  386. 0x39, 0x39, 0xf9, 0x41, 0xa9, 0x85, 0x42, 0xe6, 0x5c, 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0x8c,
  387. 0x0a, 0x8c, 0x1a, 0x9c, 0x4e, 0xca, 0x9f, 0xee, 0xc9, 0xcb, 0xa7, 0xe5, 0x17, 0xe5, 0x5a, 0x29,
  388. 0x81, 0x44, 0x95, 0x14, 0xca, 0x12, 0x73, 0x32, 0x53, 0x12, 0x4b, 0x52, 0xad, 0x94, 0x8a, 0x52,
  389. 0x0b, 0x4b, 0x33, 0x8b, 0x52, 0x53, 0x94, 0x82, 0xc0, 0x1a, 0x8c, 0x5c, 0xb9, 0x58, 0x5c, 0x52,
  390. 0x73, 0xf3, 0x85, 0x6c, 0xb9, 0x38, 0x82, 0x13, 0x2b, 0xc1, 0xe6, 0x09, 0x49, 0xea, 0xa1, 0x39,
  391. 0x5b, 0x0f, 0x66, 0x8f, 0x94, 0x98, 0x1e, 0xc4, 0x45, 0x7a, 0x30, 0x17, 0xe9, 0xb9, 0x82, 0x5c,
  392. 0xe4, 0x24, 0x7a, 0xe2, 0xa1, 0x1c, 0xc3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e,
  393. 0x78, 0x24, 0xc7, 0x18, 0xc5, 0x9c, 0x58, 0x90, 0x99, 0xc4, 0x06, 0x56, 0x66, 0x0c, 0x08, 0x00,
  394. 0x00, 0xff, 0xff, 0xe5, 0xbd, 0x3d, 0x4d, 0x2f, 0x01, 0x00, 0x00,
  395. }