websocket

package
v0.0.0-...-b7e4b9d Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection interface {
	Write(data []byte) error
	Read() ([]byte, error)
	Close() error
}

Connection is the interface that wraps the Websocket connection.

func NewWebsocket

func NewWebsocket(w http.ResponseWriter, r *http.Request) (Connection, error)

NewWebsocket returns a new Connection using the http request/response.

type Websocket

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

Websocket implements the Connection interface.

func (*Websocket) Close

func (c *Websocket) Close() error

Close closes the connection.

func (*Websocket) Read

func (c *Websocket) Read() ([]byte, error)

Read blocks until a message is received from the connection.

func (*Websocket) Write

func (c *Websocket) Write(data []byte) error

Write writes the data to the connection.

Jump to

Keyboard shortcuts

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