WebsocketDealer

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

@Title WebsocketDealer.go @Description 实现websocket低成本call 需要客户端配合 @Author Dorbmon

Index

Constants

View Source
const (
	ModuleName    = "WebsocketDealer"
	ModuleVersion = 0.1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

type StandardCall

type StandardCall struct {
	Function string        `json:"function"`
	Argument []interface{} `json:"argument"`
}

type WebsocketDealFunction

type WebsocketDealFunction func(conn *Conn, 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) Handler

func (z *WebsocketDealer) Handler(context *RWeb.Context)

*

使用此函数作为引擎的绑定函数

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL