websocket

package
v3.0.16 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandler

func RegisterHandler()

func RegisterTransport

func RegisterTransport()

Types

type Handler

type Handler struct {
	rpchttp.Handler
	Pool     core.WorkerPool
	OnAccept func(*websocket.Conn) *websocket.Conn
	OnClose  func(*websocket.Conn)
	OnError  func(*websocket.Conn, error)
}

func (*Handler) BindContext

func (h *Handler) BindContext(ctx context.Context, server core.Server)

BindContext to the websocket server.

func (*Handler) Serve

func (h *Handler) Serve(ctx context.Context, conn *websocket.Conn)

func (*Handler) ServeFastHTTP added in v3.0.6

func (h *Handler) ServeFastHTTP(ctx *fasthttp.RequestCtx)

ServeFastHTTP implements the fasthttp.RequestHandler.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP implements the http.Handler interface.

type Transport

type Transport struct {
	OnConnect func(*websocket.Conn) *websocket.Conn
	OnClose   func(*websocket.Conn)
	// contains filtered or unexported fields
}

func (*Transport) Abort

func (trans *Transport) Abort()

func (*Transport) Transport

func (trans *Transport) Transport(ctx context.Context, request []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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