controller

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMessage

func GetMessage(topic, data string) []byte

GetMessage return message as json

func NewSubscribe

func NewSubscribe(h *Hub) *subscribe

NewSubscribe return new subscribe object.

Types

type Hub

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

func NewHub

func NewHub(ws *websocket.Conn, t service.TopicPool, debug bool) *Hub

NewHub return new Hub object.

func (*Hub) Reader

func (h *Hub) Reader()

Reader is data reader.

func (*Hub) Run

func (h *Hub) Run()

Run is main method.

func (*Hub) Send

func (h *Hub) Send(data []byte)

Send data.

func (*Hub) Writer

func (h *Hub) Writer()

Writer is data writer.

type WSMessage

type WSMessage struct {
	Action string `json:"action"`
	Topic  string `json:"topic"`
	Data   string `json:"data"`
}

Jump to

Keyboard shortcuts

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