eventsocket

package module
v0.0.0-...-c5b00fe Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2015 License: MIT Imports: 10 Imported by: 1

README

eventsocket

Websocket event broker in Go

Documentation

Index

Constants

View Source
const (
	// ErrorRequestClientNoExist a request was sent to a client who does not exist
	ErrorRequestClientNoExist = "ErrorRequestClientNoExist"

	// ErrorRequestClientNotConnected a request was sent to a client who is not connected
	ErrorRequestClientNotConnected = "ErrorRequestClientNotConnected"
)
View Source
const MESSAGE_TYPE_BROADCAST = 1
View Source
const MESSAGE_TYPE_REPLY = 4
View Source
const MESSAGE_TYPE_REQUEST = 3
View Source
const MESSAGE_TYPE_STANDARD = 2
View Source
const MESSAGE_TYPE_SUSCRIBE = 5
View Source
const MESSAGE_TYPE_UNSUSCRIBE = 6

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Id string `json:"Id"`
	// contains filtered or unexported fields
}

type ClientMessage

type ClientMessage struct {
	ClientId string
	Message  Message
}

type Clients

type Clients map[string]*Client

type Message

type Message struct {
	MessageType MessageType `json:MessageType`
	Event       string      `json:Event,omitempty`
	RequestId   string      `json:RequestId,omitempty`
	// ReplyTo         string                 `json:ReplyTo,omitempty`
	ReplyClientId   string                 `json:ReplyClientId,omitempty`
	RequestClientId string                 `json:RequestClientId,omitempty`
	Payload         map[string]interface{} `json:Payload`
	Error           map[string]interface{} `json:Error`
}

type MessageType

type MessageType int

type Server

type Server struct {
	Config struct {
		// contains filtered or unexported fields
	}
	HttpServer *httpServer
}

func NewServer

func NewServer(listenAddr string) (server *Server, err error)

return a new, registered instance of the eventsocket server

func (*Server) SetDefaultMaxMessageSize

func (server *Server) SetDefaultMaxMessageSize(limit int64)

maximum message size allowed from peer

func (*Server) SetDefaultReadDeadline

func (server *Server) SetDefaultReadDeadline(t time.Duration)

set the default read deadline from the peer

func (*Server) Start

func (server *Server) Start() error

func (*Server) Stop

func (server *Server) Stop() error

Directories

Path Synopsis
Godeps
_workspace/src/github.com/gorilla/context
Package context stores values shared during a request lifetime.
Package context stores values shared during a request lifetime.
_workspace/src/github.com/gorilla/mux
Package gorilla/mux implements a request router and dispatcher.
Package gorilla/mux implements a request router and dispatcher.
_workspace/src/github.com/gorilla/websocket
Package websocket implements the WebSocket protocol defined in RFC 6455.
Package websocket implements the WebSocket protocol defined in RFC 6455.
_workspace/src/github.com/gorilla/websocket/examples/autobahn
Command server is a test server for the Autobahn WebSockets Test Suite.
Command server is a test server for the Autobahn WebSockets Test Suite.
_workspace/src/github.com/nu7hatch/gouuid
This package provides immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122.
This package provides immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122.
examples

Jump to

Keyboard shortcuts

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