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.

835 lines
31 KiB

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