jswsconnect

package
v0.0.0-...-40b8db7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayBufferToSlice

func ArrayBufferToSlice(value js.Value) []byte

func JsLogError

func JsLogError(v ...interface{})

func JsLogErrorf

func JsLogErrorf(format string, v ...interface{})

func Uint8ArrayToSlice

func Uint8ArrayToSlice(value js.Value) []byte

Types

type Connection

type Connection struct {
	SendRecvStop func()
	// contains filtered or unexported fields
}

func New

func New(
	connAddr string,
	handleRecvPacketFn func(pk *packet.Packet) error,
	handleSentPacketFn func(pk *packet.Packet) error,
) *Connection

func (*Connection) Connect

func (wsc *Connection) Connect(
	ctx context.Context,
	wg *sync.WaitGroup,
) error

func (*Connection) EnqueueSendPacket

func (wsc *Connection) EnqueueSendPacket(pk packet.Packet) error

func (*Connection) String

func (wsc *Connection) String() string

Jump to

Keyboard shortcuts

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