peer.go 246 B

12345678910111213141516171819
  1. package service
  2. import (
  3. "github.com/gorilla/websocket"
  4. "time"
  5. )
  6. type Session struct {
  7. Conn *websocket.Conn
  8. Time time.Time
  9. }
  10. func NewSession(conn *websocket.Conn) *Session {
  11. s := &Session{
  12. Conn: conn,
  13. Time: time.Now(),
  14. }
  15. return s
  16. }