Help us shape the future of Go! Take the 2026 Go Developer Survey

ws

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WSCtx

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

func GetCtx

func GetCtx(label string) *WSCtx

func NewWSCtx

func NewWSCtx(conn *websocket.Conn) *WSCtx

func (*WSCtx) Read

func (ws *WSCtx) Read(p []byte) (n int, err error)

Read implements io.ReadWriter. only support BinaryMessage

func (*WSCtx) Receive

func (ws *WSCtx) Receive(f func(messageType int, p []byte))

Receive This method will clog up

func (*WSCtx) Send

func (ws *WSCtx) Send(o any)

Send Use the default serialize send

func (*WSCtx) SetSerialize

func (ws *WSCtx) SetSerialize(serialize def.Serialize)

func (*WSCtx) SetWsLabel

func (ws *WSCtx) SetWsLabel(label string) *WSCtx

func (*WSCtx) Write

func (ws *WSCtx) Write(p []byte) (n int, err error)

Write implements io.ReadWriter. only support BinaryMessage

func (*WSCtx) WriteJSON

func (ws *WSCtx) WriteJSON(o any)

Jump to

Keyboard shortcuts

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