summaryrefslogtreecommitdiff
path: root/plugins/broadcast/interface.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/broadcast/interface.go')
-rw-r--r--plugins/broadcast/interface.go41
1 files changed, 0 insertions, 41 deletions
diff --git a/plugins/broadcast/interface.go b/plugins/broadcast/interface.go
deleted file mode 100644
index 47c779b5..00000000
--- a/plugins/broadcast/interface.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package broadcast
-
-import (
- "encoding/json"
-)
-
-// Subscriber defines the ability to operate as message passing broker.
-type Subscriber interface {
- // Subscribe broker to one or multiple topics.
- Subscribe(topics ...string) error
- // UnsubscribePattern broker from pattern.
- UnsubscribePattern(pattern string) error
-}
-
-// Storage used to store patterns and topics
-type Storage interface {
- // Store connection uuid associated with the provided topics
- Store(uuid string, topics ...string)
- // StorePattern stores pattern associated with the particular connection
- StorePattern(uuid string, pattern string)
-
- // GetConnection returns connections for the particular pattern
- GetConnection(pattern string) []string
-
- // Construct is a constructor for the storage according to the provided configuration key (broadcast.websocket for example)
- Construct(key string) (Storage, error)
-}
-
-type Publisher interface {
- // Publish one or multiple Channel.
- Publish(messages ...*Message) error
-}
-
-// Message represent single message.
-type Message struct {
- // Topic message been pushed into.
- Topic string `json:"topic"`
-
- // Payload to be broadcasted. Must be valid json when transferred over RPC.
- Payload json.RawMessage `json:"payload"`
-}