Documentation ¶
Index ¶
- type ReadWriter
- func (rw *ReadWriter) Close()
- func (rw *ReadWriter) Dispatch(msg []byte)
- func (rw *ReadWriter) Read(v interface{}) error
- func (rw *ReadWriter) ReadByte() (byte, error)
- func (rw *ReadWriter) ReadInto(data interface{}) error
- func (rw *ReadWriter) ReadPadding(size int) error
- func (rw *ReadWriter) Reader() *bufio.Reader
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.