Documentation
¶
Overview ¶
@Title WebsocketDealer.go @Description 实现websocket低成本call 需要客户端配合 @Author Dorbmon
Index ¶
Constants ¶
View Source
const ( ModuleName = "WebsocketDealer" ModuleVersion = 0.2 )
Variables ¶
View Source
var Once sync.Once
Functions ¶
func InitWebsocketDealer ¶ added in v0.0.4
func InitWebsocketDealer()
Types ¶
type Replier ¶ added in v0.0.4
type Replier struct {
// contains filtered or unexported fields
}
type StandardCall ¶
type StandardReply ¶ added in v0.0.4
type StandardReply struct {
Id uint64 `json:"id"`
Data interface{} `json:"data"`
}
type WebsocketDealFunction ¶
type WebsocketDealFunction func(replier *Replier, arguments []interface{})
type WebsocketDealer ¶
type WebsocketDealer struct {
OriginCheck func(ctx *RWeb.Context) bool
// contains filtered or unexported fields
}
func New ¶
func New() (r WebsocketDealer)
func (*WebsocketDealer) BindFunction ¶
func (z *WebsocketDealer) BindFunction(FunctionName string, Function WebsocketDealFunction) error
func (*WebsocketDealer) BindReplyId ¶ added in v0.0.4
func (z *WebsocketDealer) BindReplyId(id uint64, c chan StandardReply)
func (*WebsocketDealer) Handler ¶
func (z *WebsocketDealer) Handler(context *RWeb.Context)
* 使用此函数作为引擎的绑定函数
func (*WebsocketDealer) RemoveBindReplyId ¶ added in v0.0.4
func (z *WebsocketDealer) RemoveBindReplyId(id uint64)
type WebsocketResponse ¶ added in v0.0.4
type WebsocketResponse struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.