Documentation ¶
Index ¶
- Variables
- func ConnectServer(addr string, clientConn proto.ClientConnection) error
- func Router(pattern string, si interface{}, method string)
- func StartServer(addr string, connListener proto.Connection, tcpServer *TcpServer) error
- type BaseRouter
- type Context
- func (this *Context) AddDelayRequest(request *models.PushRequest, delay time.Duration)
- func (this *Context) AddPushRequest(request *models.PushRequest)
- func (this *Context) GetUserId() int64
- func (this *Context) SendPushRequest()
- func (this *Context) SetPushFunc(pushFunc func(*models.PushRequest))
- func (this *Context) SetUserId(otherId int64)
- type ServiceRegister
- type TcpServer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
RouteHandler = NewServiceRegister()
)
Functions ¶
func ConnectServer ¶
func ConnectServer(addr string, clientConn proto.ClientConnection) error
func StartServer ¶
func StartServer(addr string, connListener proto.Connection, tcpServer *TcpServer) error
Types ¶
type BaseRouter ¶
type BaseRouter interface {
InitContext(ctx *Context)
}
type Context ¶
type Context struct { SessionUniqueKey string // contains filtered or unexported fields }
func NewContext ¶
func (*Context) AddDelayRequest ¶
func (this *Context) AddDelayRequest(request *models.PushRequest, delay time.Duration)
func (*Context) AddPushRequest ¶
func (this *Context) AddPushRequest(request *models.PushRequest)
func (*Context) SendPushRequest ¶
func (this *Context) SendPushRequest()
func (*Context) SetPushFunc ¶
func (this *Context) SetPushFunc(pushFunc func(*models.PushRequest))
type ServiceRegister ¶
type ServiceRegister struct {
// contains filtered or unexported fields
}
func NewServiceRegister ¶
func NewServiceRegister() *ServiceRegister
type TcpServer ¶
type TcpServer struct {
// contains filtered or unexported fields
}
func NewTcpServer ¶
func NewTcpServer() *TcpServer
func (*TcpServer) DeleteSession ¶
func (*TcpServer) GetSession ¶
func (this *TcpServer) GetSession(uniqueKey string) *proto.TcpSession
func (*TcpServer) GetUniqueKeys ¶
func (*TcpServer) PutSession ¶
func (this *TcpServer) PutSession(uniqueKey string, session *proto.TcpSession)
func (*TcpServer) SessionCount ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.