wsrpc

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package wsrpc provides a ReadWriteCloser which operates on a WebSocket connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadWriteCloser

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

ReadWriteCloser is a rwc based on WebSockets

func NewReadWriteCloser

func NewReadWriteCloser(ws *websocket.Conn) ReadWriteCloser

NewReadWriteCloser creates a new rwc from a WebSocket connection

func (*ReadWriteCloser) Close

func (rwc *ReadWriteCloser) Close() (err error)

Close the rwc and the underlying WebSocket connection

func (*ReadWriteCloser) Read

func (rwc *ReadWriteCloser) Read(p []byte) (n int, err error)

Read reads from the WebSocket into p

func (*ReadWriteCloser) Write

func (rwc *ReadWriteCloser) Write(p []byte) (n int, err error)

Write writes the provided bytes to the WebSocket

Jump to

Keyboard shortcuts

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