summaryrefslogtreecommitdiff
path: root/pkg/pubsub
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/pubsub')
-rw-r--r--pkg/pubsub/interface.go4
-rw-r--r--pkg/pubsub/message.fbs14
-rw-r--r--pkg/pubsub/message.go15
-rw-r--r--pkg/pubsub/message/Message.go118
-rw-r--r--pkg/pubsub/message/Messages.go67
5 files changed, 2 insertions, 216 deletions
diff --git a/pkg/pubsub/interface.go b/pkg/pubsub/interface.go
index eb65b4b7..4926cad6 100644
--- a/pkg/pubsub/interface.go
+++ b/pkg/pubsub/interface.go
@@ -1,6 +1,6 @@
package pubsub
-import "github.com/spiral/roadrunner/v2/pkg/pubsub/message"
+import websocketsv1 "github.com/spiral/roadrunner/v2/pkg/proto/websockets/v1beta"
/*
This interface is in BETA. It might be changed.
@@ -42,5 +42,5 @@ type Publisher interface {
// Reader interface should return next message
type Reader interface {
- Next() (*message.Message, error)
+ Next() (*websocketsv1.Message, error)
}
diff --git a/pkg/pubsub/message.fbs b/pkg/pubsub/message.fbs
deleted file mode 100644
index 7e975894..00000000
--- a/pkg/pubsub/message.fbs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace message;
-
-table Message {
- command:string;
- broker:string;
- topics:[string];
- payload:[byte];
-}
-
-table Messages {
- messages:[Message];
-}
-
-root_type Messages;
diff --git a/pkg/pubsub/message.go b/pkg/pubsub/message.go
deleted file mode 100644
index 74348722..00000000
--- a/pkg/pubsub/message.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package pubsub
-
-type Message struct {
- // Command (join, leave, headers)
- Command string `json:"command"`
-
- // Broker (redis, memory)
- Broker string `json:"broker"`
-
- // Topic message been pushed into.
- Topics []string `json:"topic"`
-
- // Payload to be broadcasted
- Payload []byte `json:"payload"`
-}
diff --git a/pkg/pubsub/message/Message.go b/pkg/pubsub/message/Message.go
deleted file mode 100644
index 26bbd12c..00000000
--- a/pkg/pubsub/message/Message.go
+++ /dev/null
@@ -1,118 +0,0 @@
-// Code generated by the FlatBuffers compiler. DO NOT EDIT.
-
-package message
-
-import (
- flatbuffers "github.com/google/flatbuffers/go"
-)
-
-type Message struct {
- _tab flatbuffers.Table
-}
-
-func GetRootAsMessage(buf []byte, offset flatbuffers.UOffsetT) *Message {
- n := flatbuffers.GetUOffsetT(buf[offset:])
- x := &Message{}
- x.Init(buf, n+offset)
- return x
-}
-
-func GetSizePrefixedRootAsMessage(buf []byte, offset flatbuffers.UOffsetT) *Message {
- n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
- x := &Message{}
- x.Init(buf, n+offset+flatbuffers.SizeUint32)
- return x
-}
-
-func (rcv *Message) Init(buf []byte, i flatbuffers.UOffsetT) {
- rcv._tab.Bytes = buf
- rcv._tab.Pos = i
-}
-
-func (rcv *Message) Table() flatbuffers.Table {
- return rcv._tab
-}
-
-func (rcv *Message) Command() []byte {
- o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
- if o != 0 {
- return rcv._tab.ByteVector(o + rcv._tab.Pos)
- }
- return nil
-}
-
-func (rcv *Message) Broker() []byte {
- o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
- if o != 0 {
- return rcv._tab.ByteVector(o + rcv._tab.Pos)
- }
- return nil
-}
-
-func (rcv *Message) Topics(j int) []byte {
- o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
- if o != 0 {
- a := rcv._tab.Vector(o)
- return rcv._tab.ByteVector(a + flatbuffers.UOffsetT(j*4))
- }
- return nil
-}
-
-func (rcv *Message) TopicsLength() int {
- o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
- if o != 0 {
- return rcv._tab.VectorLen(o)
- }
- return 0
-}
-
-func (rcv *Message) Payload(j int) int8 {
- o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
- if o != 0 {
- a := rcv._tab.Vector(o)
- return rcv._tab.GetInt8(a + flatbuffers.UOffsetT(j*1))
- }
- return 0
-}
-
-func (rcv *Message) PayloadLength() int {
- o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
- if o != 0 {
- return rcv._tab.VectorLen(o)
- }
- return 0
-}
-
-func (rcv *Message) MutatePayload(j int, n int8) bool {
- o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
- if o != 0 {
- a := rcv._tab.Vector(o)
- return rcv._tab.MutateInt8(a+flatbuffers.UOffsetT(j*1), n)
- }
- return false
-}
-
-func MessageStart(builder *flatbuffers.Builder) {
- builder.StartObject(4)
-}
-func MessageAddCommand(builder *flatbuffers.Builder, command flatbuffers.UOffsetT) {
- builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(command), 0)
-}
-func MessageAddBroker(builder *flatbuffers.Builder, broker flatbuffers.UOffsetT) {
- builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(broker), 0)
-}
-func MessageAddTopics(builder *flatbuffers.Builder, topics flatbuffers.UOffsetT) {
- builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(topics), 0)
-}
-func MessageStartTopicsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
- return builder.StartVector(4, numElems, 4)
-}
-func MessageAddPayload(builder *flatbuffers.Builder, payload flatbuffers.UOffsetT) {
- builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(payload), 0)
-}
-func MessageStartPayloadVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
- return builder.StartVector(1, numElems, 1)
-}
-func MessageEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
- return builder.EndObject()
-}
diff --git a/pkg/pubsub/message/Messages.go b/pkg/pubsub/message/Messages.go
deleted file mode 100644
index 633b367d..00000000
--- a/pkg/pubsub/message/Messages.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Code generated by the FlatBuffers compiler. DO NOT EDIT.
-
-package message
-
-import (
- flatbuffers "github.com/google/flatbuffers/go"
-)
-
-type Messages struct {
- _tab flatbuffers.Table
-}
-
-func GetRootAsMessages(buf []byte, offset flatbuffers.UOffsetT) *Messages {
- n := flatbuffers.GetUOffsetT(buf[offset:])
- x := &Messages{}
- x.Init(buf, n+offset)
- return x
-}
-
-func GetSizePrefixedRootAsMessages(buf []byte, offset flatbuffers.UOffsetT) *Messages {
- n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
- x := &Messages{}
- x.Init(buf, n+offset+flatbuffers.SizeUint32)
- return x
-}
-
-func (rcv *Messages) Init(buf []byte, i flatbuffers.UOffsetT) {
- rcv._tab.Bytes = buf
- rcv._tab.Pos = i
-}
-
-func (rcv *Messages) Table() flatbuffers.Table {
- return rcv._tab
-}
-
-func (rcv *Messages) Messages(obj *Message, j int) bool {
- o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
- if o != 0 {
- x := rcv._tab.Vector(o)
- x += flatbuffers.UOffsetT(j) * 4
- x = rcv._tab.Indirect(x)
- obj.Init(rcv._tab.Bytes, x)
- return true
- }
- return false
-}
-
-func (rcv *Messages) MessagesLength() int {
- o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
- if o != 0 {
- return rcv._tab.VectorLen(o)
- }
- return 0
-}
-
-func MessagesStart(builder *flatbuffers.Builder) {
- builder.StartObject(1)
-}
-func MessagesAddMessages(builder *flatbuffers.Builder, messages flatbuffers.UOffsetT) {
- builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(messages), 0)
-}
-func MessagesStartMessagesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
- return builder.StartVector(4, numElems, 4)
-}
-func MessagesEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
- return builder.EndObject()
-}