20 lines
246 B
Go
20 lines
246 B
Go
|
package service
|
||
|
|
||
|
import (
|
||
|
"github.com/gorilla/websocket"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type Session struct {
|
||
|
Conn *websocket.Conn
|
||
|
Time time.Time
|
||
|
}
|
||
|
|
||
|
func NewSession(conn *websocket.Conn) *Session {
|
||
|
s := &Session{
|
||
|
Conn: conn,
|
||
|
Time: time.Now(),
|
||
|
}
|
||
|
return s
|
||
|
}
|