From 7b033878f079f8daee5207c80f2bedb5b34d2f2d Mon Sep 17 00:00:00 2001 From: geek Date: Thu, 23 Nov 2017 19:36:50 +0900 Subject: [PATCH] delete subscriber_handler --- servlet/data/subscriber_handlers.go | 34 ----------------------------- 1 file changed, 34 deletions(-) delete mode 100644 servlet/data/subscriber_handlers.go diff --git a/servlet/data/subscriber_handlers.go b/servlet/data/subscriber_handlers.go deleted file mode 100644 index 40f06a3..0000000 --- a/servlet/data/subscriber_handlers.go +++ /dev/null @@ -1,34 +0,0 @@ -package data - -import ( - "git.loafle.net/commons_go/websocket_fasthttp/websocket" - oogws "git.loafle.net/overflow/overflow_gateway_websocket/servlet" - oogwsub "git.loafle.net/overflow/overflow_gateway_websocket/subscribe" - oos "git.loafle.net/overflow/overflow_subscriber" -) - -func newSubscriberHandler(servletHandler oogws.ServletHandler) oogwsub.SubscriberHandler { - sh := &SubscriberHandlers{} - sh.ServletHandler = servletHandler - sh.Channel = cfg.Entry - - return sh -} - -type SubscriberHandlers struct { - oogwsub.SubscriberHandlers -} - -func (sh *SubscriberHandlers) OnSubscribe(channel string, message oos.SubscribeMessage) { - for _, uid := range message.Targets { - if soc := sh.GetSocket(uid); nil != soc { - soc.WriteMessage(websocket.TextMessage, message.Message) - } - } -} - -func (sh *SubscriberHandlers) Validate() { - sh.SubscriberHandlers.Validate() -} - -