wsblaster

package
v0.0.0-...-de3c1b4 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blaster

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

Blaster contains info about the WebSocket blaster

func GetBlaster

func GetBlaster(addr *string, read bool) *Blaster

GetBlaster returns a new Blaster

func (*Blaster) GetReadBuffer

func (b *Blaster) GetReadBuffer() *MessageBuffer

GetReadBuffer returns pointer to the ReadBuffer

func (*Blaster) GetWSHandler

func (b *Blaster) GetWSHandler() func(w http.ResponseWriter, r *http.Request)

GetWSHandler returns a HTTP handler function for the websocket

func (*Blaster) Run

func (b *Blaster) Run()

Run starts the HTTP and WS process. Run does not return

func (*Blaster) StartHub

func (b *Blaster) StartHub()

StartHub runs the Hub/blaster, but does not do its own HTTP Listening

func (*Blaster) Write

func (b *Blaster) Write(m []byte)

type Client

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

Client is a middleman between the websocket connection and the hub.

type Hub

type Hub struct {

	// Buffer holding messages from Clients
	ReadBuffer *MessageBuffer
	// contains filtered or unexported fields
}

Hub maintains the set of active connections and broadcasts messages to the connections.

type MessageBuffer

type MessageBuffer struct {
	Messages []*[]byte
	sync.RWMutex
}

MessageBuffer holds incoming messages from clients

Jump to

Keyboard shortcuts

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