wrapws

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandler

type EventHandler interface {
	OnConnect(ctx context.Context, conn *websocket.Conn)
	OnDisconnect(ctx context.Context, conn *websocket.Conn, err error)
	OnError(ctx context.Context, conn *websocket.Conn, err error)
	OnMessage(ctx context.Context, conn *websocket.Conn, payload []byte)
}

type WebSocketClient

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

func NewWebSocketClient

func NewWebSocketClient(handler EventHandler) *WebSocketClient

func (*WebSocketClient) Dial

func (ws *WebSocketClient) Dial(addr string, options *websocket.DialOptions, callback func(conn *websocket.Conn)) error

type WebSocketServer

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

func NewWebSocketServer

func NewWebSocketServer(handler EventHandler, options *websocket.AcceptOptions) *WebSocketServer

func (*WebSocketServer) Serve

func (ws *WebSocketServer) Serve(addr string) error

Jump to

Keyboard shortcuts

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