Exemplo n.º 1
0
func NewPacketInjectorClient(w *shttp.WSServer) *PacketInjectorClient {
	pic := &PacketInjectorClient{
		WSServer:  w,
		replyChan: make(map[string]chan *json.RawMessage),
	}
	w.AddEventHandler(pic)

	return pic
}
Exemplo n.º 2
0
func NewTableClient(w *shttp.WSServer) *TableClient {
	tc := &TableClient{
		WSServer:  w,
		replyChan: make(map[string]chan *json.RawMessage),
	}
	w.AddEventHandler(tc)

	return tc
}
Exemplo n.º 3
0
func NewServer(a *AlertManager, server *shttp.WSServer) *AlertServer {
	s := &AlertServer{
		AlertManager: a,
		WSServer:     server,
		clients:      make(map[*shttp.WSClient]*alertClient),
	}
	server.AddEventHandler(s)

	return s
}
Exemplo n.º 4
0
func NewServer(g *Graph, server *shttp.WSServer) *GraphServer {
	s := &GraphServer{
		Graph:    g,
		WSServer: server,
	}
	s.Graph.AddEventListener(s)
	server.AddEventHandler(s)

	return s
}