You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

797 lines
30 KiB

  1. // Code generated by protoc-gen-go.
  2. // source: messaging.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package messaging_pb is a generated protocol buffer package.
  6. It is generated from these files:
  7. messaging.proto
  8. It has these top-level messages:
  9. SubscriberMessage
  10. Message
  11. BrokerMessage
  12. PublishRequest
  13. PublishResponse
  14. ConfigureTopicRequest
  15. ConfigureTopicResponse
  16. GetTopicConfigurationRequest
  17. GetTopicConfigurationResponse
  18. */
  19. package messaging_pb
  20. import proto "github.com/golang/protobuf/proto"
  21. import fmt "fmt"
  22. import math "math"
  23. import (
  24. context "golang.org/x/net/context"
  25. grpc "google.golang.org/grpc"
  26. )
  27. // Reference imports to suppress errors if they are not otherwise used.
  28. var _ = proto.Marshal
  29. var _ = fmt.Errorf
  30. var _ = math.Inf
  31. // This is a compile-time assertion to ensure that this generated file
  32. // is compatible with the proto package it is being compiled against.
  33. // A compilation error at this line likely means your copy of the
  34. // proto package needs to be updated.
  35. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  36. type SubscriberMessage_InitMessage_StartPosition int32
  37. const (
  38. SubscriberMessage_InitMessage_LATEST SubscriberMessage_InitMessage_StartPosition = 0
  39. SubscriberMessage_InitMessage_EARLIEST SubscriberMessage_InitMessage_StartPosition = 1
  40. SubscriberMessage_InitMessage_TIMESTAMP SubscriberMessage_InitMessage_StartPosition = 2
  41. )
  42. var SubscriberMessage_InitMessage_StartPosition_name = map[int32]string{
  43. 0: "LATEST",
  44. 1: "EARLIEST",
  45. 2: "TIMESTAMP",
  46. }
  47. var SubscriberMessage_InitMessage_StartPosition_value = map[string]int32{
  48. "LATEST": 0,
  49. "EARLIEST": 1,
  50. "TIMESTAMP": 2,
  51. }
  52. func (x SubscriberMessage_InitMessage_StartPosition) String() string {
  53. return proto.EnumName(SubscriberMessage_InitMessage_StartPosition_name, int32(x))
  54. }
  55. func (SubscriberMessage_InitMessage_StartPosition) EnumDescriptor() ([]byte, []int) {
  56. return fileDescriptor0, []int{0, 0, 0}
  57. }
  58. type SubscriberMessage struct {
  59. Init *SubscriberMessage_InitMessage `protobuf:"bytes,1,opt,name=init" json:"init,omitempty"`
  60. Ack *SubscriberMessage_AckMessage `protobuf:"bytes,2,opt,name=ack" json:"ack,omitempty"`
  61. }
  62. func (m *SubscriberMessage) Reset() { *m = SubscriberMessage{} }
  63. func (m *SubscriberMessage) String() string { return proto.CompactTextString(m) }
  64. func (*SubscriberMessage) ProtoMessage() {}
  65. func (*SubscriberMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  66. func (m *SubscriberMessage) GetInit() *SubscriberMessage_InitMessage {
  67. if m != nil {
  68. return m.Init
  69. }
  70. return nil
  71. }
  72. func (m *SubscriberMessage) GetAck() *SubscriberMessage_AckMessage {
  73. if m != nil {
  74. return m.Ack
  75. }
  76. return nil
  77. }
  78. type SubscriberMessage_InitMessage struct {
  79. Namespace string `protobuf:"bytes,1,opt,name=namespace" json:"namespace,omitempty"`
  80. Topic string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"`
  81. Partition int32 `protobuf:"varint,3,opt,name=partition" json:"partition,omitempty"`
  82. StartPosition SubscriberMessage_InitMessage_StartPosition `protobuf:"varint,4,opt,name=startPosition,enum=messaging_pb.SubscriberMessage_InitMessage_StartPosition" json:"startPosition,omitempty"`
  83. TimestampNs int64 `protobuf:"varint,5,opt,name=timestampNs" json:"timestampNs,omitempty"`
  84. SubscriberId string `protobuf:"bytes,6,opt,name=subscriber_id,json=subscriberId" json:"subscriber_id,omitempty"`
  85. }
  86. func (m *SubscriberMessage_InitMessage) Reset() { *m = SubscriberMessage_InitMessage{} }
  87. func (m *SubscriberMessage_InitMessage) String() string { return proto.CompactTextString(m) }
  88. func (*SubscriberMessage_InitMessage) ProtoMessage() {}
  89. func (*SubscriberMessage_InitMessage) Descriptor() ([]byte, []int) {
  90. return fileDescriptor0, []int{0, 0}
  91. }
  92. func (m *SubscriberMessage_InitMessage) GetNamespace() string {
  93. if m != nil {
  94. return m.Namespace
  95. }
  96. return ""
  97. }
  98. func (m *SubscriberMessage_InitMessage) GetTopic() string {
  99. if m != nil {
  100. return m.Topic
  101. }
  102. return ""
  103. }
  104. func (m *SubscriberMessage_InitMessage) GetPartition() int32 {
  105. if m != nil {
  106. return m.Partition
  107. }
  108. return 0
  109. }
  110. func (m *SubscriberMessage_InitMessage) GetStartPosition() SubscriberMessage_InitMessage_StartPosition {
  111. if m != nil {
  112. return m.StartPosition
  113. }
  114. return SubscriberMessage_InitMessage_LATEST
  115. }
  116. func (m *SubscriberMessage_InitMessage) GetTimestampNs() int64 {
  117. if m != nil {
  118. return m.TimestampNs
  119. }
  120. return 0
  121. }
  122. func (m *SubscriberMessage_InitMessage) GetSubscriberId() string {
  123. if m != nil {
  124. return m.SubscriberId
  125. }
  126. return ""
  127. }
  128. type SubscriberMessage_AckMessage struct {
  129. MessageId int64 `protobuf:"varint,1,opt,name=message_id,json=messageId" json:"message_id,omitempty"`
  130. }
  131. func (m *SubscriberMessage_AckMessage) Reset() { *m = SubscriberMessage_AckMessage{} }
  132. func (m *SubscriberMessage_AckMessage) String() string { return proto.CompactTextString(m) }
  133. func (*SubscriberMessage_AckMessage) ProtoMessage() {}
  134. func (*SubscriberMessage_AckMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 1} }
  135. func (m *SubscriberMessage_AckMessage) GetMessageId() int64 {
  136. if m != nil {
  137. return m.MessageId
  138. }
  139. return 0
  140. }
  141. type Message struct {
  142. Timestamp int64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"`
  143. Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
  144. Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
  145. Headers map[string][]byte `protobuf:"bytes,4,rep,name=headers" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"`
  146. }
  147. func (m *Message) Reset() { *m = Message{} }
  148. func (m *Message) String() string { return proto.CompactTextString(m) }
  149. func (*Message) ProtoMessage() {}
  150. func (*Message) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
  151. func (m *Message) GetTimestamp() int64 {
  152. if m != nil {
  153. return m.Timestamp
  154. }
  155. return 0
  156. }
  157. func (m *Message) GetKey() []byte {
  158. if m != nil {
  159. return m.Key
  160. }
  161. return nil
  162. }
  163. func (m *Message) GetValue() []byte {
  164. if m != nil {
  165. return m.Value
  166. }
  167. return nil
  168. }
  169. func (m *Message) GetHeaders() map[string][]byte {
  170. if m != nil {
  171. return m.Headers
  172. }
  173. return nil
  174. }
  175. type BrokerMessage struct {
  176. Data *Message `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"`
  177. Redirect *BrokerMessage_RedirectMessage `protobuf:"bytes,2,opt,name=redirect" json:"redirect,omitempty"`
  178. }
  179. func (m *BrokerMessage) Reset() { *m = BrokerMessage{} }
  180. func (m *BrokerMessage) String() string { return proto.CompactTextString(m) }
  181. func (*BrokerMessage) ProtoMessage() {}
  182. func (*BrokerMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
  183. func (m *BrokerMessage) GetData() *Message {
  184. if m != nil {
  185. return m.Data
  186. }
  187. return nil
  188. }
  189. func (m *BrokerMessage) GetRedirect() *BrokerMessage_RedirectMessage {
  190. if m != nil {
  191. return m.Redirect
  192. }
  193. return nil
  194. }
  195. type BrokerMessage_RedirectMessage struct {
  196. NewBroker string `protobuf:"bytes,1,opt,name=new_broker,json=newBroker" json:"new_broker,omitempty"`
  197. }
  198. func (m *BrokerMessage_RedirectMessage) Reset() { *m = BrokerMessage_RedirectMessage{} }
  199. func (m *BrokerMessage_RedirectMessage) String() string { return proto.CompactTextString(m) }
  200. func (*BrokerMessage_RedirectMessage) ProtoMessage() {}
  201. func (*BrokerMessage_RedirectMessage) Descriptor() ([]byte, []int) {
  202. return fileDescriptor0, []int{2, 0}
  203. }
  204. func (m *BrokerMessage_RedirectMessage) GetNewBroker() string {
  205. if m != nil {
  206. return m.NewBroker
  207. }
  208. return ""
  209. }
  210. type PublishRequest struct {
  211. Init *PublishRequest_InitMessage `protobuf:"bytes,1,opt,name=init" json:"init,omitempty"`
  212. Data *PublishRequest_DataMessage `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"`
  213. }
  214. func (m *PublishRequest) Reset() { *m = PublishRequest{} }
  215. func (m *PublishRequest) String() string { return proto.CompactTextString(m) }
  216. func (*PublishRequest) ProtoMessage() {}
  217. func (*PublishRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
  218. func (m *PublishRequest) GetInit() *PublishRequest_InitMessage {
  219. if m != nil {
  220. return m.Init
  221. }
  222. return nil
  223. }
  224. func (m *PublishRequest) GetData() *PublishRequest_DataMessage {
  225. if m != nil {
  226. return m.Data
  227. }
  228. return nil
  229. }
  230. type PublishRequest_InitMessage struct {
  231. Namespace string `protobuf:"bytes,1,opt,name=namespace" json:"namespace,omitempty"`
  232. Topic string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"`
  233. Partition int32 `protobuf:"varint,3,opt,name=partition" json:"partition,omitempty"`
  234. }
  235. func (m *PublishRequest_InitMessage) Reset() { *m = PublishRequest_InitMessage{} }
  236. func (m *PublishRequest_InitMessage) String() string { return proto.CompactTextString(m) }
  237. func (*PublishRequest_InitMessage) ProtoMessage() {}
  238. func (*PublishRequest_InitMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3, 0} }
  239. func (m *PublishRequest_InitMessage) GetNamespace() string {
  240. if m != nil {
  241. return m.Namespace
  242. }
  243. return ""
  244. }
  245. func (m *PublishRequest_InitMessage) GetTopic() string {
  246. if m != nil {
  247. return m.Topic
  248. }
  249. return ""
  250. }
  251. func (m *PublishRequest_InitMessage) GetPartition() int32 {
  252. if m != nil {
  253. return m.Partition
  254. }
  255. return 0
  256. }
  257. type PublishRequest_DataMessage struct {
  258. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  259. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
  260. Headers map[string][]byte `protobuf:"bytes,3,rep,name=headers" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"`
  261. }
  262. func (m *PublishRequest_DataMessage) Reset() { *m = PublishRequest_DataMessage{} }
  263. func (m *PublishRequest_DataMessage) String() string { return proto.CompactTextString(m) }
  264. func (*PublishRequest_DataMessage) ProtoMessage() {}
  265. func (*PublishRequest_DataMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3, 1} }
  266. func (m *PublishRequest_DataMessage) GetKey() []byte {
  267. if m != nil {
  268. return m.Key
  269. }
  270. return nil
  271. }
  272. func (m *PublishRequest_DataMessage) GetValue() []byte {
  273. if m != nil {
  274. return m.Value
  275. }
  276. return nil
  277. }
  278. func (m *PublishRequest_DataMessage) GetHeaders() map[string][]byte {
  279. if m != nil {
  280. return m.Headers
  281. }
  282. return nil
  283. }
  284. type PublishResponse struct {
  285. Config *PublishResponse_ConfigMessage `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"`
  286. Redirect *PublishResponse_RedirectMessage `protobuf:"bytes,2,opt,name=redirect" json:"redirect,omitempty"`
  287. }
  288. func (m *PublishResponse) Reset() { *m = PublishResponse{} }
  289. func (m *PublishResponse) String() string { return proto.CompactTextString(m) }
  290. func (*PublishResponse) ProtoMessage() {}
  291. func (*PublishResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
  292. func (m *PublishResponse) GetConfig() *PublishResponse_ConfigMessage {
  293. if m != nil {
  294. return m.Config
  295. }
  296. return nil
  297. }
  298. func (m *PublishResponse) GetRedirect() *PublishResponse_RedirectMessage {
  299. if m != nil {
  300. return m.Redirect
  301. }
  302. return nil
  303. }
  304. type PublishResponse_ConfigMessage struct {
  305. PartitionCount int32 `protobuf:"varint,1,opt,name=partition_count,json=partitionCount" json:"partition_count,omitempty"`
  306. }
  307. func (m *PublishResponse_ConfigMessage) Reset() { *m = PublishResponse_ConfigMessage{} }
  308. func (m *PublishResponse_ConfigMessage) String() string { return proto.CompactTextString(m) }
  309. func (*PublishResponse_ConfigMessage) ProtoMessage() {}
  310. func (*PublishResponse_ConfigMessage) Descriptor() ([]byte, []int) {
  311. return fileDescriptor0, []int{4, 0}
  312. }
  313. func (m *PublishResponse_ConfigMessage) GetPartitionCount() int32 {
  314. if m != nil {
  315. return m.PartitionCount
  316. }
  317. return 0
  318. }
  319. type PublishResponse_RedirectMessage struct {
  320. NewBroker string `protobuf:"bytes,1,opt,name=new_broker,json=newBroker" json:"new_broker,omitempty"`
  321. }
  322. func (m *PublishResponse_RedirectMessage) Reset() { *m = PublishResponse_RedirectMessage{} }
  323. func (m *PublishResponse_RedirectMessage) String() string { return proto.CompactTextString(m) }
  324. func (*PublishResponse_RedirectMessage) ProtoMessage() {}
  325. func (*PublishResponse_RedirectMessage) Descriptor() ([]byte, []int) {
  326. return fileDescriptor0, []int{4, 1}
  327. }
  328. func (m *PublishResponse_RedirectMessage) GetNewBroker() string {
  329. if m != nil {
  330. return m.NewBroker
  331. }
  332. return ""
  333. }
  334. type ConfigureTopicRequest struct {
  335. Namespace string `protobuf:"bytes,1,opt,name=namespace" json:"namespace,omitempty"`
  336. Topic string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"`
  337. PartitionCount int32 `protobuf:"varint,3,opt,name=partition_count,json=partitionCount" json:"partition_count,omitempty"`
  338. Collection string `protobuf:"bytes,4,opt,name=collection" json:"collection,omitempty"`
  339. }
  340. func (m *ConfigureTopicRequest) Reset() { *m = ConfigureTopicRequest{} }
  341. func (m *ConfigureTopicRequest) String() string { return proto.CompactTextString(m) }
  342. func (*ConfigureTopicRequest) ProtoMessage() {}
  343. func (*ConfigureTopicRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
  344. func (m *ConfigureTopicRequest) GetNamespace() string {
  345. if m != nil {
  346. return m.Namespace
  347. }
  348. return ""
  349. }
  350. func (m *ConfigureTopicRequest) GetTopic() string {
  351. if m != nil {
  352. return m.Topic
  353. }
  354. return ""
  355. }
  356. func (m *ConfigureTopicRequest) GetPartitionCount() int32 {
  357. if m != nil {
  358. return m.PartitionCount
  359. }
  360. return 0
  361. }
  362. func (m *ConfigureTopicRequest) GetCollection() string {
  363. if m != nil {
  364. return m.Collection
  365. }
  366. return ""
  367. }
  368. type ConfigureTopicResponse struct {
  369. }
  370. func (m *ConfigureTopicResponse) Reset() { *m = ConfigureTopicResponse{} }
  371. func (m *ConfigureTopicResponse) String() string { return proto.CompactTextString(m) }
  372. func (*ConfigureTopicResponse) ProtoMessage() {}
  373. func (*ConfigureTopicResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
  374. type GetTopicConfigurationRequest struct {
  375. Namespace string `protobuf:"bytes,1,opt,name=namespace" json:"namespace,omitempty"`
  376. Topic string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"`
  377. }
  378. func (m *GetTopicConfigurationRequest) Reset() { *m = GetTopicConfigurationRequest{} }
  379. func (m *GetTopicConfigurationRequest) String() string { return proto.CompactTextString(m) }
  380. func (*GetTopicConfigurationRequest) ProtoMessage() {}
  381. func (*GetTopicConfigurationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
  382. func (m *GetTopicConfigurationRequest) GetNamespace() string {
  383. if m != nil {
  384. return m.Namespace
  385. }
  386. return ""
  387. }
  388. func (m *GetTopicConfigurationRequest) GetTopic() string {
  389. if m != nil {
  390. return m.Topic
  391. }
  392. return ""
  393. }
  394. type GetTopicConfigurationResponse struct {
  395. Partitions int32 `protobuf:"varint,3,opt,name=partitions" json:"partitions,omitempty"`
  396. }
  397. func (m *GetTopicConfigurationResponse) Reset() { *m = GetTopicConfigurationResponse{} }
  398. func (m *GetTopicConfigurationResponse) String() string { return proto.CompactTextString(m) }
  399. func (*GetTopicConfigurationResponse) ProtoMessage() {}
  400. func (*GetTopicConfigurationResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
  401. func (m *GetTopicConfigurationResponse) GetPartitions() int32 {
  402. if m != nil {
  403. return m.Partitions
  404. }
  405. return 0
  406. }
  407. func init() {
  408. proto.RegisterType((*SubscriberMessage)(nil), "messaging_pb.SubscriberMessage")
  409. proto.RegisterType((*SubscriberMessage_InitMessage)(nil), "messaging_pb.SubscriberMessage.InitMessage")
  410. proto.RegisterType((*SubscriberMessage_AckMessage)(nil), "messaging_pb.SubscriberMessage.AckMessage")
  411. proto.RegisterType((*Message)(nil), "messaging_pb.Message")
  412. proto.RegisterType((*BrokerMessage)(nil), "messaging_pb.BrokerMessage")
  413. proto.RegisterType((*BrokerMessage_RedirectMessage)(nil), "messaging_pb.BrokerMessage.RedirectMessage")
  414. proto.RegisterType((*PublishRequest)(nil), "messaging_pb.PublishRequest")
  415. proto.RegisterType((*PublishRequest_InitMessage)(nil), "messaging_pb.PublishRequest.InitMessage")
  416. proto.RegisterType((*PublishRequest_DataMessage)(nil), "messaging_pb.PublishRequest.DataMessage")
  417. proto.RegisterType((*PublishResponse)(nil), "messaging_pb.PublishResponse")
  418. proto.RegisterType((*PublishResponse_ConfigMessage)(nil), "messaging_pb.PublishResponse.ConfigMessage")
  419. proto.RegisterType((*PublishResponse_RedirectMessage)(nil), "messaging_pb.PublishResponse.RedirectMessage")
  420. proto.RegisterType((*ConfigureTopicRequest)(nil), "messaging_pb.ConfigureTopicRequest")
  421. proto.RegisterType((*ConfigureTopicResponse)(nil), "messaging_pb.ConfigureTopicResponse")
  422. proto.RegisterType((*GetTopicConfigurationRequest)(nil), "messaging_pb.GetTopicConfigurationRequest")
  423. proto.RegisterType((*GetTopicConfigurationResponse)(nil), "messaging_pb.GetTopicConfigurationResponse")
  424. proto.RegisterEnum("messaging_pb.SubscriberMessage_InitMessage_StartPosition", SubscriberMessage_InitMessage_StartPosition_name, SubscriberMessage_InitMessage_StartPosition_value)
  425. }
  426. // Reference imports to suppress errors if they are not otherwise used.
  427. var _ context.Context
  428. var _ grpc.ClientConn
  429. // This is a compile-time assertion to ensure that this generated file
  430. // is compatible with the grpc package it is being compiled against.
  431. const _ = grpc.SupportPackageIsVersion4
  432. // Client API for SeaweedMessaging service
  433. type SeaweedMessagingClient interface {
  434. Subscribe(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_SubscribeClient, error)
  435. Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error)
  436. ConfigureTopic(ctx context.Context, in *ConfigureTopicRequest, opts ...grpc.CallOption) (*ConfigureTopicResponse, error)
  437. GetTopicConfiguration(ctx context.Context, in *GetTopicConfigurationRequest, opts ...grpc.CallOption) (*GetTopicConfigurationResponse, error)
  438. }
  439. type seaweedMessagingClient struct {
  440. cc *grpc.ClientConn
  441. }
  442. func NewSeaweedMessagingClient(cc *grpc.ClientConn) SeaweedMessagingClient {
  443. return &seaweedMessagingClient{cc}
  444. }
  445. func (c *seaweedMessagingClient) Subscribe(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_SubscribeClient, error) {
  446. stream, err := grpc.NewClientStream(ctx, &_SeaweedMessaging_serviceDesc.Streams[0], c.cc, "/messaging_pb.SeaweedMessaging/Subscribe", opts...)
  447. if err != nil {
  448. return nil, err
  449. }
  450. x := &seaweedMessagingSubscribeClient{stream}
  451. return x, nil
  452. }
  453. type SeaweedMessaging_SubscribeClient interface {
  454. Send(*SubscriberMessage) error
  455. Recv() (*BrokerMessage, error)
  456. grpc.ClientStream
  457. }
  458. type seaweedMessagingSubscribeClient struct {
  459. grpc.ClientStream
  460. }
  461. func (x *seaweedMessagingSubscribeClient) Send(m *SubscriberMessage) error {
  462. return x.ClientStream.SendMsg(m)
  463. }
  464. func (x *seaweedMessagingSubscribeClient) Recv() (*BrokerMessage, error) {
  465. m := new(BrokerMessage)
  466. if err := x.ClientStream.RecvMsg(m); err != nil {
  467. return nil, err
  468. }
  469. return m, nil
  470. }
  471. func (c *seaweedMessagingClient) Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error) {
  472. stream, err := grpc.NewClientStream(ctx, &_SeaweedMessaging_serviceDesc.Streams[1], c.cc, "/messaging_pb.SeaweedMessaging/Publish", opts...)
  473. if err != nil {
  474. return nil, err
  475. }
  476. x := &seaweedMessagingPublishClient{stream}
  477. return x, nil
  478. }
  479. type SeaweedMessaging_PublishClient interface {
  480. Send(*PublishRequest) error
  481. Recv() (*PublishResponse, error)
  482. grpc.ClientStream
  483. }
  484. type seaweedMessagingPublishClient struct {
  485. grpc.ClientStream
  486. }
  487. func (x *seaweedMessagingPublishClient) Send(m *PublishRequest) error {
  488. return x.ClientStream.SendMsg(m)
  489. }
  490. func (x *seaweedMessagingPublishClient) Recv() (*PublishResponse, error) {
  491. m := new(PublishResponse)
  492. if err := x.ClientStream.RecvMsg(m); err != nil {
  493. return nil, err
  494. }
  495. return m, nil
  496. }
  497. func (c *seaweedMessagingClient) ConfigureTopic(ctx context.Context, in *ConfigureTopicRequest, opts ...grpc.CallOption) (*ConfigureTopicResponse, error) {
  498. out := new(ConfigureTopicResponse)
  499. err := grpc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/ConfigureTopic", in, out, c.cc, opts...)
  500. if err != nil {
  501. return nil, err
  502. }
  503. return out, nil
  504. }
  505. func (c *seaweedMessagingClient) GetTopicConfiguration(ctx context.Context, in *GetTopicConfigurationRequest, opts ...grpc.CallOption) (*GetTopicConfigurationResponse, error) {
  506. out := new(GetTopicConfigurationResponse)
  507. err := grpc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/GetTopicConfiguration", in, out, c.cc, opts...)
  508. if err != nil {
  509. return nil, err
  510. }
  511. return out, nil
  512. }
  513. // Server API for SeaweedMessaging service
  514. type SeaweedMessagingServer interface {
  515. Subscribe(SeaweedMessaging_SubscribeServer) error
  516. Publish(SeaweedMessaging_PublishServer) error
  517. ConfigureTopic(context.Context, *ConfigureTopicRequest) (*ConfigureTopicResponse, error)
  518. GetTopicConfiguration(context.Context, *GetTopicConfigurationRequest) (*GetTopicConfigurationResponse, error)
  519. }
  520. func RegisterSeaweedMessagingServer(s *grpc.Server, srv SeaweedMessagingServer) {
  521. s.RegisterService(&_SeaweedMessaging_serviceDesc, srv)
  522. }
  523. func _SeaweedMessaging_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
  524. return srv.(SeaweedMessagingServer).Subscribe(&seaweedMessagingSubscribeServer{stream})
  525. }
  526. type SeaweedMessaging_SubscribeServer interface {
  527. Send(*BrokerMessage) error
  528. Recv() (*SubscriberMessage, error)
  529. grpc.ServerStream
  530. }
  531. type seaweedMessagingSubscribeServer struct {
  532. grpc.ServerStream
  533. }
  534. func (x *seaweedMessagingSubscribeServer) Send(m *BrokerMessage) error {
  535. return x.ServerStream.SendMsg(m)
  536. }
  537. func (x *seaweedMessagingSubscribeServer) Recv() (*SubscriberMessage, error) {
  538. m := new(SubscriberMessage)
  539. if err := x.ServerStream.RecvMsg(m); err != nil {
  540. return nil, err
  541. }
  542. return m, nil
  543. }
  544. func _SeaweedMessaging_Publish_Handler(srv interface{}, stream grpc.ServerStream) error {
  545. return srv.(SeaweedMessagingServer).Publish(&seaweedMessagingPublishServer{stream})
  546. }
  547. type SeaweedMessaging_PublishServer interface {
  548. Send(*PublishResponse) error
  549. Recv() (*PublishRequest, error)
  550. grpc.ServerStream
  551. }
  552. type seaweedMessagingPublishServer struct {
  553. grpc.ServerStream
  554. }
  555. func (x *seaweedMessagingPublishServer) Send(m *PublishResponse) error {
  556. return x.ServerStream.SendMsg(m)
  557. }
  558. func (x *seaweedMessagingPublishServer) Recv() (*PublishRequest, error) {
  559. m := new(PublishRequest)
  560. if err := x.ServerStream.RecvMsg(m); err != nil {
  561. return nil, err
  562. }
  563. return m, nil
  564. }
  565. func _SeaweedMessaging_ConfigureTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  566. in := new(ConfigureTopicRequest)
  567. if err := dec(in); err != nil {
  568. return nil, err
  569. }
  570. if interceptor == nil {
  571. return srv.(SeaweedMessagingServer).ConfigureTopic(ctx, in)
  572. }
  573. info := &grpc.UnaryServerInfo{
  574. Server: srv,
  575. FullMethod: "/messaging_pb.SeaweedMessaging/ConfigureTopic",
  576. }
  577. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  578. return srv.(SeaweedMessagingServer).ConfigureTopic(ctx, req.(*ConfigureTopicRequest))
  579. }
  580. return interceptor(ctx, in, info, handler)
  581. }
  582. func _SeaweedMessaging_GetTopicConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  583. in := new(GetTopicConfigurationRequest)
  584. if err := dec(in); err != nil {
  585. return nil, err
  586. }
  587. if interceptor == nil {
  588. return srv.(SeaweedMessagingServer).GetTopicConfiguration(ctx, in)
  589. }
  590. info := &grpc.UnaryServerInfo{
  591. Server: srv,
  592. FullMethod: "/messaging_pb.SeaweedMessaging/GetTopicConfiguration",
  593. }
  594. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  595. return srv.(SeaweedMessagingServer).GetTopicConfiguration(ctx, req.(*GetTopicConfigurationRequest))
  596. }
  597. return interceptor(ctx, in, info, handler)
  598. }
  599. var _SeaweedMessaging_serviceDesc = grpc.ServiceDesc{
  600. ServiceName: "messaging_pb.SeaweedMessaging",
  601. HandlerType: (*SeaweedMessagingServer)(nil),
  602. Methods: []grpc.MethodDesc{
  603. {
  604. MethodName: "ConfigureTopic",
  605. Handler: _SeaweedMessaging_ConfigureTopic_Handler,
  606. },
  607. {
  608. MethodName: "GetTopicConfiguration",
  609. Handler: _SeaweedMessaging_GetTopicConfiguration_Handler,
  610. },
  611. },
  612. Streams: []grpc.StreamDesc{
  613. {
  614. StreamName: "Subscribe",
  615. Handler: _SeaweedMessaging_Subscribe_Handler,
  616. ServerStreams: true,
  617. ClientStreams: true,
  618. },
  619. {
  620. StreamName: "Publish",
  621. Handler: _SeaweedMessaging_Publish_Handler,
  622. ServerStreams: true,
  623. ClientStreams: true,
  624. },
  625. },
  626. Metadata: "messaging.proto",
  627. }
  628. func init() { proto.RegisterFile("messaging.proto", fileDescriptor0) }
  629. var fileDescriptor0 = []byte{
  630. // 802 bytes of a gzipped FileDescriptorProto
  631. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x56, 0x5d, 0x4f, 0xdb, 0x48,
  632. 0x14, 0xc5, 0x76, 0x12, 0xf0, 0xcd, 0xe7, 0x8e, 0x96, 0x55, 0xe4, 0x05, 0x36, 0x32, 0x2b, 0x6d,
  633. 0xb6, 0xa8, 0x16, 0x4a, 0x55, 0x89, 0x22, 0x24, 0x94, 0xd0, 0x88, 0x46, 0x22, 0x25, 0x9a, 0xe4,
  634. 0xb5, 0x8a, 0x26, 0xce, 0x00, 0x56, 0x12, 0x3b, 0xf5, 0x4c, 0x8a, 0x78, 0x6e, 0x5f, 0xfb, 0xd6,
  635. 0x5f, 0x52, 0xa9, 0x3f, 0xa0, 0x7d, 0xef, 0x7f, 0xaa, 0x3c, 0xfe, 0x88, 0x1d, 0x42, 0xa0, 0x48,
  636. 0xbc, 0xd9, 0xd7, 0xe7, 0xdc, 0x73, 0xe7, 0xde, 0x33, 0xe3, 0x81, 0xe2, 0x84, 0x32, 0x46, 0x2e,
  637. 0x2d, 0xfb, 0xd2, 0x98, 0xba, 0x0e, 0x77, 0x50, 0x2e, 0x0a, 0xf4, 0xa7, 0x03, 0xfd, 0x63, 0x0a,
  638. 0xfe, 0xe8, 0xce, 0x06, 0xcc, 0x74, 0xad, 0x01, 0x75, 0xdb, 0xe2, 0x13, 0x45, 0xc7, 0x90, 0xb2,
  639. 0x6c, 0x8b, 0x97, 0xa5, 0x8a, 0x54, 0xcd, 0xd6, 0xf6, 0x8c, 0x38, 0xc5, 0xb8, 0x05, 0x37, 0x5a,
  640. 0xb6, 0xc5, 0x83, 0x67, 0x2c, 0x88, 0xe8, 0x08, 0x14, 0x62, 0x8e, 0xca, 0xb2, 0xe0, 0x3f, 0xbb,
  641. 0x8f, 0x5f, 0x37, 0x47, 0x21, 0xdd, 0xa3, 0x69, 0xdf, 0x65, 0xc8, 0xc6, 0x72, 0xa2, 0x2d, 0x50,
  642. 0x6d, 0x32, 0xa1, 0x6c, 0x4a, 0x4c, 0x2a, 0x6a, 0x52, 0xf1, 0x3c, 0x80, 0xfe, 0x84, 0x34, 0x77,
  643. 0xa6, 0x96, 0x29, 0xd4, 0x54, 0xec, 0xbf, 0x78, 0x9c, 0x29, 0x71, 0xb9, 0xc5, 0x2d, 0xc7, 0x2e,
  644. 0x2b, 0x15, 0xa9, 0x9a, 0xc6, 0xf3, 0x00, 0xea, 0x43, 0x9e, 0x71, 0xe2, 0xf2, 0x8e, 0xc3, 0x7c,
  645. 0x44, 0xaa, 0x22, 0x55, 0x0b, 0xb5, 0x57, 0xbf, 0xb1, 0x52, 0xa3, 0x1b, 0x4f, 0x80, 0x93, 0xf9,
  646. 0x50, 0x05, 0xb2, 0xdc, 0x9a, 0x50, 0xc6, 0xc9, 0x64, 0xfa, 0x96, 0x95, 0xd3, 0x15, 0xa9, 0xaa,
  647. 0xe0, 0x78, 0x08, 0xed, 0x42, 0x9e, 0x45, 0xf9, 0xfb, 0xd6, 0xb0, 0x9c, 0x11, 0xe5, 0xe7, 0xe6,
  648. 0xc1, 0xd6, 0x50, 0x3f, 0x80, 0x7c, 0x42, 0x06, 0x01, 0x64, 0xce, 0xea, 0xbd, 0x66, 0xb7, 0x57,
  649. 0x5a, 0x43, 0x39, 0xd8, 0x68, 0xd6, 0xf1, 0x59, 0xcb, 0x7b, 0x93, 0x50, 0x1e, 0xd4, 0x5e, 0xab,
  650. 0xdd, 0xec, 0xf6, 0xea, 0xed, 0x4e, 0x49, 0xd6, 0xf6, 0x00, 0xe6, 0x6d, 0x45, 0xdb, 0x00, 0xfe,
  651. 0xca, 0xa8, 0xa7, 0x24, 0x89, 0x6a, 0xd4, 0x20, 0xd2, 0x1a, 0xea, 0x3f, 0x25, 0x58, 0x0f, 0xa1,
  652. 0x15, 0x50, 0xa3, 0x32, 0x7d, 0x64, 0x43, 0xde, 0x97, 0xf0, 0x3c, 0x88, 0x4a, 0xa0, 0x8c, 0xe8,
  653. 0x8d, 0x68, 0x77, 0x0e, 0x7b, 0x8f, 0xde, 0x08, 0x3e, 0x90, 0xf1, 0x8c, 0x8a, 0x46, 0xe7, 0xb0,
  654. 0xff, 0x82, 0x8e, 0x60, 0xfd, 0x8a, 0x92, 0x21, 0x75, 0x59, 0x39, 0x55, 0x51, 0xaa, 0xd9, 0x9a,
  655. 0x9e, 0x6c, 0x6f, 0xd8, 0xc8, 0x37, 0x3e, 0xa8, 0x69, 0x73, 0xf7, 0x06, 0x87, 0x14, 0xed, 0x10,
  656. 0x72, 0xf1, 0x0f, 0xa1, 0xaa, 0x3f, 0xfe, 0xa4, 0xaa, 0x1c, 0x53, 0x3d, 0x94, 0x0f, 0x24, 0xfd,
  657. 0x9b, 0x04, 0xf9, 0x86, 0xeb, 0x8c, 0xe6, 0x8e, 0xfe, 0x1f, 0x52, 0x43, 0xc2, 0x49, 0xe0, 0xe8,
  658. 0xcd, 0xa5, 0x85, 0x60, 0x01, 0x41, 0xa7, 0xb0, 0xe1, 0xd2, 0xa1, 0xe5, 0x52, 0x93, 0x07, 0x06,
  659. 0x5e, 0xd8, 0x00, 0x89, 0xcc, 0x06, 0x0e, 0xb0, 0x61, 0x92, 0x88, 0xac, 0xed, 0x43, 0x71, 0xe1,
  660. 0xa3, 0x37, 0x07, 0x9b, 0x5e, 0xf7, 0x07, 0x22, 0x43, 0x64, 0x65, 0x7a, 0xed, 0xa7, 0xd4, 0xbf,
  661. 0x2a, 0x50, 0xe8, 0xcc, 0x06, 0x63, 0x8b, 0x5d, 0x61, 0xfa, 0x7e, 0x46, 0x99, 0xb7, 0x93, 0xe2,
  662. 0x5b, 0xb1, 0x9a, 0xac, 0x24, 0x89, 0x5d, 0xba, 0x0f, 0xfd, 0x65, 0xcb, 0x0f, 0x60, 0xbf, 0x26,
  663. 0x9c, 0x24, 0x3a, 0xa1, 0xf5, 0x9f, 0x78, 0x1b, 0x6a, 0x3f, 0x24, 0xc8, 0xc6, 0x64, 0xe3, 0x33,
  664. 0xce, 0xad, 0x98, 0x31, 0x3a, 0x9f, 0x3b, 0x4b, 0x11, 0xce, 0x7a, 0xf9, 0xd0, 0x95, 0x3d, 0x81,
  665. 0xd9, 0x3e, 0xcb, 0x50, 0x8c, 0x04, 0xd9, 0xd4, 0xb1, 0x19, 0x45, 0x27, 0x90, 0x31, 0x1d, 0xfb,
  666. 0xc2, 0xba, 0x5c, 0x7e, 0x84, 0x2e, 0xc0, 0x8d, 0x13, 0x81, 0x0d, 0x9b, 0x1f, 0x50, 0x51, 0xeb,
  667. 0x96, 0x11, 0x9f, 0xaf, 0x4e, 0x73, 0xb7, 0x15, 0x0f, 0x20, 0x9f, 0xd0, 0x40, 0xff, 0x41, 0x31,
  668. 0x1a, 0x43, 0xdf, 0x74, 0x66, 0xb6, 0xef, 0xb0, 0x34, 0x2e, 0x44, 0xe1, 0x13, 0x2f, 0xfa, 0x08,
  669. 0x13, 0x7f, 0x91, 0x60, 0xd3, 0x17, 0x9b, 0xb9, 0xb4, 0xe7, 0xb9, 0x20, 0xf4, 0xf2, 0x63, 0x0c,
  670. 0xb4, 0xa4, 0x50, 0x65, 0x59, 0xa1, 0x68, 0x07, 0xc0, 0x74, 0xc6, 0x63, 0x6a, 0x46, 0xe7, 0xb9,
  671. 0x8a, 0x63, 0x11, 0xbd, 0x0c, 0x7f, 0x2d, 0x56, 0xe5, 0xb7, 0x4d, 0xc7, 0xb0, 0x75, 0x4a, 0xb9,
  672. 0x88, 0x85, 0x08, 0x22, 0xce, 0xf4, 0xc7, 0x97, 0xad, 0x1f, 0xc3, 0xf6, 0x1d, 0x39, 0x03, 0x87,
  673. 0xec, 0x00, 0x44, 0x0b, 0x60, 0xc1, 0x92, 0x62, 0x91, 0xda, 0x27, 0x05, 0x4a, 0x5d, 0x4a, 0xae,
  674. 0x29, 0x1d, 0xb6, 0xc3, 0x99, 0xa3, 0x73, 0x50, 0xa3, 0x7f, 0x12, 0xfa, 0xe7, 0x9e, 0x9f, 0x95,
  675. 0xf6, 0xf7, 0x8a, 0x63, 0x4b, 0x5f, 0xab, 0x4a, 0xfb, 0x12, 0x3a, 0x83, 0xf5, 0xc0, 0x44, 0x68,
  676. 0x6b, 0xd5, 0x16, 0xd2, 0xb6, 0x57, 0x3a, 0x2f, 0xc8, 0xf6, 0x0e, 0x0a, 0xc9, 0x16, 0xa3, 0xdd,
  677. 0x24, 0x6d, 0xa9, 0x2d, 0xb4, 0x7f, 0x57, 0x83, 0x42, 0x09, 0xe4, 0xc2, 0xe6, 0xd2, 0x9e, 0xa2,
  678. 0x85, 0x0b, 0xc6, 0xaa, 0x61, 0x6a, 0x7b, 0x0f, 0xc2, 0x86, 0x9a, 0x0d, 0x1d, 0x4a, 0xcc, 0x9f,
  679. 0xc2, 0x05, 0x33, 0xcc, 0xb1, 0x45, 0x6d, 0xde, 0x28, 0x44, 0x03, 0xe9, 0x78, 0x37, 0xaa, 0x41,
  680. 0x46, 0x5c, 0xac, 0x5e, 0xfc, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x31, 0x28, 0xa2, 0x6b, 0x09,
  681. 0x00, 0x00,
  682. }