web_socket

package
v0.0.0-...-1871c23 Latest Latest
Warning

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

Go to latest
Published: May 24, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Websocket server package. This package starts separate websocket server and transfers all messages from redis channel "ws" to client browser.

Running server

web_socket.StartServer()

Example code to send data to redis:

	c, _ := redis.Dial("tcp", ":6379")
 msg := web_socket.RedisMessage{"apiKey", map[string]interface{}{
	  "log_per_second": 24,
   "kbs_per_second": 128,
 }}
 msg.Send(c)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer()

Types

type RedisMessage

type RedisMessage struct {
	ApiKey string
	Data   interface{}
}

Represents data to be sent to user by its apiKey

func (*RedisMessage) Send

func (m *RedisMessage) Send(r redis.Conn) (interface{}, error)

Jump to

Keyboard shortcuts

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