add dispatcher
simplify transport implementation support wildcard subscriptions
This commit is contained in:
@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func debugJson(v interface{}) string {
|
||||
b, _ := json.MarshalIndent(v, "", " ")
|
||||
b, _ := json.MarshalIndent(v, "", " ")
|
||||
return string(b)
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ type DebugExtension struct {
|
||||
|
||||
func NewDebugExtension(out io.Writer) *DebugExtension {
|
||||
li := log.New(out, "InMsg", 0)
|
||||
lo := log.New(out, "outMsg", 0)
|
||||
lo := log.New(out, "OutMsg", 0)
|
||||
return &DebugExtension{in: li, out: lo}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,6 @@ package extensions
|
||||
|
||||
import (
|
||||
"github.com/thesyncim/faye/message"
|
||||
"github.com/thesyncim/faye/transport"
|
||||
)
|
||||
|
||||
type GetStream struct {
|
||||
@ -18,10 +17,10 @@ func NewGetStream(apiKey string, signature string) GetStream {
|
||||
}
|
||||
}
|
||||
|
||||
func (gt GetStream) OutExtension(message *message.Message) {
|
||||
if message.Channel == string(transport.MetaSubscribe) {
|
||||
func (gt GetStream) OutExtension(msg *message.Message) {
|
||||
if msg.Channel == string(message.MetaSubscribe) {
|
||||
//get useriID
|
||||
gt.UserID = message.Subscription[1:]
|
||||
message.Ext = gt
|
||||
gt.UserID = msg.Subscription[1:]
|
||||
msg.Ext = gt
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user