Documentation
¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Engine ¶
type Engine interface {
Send
http.Handler
GetRoom(name Uid) Room
AddRoom(name Uid) Room
Config() EngineConfig
// contains filtered or unexported methods
}
func NewEngine ¶
func NewEngine(config EngineConfig) Engine
type EngineConfig ¶
type EngineConfig interface {
OnConnection(conn Conn) (*Uid, *Uid)
OnSubscriberDisconnect(subscriber Subscriber)
OnMessage(subscriber Subscriber, data Message)
NewDecoder(reader *bufio.Reader) Decoder
GetConnType(r *http.Request) ConnType
GetLpDropTime(subscriber Subscriber) time.Duration
GetLpWaitTime(subscriber Subscriber) time.Duration
}
type Room ¶
type Room interface {
Object
Join(client Subscriber)
Remove(client Subscriber)
Subscribers() *map[Uid]Subscriber
// contains filtered or unexported methods
}
type Subscriber ¶
Click to show internal directories.
Click to hide internal directories.