From 7b578c4fb456e75257493c41a8b078ef87a263b6 Mon Sep 17 00:00:00 2001 From: claudemiro Date: Mon, 2 Feb 2015 14:12:11 -0300 Subject: [PATCH] Added Created at to connection. --- ipe/connection.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ipe/connection.go b/ipe/connection.go index 648bf7b..01a03b0 100644 --- a/ipe/connection.go +++ b/ipe/connection.go @@ -5,21 +5,24 @@ package ipe import ( + "time" + log "github.com/golang/glog" "github.com/gorilla/websocket" ) // An User Connection type connection struct { - SocketID string - Socket *websocket.Conn + SocketID string + Socket *websocket.Conn + CreatedAt time.Time } // Create a new Subscriber func newConnection(socketID string, s *websocket.Conn) *connection { log.Infof("Creating a new Subscriber %+v", socketID) - return &connection{SocketID: socketID, Socket: s} + return &connection{SocketID: socketID, Socket: s, CreatedAt: time.Now()} } // Publish the message to websocket atached to this client