first commit.
way too late.
This commit is contained in:
commit
dbbfaf99b6
15 files changed
+757
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package doorman
|
||||
|
||||
import (
|
||||
"github.com/didiercrunch/doorman/nanomsgsubscriber"
|
||||
"github.com/didiercrunch/doorman/nsqsubscriber"
|
||||
"github.com/didiercrunch/doorman/shared"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
)
|
||||
|
||||
type Subscriber interface {
|
||||
Subscribe(doormanId bson.ObjectId, update shared.UpdateHandlerFunc) error
|
||||
}
|
||||
|
||||
func (w *Doorman) Subscribe(sub Subscriber) error {
|
||||
return sub.Subscribe(w.Id, w.Update)
|
||||
}
|
||||
|
||||
func (w *Doorman) NSQSubscriber(NSQLookupdURl string) error {
|
||||
sub := &nsqsubscriber.NSQSubscriber{NSQLookupdURl}
|
||||
return w.Subscribe(sub)
|
||||
}
|
||||
|
||||
func (w *Doorman) NanoMsgSubscriber(NanoMsgUrlLookupdURl string) error {
|
||||
sub := &nanomsgsubscriber.NanoMsgSubscriber{NanoMsgUrlLookupdURl}
|
||||
return w.Subscribe(sub)
|
||||
}
|
||||
Reference in new issue
Block a user