socket

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TcpRelay

func TcpRelay(ws *websocket.Conn, rq *TcpRelayParam) error

Types

type PlainData added in v0.4.3

type PlainData struct {
	Method  string
	TaskId  uint
	Success bool
	Message string
	Payload any
}

func (*PlainData) GetPayload added in v0.4.3

func (d *PlainData) GetPayload(v any) error

type TcpRelayParam

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

type WsConn

type WsConn struct {
	*websocket.Conn
}

func NewWsClient

func NewWsClient(u, p, o string) (*WsConn, error)

func NewWsConn

func NewWsConn(ws *websocket.Conn) *WsConn

func (*WsConn) Close

func (pod *WsConn) Close() error

func (*WsConn) Die

func (pod *WsConn) Die(r string)

func (*WsConn) Read

func (pod *WsConn) Read(v []byte) error

func (*WsConn) ReadJson

func (pod *WsConn) ReadJson(v any) error

func (*WsConn) Write

func (pod *WsConn) Write(p []byte) error

func (*WsConn) WriteJson

func (pod *WsConn) WriteJson(v any) error

Jump to

Keyboard shortcuts

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