mirror of
https://github.com/cadmium-im/zirconium-go.git
synced 2024-11-23 19:02:20 +00:00
22 lines
382 B
Go
22 lines
382 B
Go
|
package core
|
||
|
|
||
|
import (
|
||
|
"github.com/cadmium-im/zirconium-go/core/models"
|
||
|
"github.com/gorilla/websocket"
|
||
|
)
|
||
|
|
||
|
type Session struct {
|
||
|
wsConn *websocket.Conn
|
||
|
connID string
|
||
|
entityID []*models.EntityID
|
||
|
deviceID *string
|
||
|
}
|
||
|
|
||
|
func (s *Session) Send(message models.BaseMessage) error {
|
||
|
return s.wsConn.WriteJSON(message)
|
||
|
}
|
||
|
|
||
|
func (s *Session) Close() error {
|
||
|
return s.wsConn.Close()
|
||
|
}
|