ws

package
v0.0.0-...-5805fc1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSocket = errors.New("ws: could not find associated WebSocket")

ErrNoSocket is returned if there could be no WebSocket found for some key.

Functions

func Close

func Close(key *datastore.Key) error

Close closes the WebSocket associated with the given key. It does not take care of messages currently being sent, and just roughly closes the underlying connection. If the connection is already gone it will do nothing.

func Handle

func Handle(w http.ResponseWriter, r *http.Request)

Handle performs an upgrade from HTTP to WebSocket. It hijacks the connection and registers it in the global pool.

func NewWriter

func NewWriter(key *datastore.Key) (io.WriteCloser, error)

NewWriter picks the right WebSocket to communicate with the user owning the entity referenced by the passed key and returns a writer suitable to send a WebSocket text message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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