Documentation
¶
Index ¶
- type Client
- type Context
- func (c *Context) Bind(uid int64) error
- func (c *Context) CID() int64
- func (c *Context) Context() context.Context
- func (c *Context) Data() interface{}
- func (c *Context) Parse(v interface{}) (err error)
- func (c *Context) Proxy() *Proxy
- func (c *Context) Push(message *Message) error
- func (c *Context) Route() int32
- func (c *Context) Seq() int32
- func (c *Context) UID() int64
- func (c *Context) Unbind() error
- type EventHandler
- type Message
- type Option
- type Proxy
- func (p *Proxy) AddEventListener(event cluster.Event, handler EventHandler)
- func (p *Proxy) AddRouteHandler(route int32, handler RouteHandler)
- func (p *Proxy) Bind(uid int64) error
- func (p *Proxy) Disconnect() error
- func (p *Proxy) GetClientID() string
- func (p *Proxy) Push(message *Message) error
- func (p *Proxy) Reconnect() error
- func (p *Proxy) SetDefaultRouteHandler(handler RouteHandler)
- func (p *Proxy) Unbind() error
- type RouteHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler func(proxy *Proxy)
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
func (*Proxy) AddEventListener ¶
func (p *Proxy) AddEventListener(event cluster.Event, handler EventHandler)
AddEventListener 添加事件监听器
func (*Proxy) AddRouteHandler ¶
func (p *Proxy) AddRouteHandler(route int32, handler RouteHandler)
AddRouteHandler 添加路由处理器
func (*Proxy) SetDefaultRouteHandler ¶
func (p *Proxy) SetDefaultRouteHandler(handler RouteHandler)
SetDefaultRouteHandler 设置默认路由处理器,所有未注册的路由均走默认路由处理器
type RouteHandler ¶
type RouteHandler func(ctx *Context)
Click to show internal directories.
Click to hide internal directories.