mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-09 18:53:46 +08:00
v2.0
This commit is contained in:
28
server/internal/controller/websocket/send.go
Normal file
28
server/internal/controller/websocket/send.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// Package websocket
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package websocket
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/model/input/websocketin"
|
||||
"hotgo/internal/websocket"
|
||||
)
|
||||
|
||||
// Send 通过http发送ws消息
|
||||
var Send = send{}
|
||||
|
||||
type send struct{}
|
||||
|
||||
// ToTag 发送标签消息
|
||||
func (c *send) ToTag(ctx context.Context, req *websocketin.SendToTagReq) (res *websocketin.SendToTagRes, err error) {
|
||||
|
||||
go websocket.SendToTag(req.Tag, &websocket.WResponse{
|
||||
Event: req.Response.Event,
|
||||
Data: req.Response,
|
||||
})
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user