Add String method to all interfaces

This commit is contained in:
Asim
2015-12-19 21:56:14 +00:00
parent d7b3765c71
commit be43d827c7
17 changed files with 73 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ type Broker interface {
Init() error
Publish(string, *Message) error
Subscribe(string, Handler) (Subscriber, error)
String() string
}
type Handler func(*Message)
@@ -52,3 +53,7 @@ func Publish(topic string, msg *Message) error {
func Subscribe(topic string, handler Handler) (Subscriber, error) {
return DefaultBroker.Subscribe(topic, handler)
}
func String() string {
return DefaultBroker.String()
}