ws

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageFn

type MessageFn func(message []byte) error

type PingFn

type PingFn func(ws *WSConn) error

type PongFn

type PongFn func(message []byte) bool

type WSConn

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

func NewWSConn

func NewWSConn(addr string, initFn WSInitFn, messageFn MessageFn) (conn *WSConn, err error)

func NewWSConnWithPingPong

func NewWSConnWithPingPong(addr string, initFn WSInitFn, messageFn MessageFn, ping PingFn, pong PongFn) (conn *WSConn, err error)

func (*WSConn) Close

func (conn *WSConn) Close() (err error)

func (*WSConn) SetPingPongFn

func (conn *WSConn) SetPingPongFn(ping PingFn, pong PongFn)

func (*WSConn) WriteMsg

func (conn *WSConn) WriteMsg(value interface{}) (err error)

func (*WSConn) WriteText

func (conn *WSConn) WriteText(value string) (err error)

type WSInitFn

type WSInitFn func(ws *WSConn) error

Jump to

Keyboard shortcuts

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