summaryrefslogtreecommitdiff
path: root/plugins/broadcast
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-05-06 19:06:46 +0300
committerValery Piashchynski <[email protected]>2021-05-06 19:06:46 +0300
commitf6ba3c077ccbc572eda26701b9dbacaf9fa453b9 (patch)
treeab6c34128aa61a21aa62ba1211ff0f9e352f1b76 /plugins/broadcast
parent4fa94bb7f73a705293c2afd40fc1151a3aaa04e2 (diff)
- Update arch diagramm
- Update config Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/broadcast')
-rw-r--r--plugins/broadcast/doc/broadcast.drawio2
-rw-r--r--plugins/broadcast/interface.go16
-rw-r--r--plugins/broadcast/memory/driver.go2
-rw-r--r--plugins/broadcast/plugin.go5
4 files changed, 13 insertions, 12 deletions
diff --git a/plugins/broadcast/doc/broadcast.drawio b/plugins/broadcast/doc/broadcast.drawio
index 5f9d39b2..f610396d 100644
--- a/plugins/broadcast/doc/broadcast.drawio
+++ b/plugins/broadcast/doc/broadcast.drawio
@@ -1 +1 @@
-<mxfile host="Electron" modified="2021-05-04T18:10:53.311Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/14.5.1 Chrome/89.0.4389.128 Electron/12.0.6 Safari/537.36" etag="-7c-lVUZQ3gXb_2larRL" version="14.5.1" type="device"><diagram id="fD2kwGC0DAS2S_q_IsmE" name="Page-1">7Vpbb+I6EP41SHseQLkHHrl02+rQbbe02uW8mcQJPg0xckyB/vpjJw6JcUC0JMt2dUCK4vEF+5v5ZjwjWuZwsbkmYDm/wz6MWobmb1rmqGUYXd1iTy7YZgKr62SCkCA/E+mFYILeoBBqQrpCPkykgRTjiKKlLPRwHEOPSjJACF7LwwIcyb+6BCFUBBMPRKr0B/LpXEh7hlZ03EAUzvOfNjTRswD5aCFI5sDH65LIvGqZQ4Ixzd4WmyGMOHg5MNm8rwd6dzsjMKanTNhad+On6QDE3pMZvXwnSIv77Z7YG93mJ4Y+A0A0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PeNdf3pYq95Vpv3tNEaacW/1qRqVaDem7p9iyVqpnpw/NgfDu5Oe86UgMBerrdcQyJAbp1KgXMxiigKcD8T4FDYNknUsC8JAN0Nbakd/I/4bKga9XIiuW1jm46MsPOuyo0fxGwVX9183B5X2VYHdOVkKzINd2KTKgxR9VTgJqAV7i7E6/hLMHeC1dSbl4IxwqQF0j5z1KE0d2r5VeVJ7sNpfxHwrukiOsU9QHP8Qj/ydhPKecjUkpsUFqO2QVjje1mjv3LW7q2B3BVyq93eSKsYGy/H2PWLP6qkvmQ4g8/5tV/</diagram></mxfile> \ No newline at end of file
+<mxfile host="Electron" modified="2021-05-06T16:04:55.563Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/14.5.1 Chrome/89.0.4389.128 Electron/12.0.6 Safari/537.36" etag="VqUxZH_MlIcOLQiFtrvy" version="14.5.1" type="device"><diagram id="fD2kwGC0DAS2S_q_IsmE" name="Page-1">7VtZc+I4EP41VM08QNnyySNHrppkkgnJzmRfpoQtwBtjsbIJML9+JR/YsoTDYSCp2iRF7JYspO6vT8kNrTddXhE4m9xhF/kNoLjLhtZvAKBqBqD/GGWVUCzbTAhj4rlpp5ww8P6glKik1LnnopDrGGHsR96MJzo4CJATcTRICF7w3UbY5791BsdIIAwc6IvUn54bTVJqGyh5wzXyxpPsq4GStkxh1jslhBPo4kWBpF00tB7BOEqupsse8hn3MsYkz11uaF3PjKAg2uaBlX53+/TShYHzpPmvP4inBJ1mO51btMpWjFzKgPQWk2iCxziA/kVO7RI8D1zERlXoXd7nFuMZJaqU+A+KolUqTTiPMCVNoqmftqKlF/0qXL+woVpGetdfpiPHN6v0RlxtyoAQz4mDKpaY9mPrKjyY8ugK4SmKyIp2IMiHkffGCx6m+Bmv+60ffcAenQpQUqybmZxTpOu6wg8RQTJGUfpULid6UZhGToqlJ5dkr//iT/+23OV81vnmurc/+lHYVI1zilJpAaMozUpZUhGS1a9c6Oz2pdiWPxbfZc+NPN/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end of file
diff --git a/plugins/broadcast/interface.go b/plugins/broadcast/interface.go
index 923c8105..093943af 100644
--- a/plugins/broadcast/interface.go
+++ b/plugins/broadcast/interface.go
@@ -2,14 +2,8 @@ package broadcast
import "encoding/json"
-// Broker defines the ability to operate as message passing broker.
-type Broker interface {
- // Serve serves broker.
- Serve() error
-
- // Stop closes the consumption and disconnects broker.
- Stop()
-
+// Subscriber defines the ability to operate as message passing broker.
+type Subscriber interface {
// Subscribe broker to one or multiple topics.
Subscribe(upstream chan *Message, topics ...string) error
@@ -21,7 +15,13 @@ type Broker interface {
// UnsubscribePattern broker from pattern.
UnsubscribePattern(upstream chan *Message, pattern string) error
+}
+
+type Storage interface {
+
+}
+type Publisher interface {
// Publish one or multiple Channel.
Publish(messages ...*Message) error
}
diff --git a/plugins/broadcast/memory/driver.go b/plugins/broadcast/memory/driver.go
index 8a9374c9..29d67771 100644
--- a/plugins/broadcast/memory/driver.go
+++ b/plugins/broadcast/memory/driver.go
@@ -6,7 +6,7 @@ type Driver struct {
}
-func NewInMemoryDriver() broadcast.Broker {
+func NewInMemoryDriver() broadcast.Subscriber {
b := &Driver{
}
diff --git a/plugins/broadcast/plugin.go b/plugins/broadcast/plugin.go
index 45051a7f..f1ea258e 100644
--- a/plugins/broadcast/plugin.go
+++ b/plugins/broadcast/plugin.go
@@ -12,7 +12,7 @@ const (
)
type Plugin struct {
- broker Broker
+ broker Subscriber
log logger.Logger
cfg *Config
@@ -53,6 +53,7 @@ func (p *Plugin) Serve() chan error {
errCh <- errors.E(op, err)
}
}()
+
return errCh
}
@@ -76,7 +77,7 @@ func (p *Plugin) Collects() []interface{} {
}
}
-func (p *Plugin) CollectBroker(name endure.Named, broker Broker) {
+func (p *Plugin) CollectBroker(name endure.Named, broker Subscriber) {
p.broker = broker
}