fayec/extensions/getstream.go

27 lines
555 B
Go
Raw Normal View History

2018-09-05 08:56:45 +00:00
package extensions
import (
2023-09-19 02:01:38 +00:00
"gitea.watsonlabs.net/watsonb8/fayec/message"
2018-09-05 08:56:45 +00:00
)
type GetStream struct {
UserID string `json:"user_id,omitempty"`
ApiKey string `json:"api_key,omitempty"`
Signature string `json:"signature,omitempty"`
}
func NewGetStream(apiKey string, signature string) GetStream {
return GetStream{
ApiKey: apiKey,
Signature: signature,
}
}
func (gt GetStream) OutExtension(msg *message.Message) {
if msg.Channel == string(message.MetaSubscribe) {
2018-09-05 08:56:45 +00:00
//get useriID
gt.UserID = msg.Subscription[1:]
msg.Ext = gt
2018-09-05 08:56:45 +00:00
}
}