buffer

package
v0.0.0-...-831e56b Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: GPL-3.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 ReadWriter

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

ReadWriter is a buffer read/writer for RFB conncetions. It is held in a separate package to be passed easily between handlers.

It doesn't implement an actual io.ReadWriter, rather is intended soley for use by the rfb package.

func NewReadWriteBuffer

func NewReadWriteBuffer(c net.Conn) *ReadWriter

NewReadWriteBuffer returns a new ReadWriter for the given connection.

func (*ReadWriter) Close

func (rw *ReadWriter) Close()

Close will stop this buffer from processing messages.

func (*ReadWriter) Dispatch

func (rw *ReadWriter) Dispatch(msg []byte)

Dispatch will push packed message(s) onto the buffer queue.

func (*ReadWriter) Read

func (rw *ReadWriter) Read(v interface{}) error

Read will read from the buffer into the given interface. This method is not intended to be used with structs. Use ReadInto for that.

func (*ReadWriter) ReadByte

func (rw *ReadWriter) ReadByte() (byte, error)

ReadByte reads a single byte from the buffer.

func (*ReadWriter) ReadInto

func (rw *ReadWriter) ReadInto(data interface{}) error

ReadInto reflects on the given struct and populates its fields from the read buffer. The struct fields must be in the order they appear on the buffer.

func (*ReadWriter) ReadPadding

func (rw *ReadWriter) ReadPadding(size int) error

ReadPadding pops padding off the read buffer of the given size.

func (*ReadWriter) Reader

func (rw *ReadWriter) Reader() *bufio.Reader

Reader returns a direct reference to the underlying reader.

Jump to

Keyboard shortcuts

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