Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitOtServer ¶
func InitOtServer()
Types ¶
type ConnEvent ¶
type ConnEvent struct { Conn *Connection *Event }
type Connection ¶
func NewConnection ¶
func NewConnection(session *Session, ws *websocket.Conn) *Connection
func (*Connection) Broadcast ¶
func (c *Connection) Broadcast(msg *Event)
func (*Connection) Handle ¶
func (c *Connection) Handle() error
func (*Connection) ReadEvent ¶
func (c *Connection) ReadEvent() (*Event, error)
func (*Connection) Send ¶
func (c *Connection) Send(msg *Event) error
type Session ¶
type Session struct { Connections map[*Connection]struct{} EventChan chan ConnEvent *ot.Session // contains filtered or unexported fields }
func NewSession ¶
func (*Session) HandleEvents ¶
func (s *Session) HandleEvents()
func (*Session) RegisterConnection ¶
func (s *Session) RegisterConnection(c *Connection)
func (*Session) UnRegisterConnection ¶
func (s *Session) UnRegisterConnection(c *Connection)
Click to show internal directories.
Click to hide internal directories.