ws

package
v0.0.0-...-2264076 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

wsserver.go

Index

Constants

This section is empty.

Variables

View Source
var Logs = logs

Functions

func InitPubSub

func InitPubSub(redisConf *redis.Options) error

func ServeApns

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

func ServeNotify

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

serveNotify receives the API, parses the body and sends the message to the corresponding websocket. Returns error if no websocket conn exists for a client id or send fails

func ServeNotifyCORS

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

func ServeWs

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

serverWs handles websocket requests from the peer.

Types

type NotifyData

type NotifyData struct {
	ClientId string
	Message  string
}

type NotifyResponse

type NotifyResponse struct {
	Status   bool   `json:"status"`
	ClientId string `json:"clientId"`
}

type WsMessage

type WsMessage struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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