events

package
v0.0.0-...-7cf307b Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2016 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// To Reference an event to broadcast on
	Ref string
	// The Websocket Connection
	Ws *websocket.Conn
	// A channel to quit on to close the connection
	Done chan bool
}

func (Connection) Close

func (c Connection) Close()

type Event

type Event struct {
	// The reference to be compared upon
	Ref  *string
	Data map[string]interface{}
}

type Handler

type Handler struct {
	// Channel to Receive the events on
	Receive chan Event

	// Store of events being listened for
	Store map[string]map[*websocket.Conn]*Connection
	// contains filtered or unexported fields
}

func NewEventHandler

func NewEventHandler() *Handler

func (*Handler) BroadcastEvent

func (h *Handler) BroadcastEvent(event Event, ref string)

func (*Handler) Init

func (h *Handler) Init()

func (*Handler) RegisterEvent

func (h *Handler) RegisterEvent(c *Connection)

func (*Handler) UnregisterEvent

func (h *Handler) UnregisterEvent(c Connection)

Jump to

Keyboard shortcuts

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