Versions in this module Expand all Collapse all v0 v0.4.0 Dec 10, 2018 Changes in this version + var ErrBrokenPipe = errors.New("broken low-level pipe") + var ErrBufferExceed = errors.New("session send buffer exceed") + var ErrCloseClosedGroup = errors.New("close closed group") + var ErrCloseClosedSession = errors.New("close closed session") + var ErrClosedGroup = errors.New("group closed") + var ErrMemberNotFound = errors.New("member not found in the group") + var ErrSessionDuplication = errors.New("session has existed in the current group") + var ErrSessionOnNotify = errors.New("current session working on notify mode") + var VERSION = "0.0.1" + func EnableDebug() + func Invoke(fn func()) + func Listen(addr string, opts ...Option) + func ListenWS(addr string, opts ...Option) + func Register(c component.Component, options ...component.Option) + func SetCheckOriginFunc(fn func(*http.Request) bool) + func SetDictionary(dict map[string]uint16) + func SetHeartbeatInterval(d time.Duration) + func SetLogger(l Logger) + func SetSerializer(seri serialize.Serializer) + func SetTimerPrecision(precision time.Duration) + func SetWSPath(path string) + func Shutdown() + type Group struct + func NewGroup(n string) *Group + func (c *Group) Add(session *session.Session) error + func (c *Group) Broadcast(route string, v interface{}) error + func (c *Group) Close() error + func (c *Group) Contains(uid int64) bool + func (c *Group) Count() int + func (c *Group) Leave(s *session.Session) error + func (c *Group) LeaveAll() error + func (c *Group) Member(uid int64) (*session.Session, error) + func (c *Group) Members() []int64 + func (c *Group) Multicast(route string, v interface{}, filter SessionFilter) error + type Logger interface + Fatal func(v ...interface{}) + Println func(v ...interface{}) + type Message struct + type Option func(*options) + func WithPipeline(pipeline Pipeline) Option + type Pipeline interface + Inbound func() PipelineChannel + Outbound func() PipelineChannel + func NewPipeline() Pipeline + type PipelineChannel interface + Process func(s *session.Session, msg Message) error + PushBack func(h PipelineFunc) + PushFront func(h PipelineFunc) + type PipelineFunc func(s *session.Session, msg Message) error + type SessionFilter func(*session.Session) bool + type Timer struct + func NewAfterTimer(duration time.Duration, fn TimerFunc) *Timer + func NewCondTimer(condition TimerCondition, fn TimerFunc) *Timer + func NewCountTimer(interval time.Duration, count int, fn TimerFunc) *Timer + func NewTimer(interval time.Duration, fn TimerFunc) *Timer + func (t *Timer) ID() int64 + func (t *Timer) Stop() + type TimerCondition interface + Check func(now time.Time) bool + type TimerFunc func()