websocket

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebSocket

type WebSocket struct {
	Path    string
	Handler WebSocketHandler

	*websocket.Upgrader
	*websocket.Conn
}

WebSocket ws definition

func NewWebSocket

func NewWebSocket(path string, handler WebSocketHandler) *WebSocket

NewWebSocket returns a WebSocket instance

func (*WebSocket) Upgrade

func (ws *WebSocket) Upgrade(w http.ResponseWriter, r *http.Request)

Upgrade upgrade http to WebSocket

type WebSocketHandler

type WebSocketHandler func(*WebSocket)

WebSocketHandler ws callback handler

Jump to

Keyboard shortcuts

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