ws

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TextMessage   = websocket.TextMessage
	PingMessage   = websocket.PingMessage
	PongMessage   = websocket.PongMessage
	CloseMessage  = websocket.CloseMessage
	BinaryMessage = websocket.BinaryMessage
)

Variables

This section is empty.

Functions

func NewServer

func NewServer(handle func(*http.Request) Logic) func(string, string) error

Types

type Conn

type Conn = *websocket.Conn

type Logic

type Logic interface {
	DataReceived(packet []byte)      // 接收数据
	ConnectionMade(conn Conn) error  // 建立连接
	ConnectionLost(connection error) // 断开连接
}

Jump to

Keyboard shortcuts

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