adapter

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkWss = "wss"
)

适配器类型定义

Variables

This section is empty.

Functions

This section is empty.

Types

type WsAdapter

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

Websocket 适配器

func NewWsAdapter

func NewWsAdapter(w http.ResponseWriter, r *http.Request) (*WsAdapter, error)

func (*WsAdapter) Close

func (w *WsAdapter) Close() error

func (*WsAdapter) Network

func (w *WsAdapter) Network() string

func (*WsAdapter) Read

func (w *WsAdapter) Read() ([]byte, error)

func (*WsAdapter) SetCloseHandler

func (w *WsAdapter) SetCloseHandler(fn func(code int, text string) error)

func (*WsAdapter) Write

func (w *WsAdapter) Write(bytes []byte) error

Jump to

Keyboard shortcuts

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