Documentation ¶
Index ¶
- type ServerBalancer
- func (b *ServerBalancer) AfterInit(s *rpc.ServerBase)
- func (b *ServerBalancer) Balance(remoteAddr string) (*treaty.Server, error)
- func (b *ServerBalancer) BeforeShutdown(s *rpc.ServerBase)
- func (b *ServerBalancer) HandleBalance(w http.ResponseWriter, r *http.Request)
- func (b *ServerBalancer) Init(s *rpc.ServerBase)
- func (b *ServerBalancer) Shutdown(s *rpc.ServerBase)
- func (b *ServerBalancer) WriteResponse(w http.ResponseWriter, msg proto.Message)
- type ServerConnector
- type ServerHttp
- type ServerSocket
- func (b *ServerSocket) AfterInit(s *rpc.ServerBase)
- func (b *ServerSocket) BeforeShutdown(s *rpc.ServerBase)
- func (b *ServerSocket) Init(s *rpc.ServerBase)
- func (b *ServerSocket) OnConnect(f func(socketio.Conn) error)
- func (b *ServerSocket) OnDisconnect(f func(socketio.Conn, string))
- func (b *ServerSocket) OnError(f func(socketio.Conn, error))
- func (b *ServerSocket) OnEvent(event string, f interface{})
- func (b *ServerSocket) Run(s *rpc.ServerBase)
- func (b *ServerSocket) Shutdown(s *rpc.ServerBase)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServerBalancer ¶
type ServerBalancer struct { ClientServer *http.Server ClientCoder serialize.Serializer }
func NewServerBalancer ¶
func NewServerBalancer() *ServerBalancer
func (*ServerBalancer) AfterInit ¶
func (b *ServerBalancer) AfterInit(s *rpc.ServerBase)
func (*ServerBalancer) Balance ¶
func (b *ServerBalancer) Balance(remoteAddr string) (*treaty.Server, error)
func (*ServerBalancer) BeforeShutdown ¶
func (b *ServerBalancer) BeforeShutdown(s *rpc.ServerBase)
func (*ServerBalancer) HandleBalance ¶
func (b *ServerBalancer) HandleBalance(w http.ResponseWriter, r *http.Request)
func (*ServerBalancer) Init ¶
func (b *ServerBalancer) Init(s *rpc.ServerBase)
func (*ServerBalancer) Shutdown ¶
func (b *ServerBalancer) Shutdown(s *rpc.ServerBase)
func (*ServerBalancer) WriteResponse ¶
func (b *ServerBalancer) WriteResponse(w http.ResponseWriter, msg proto.Message)
type ServerConnector ¶
type ServerConnector struct { ClientServer tcpface.IServer //client server RouteHandler func(s tcpface.IServer) //注册路由 }
func NewServerConnector ¶
func NewServerConnector() *ServerConnector
func (*ServerConnector) AfterInit ¶
func (b *ServerConnector) AfterInit(s *rpc.ServerBase)
func (*ServerConnector) BeforeShutdown ¶
func (b *ServerConnector) BeforeShutdown(s *rpc.ServerBase)
func (*ServerConnector) Init ¶
func (b *ServerConnector) Init(s *rpc.ServerBase)
func (*ServerConnector) Shutdown ¶
func (b *ServerConnector) Shutdown(s *rpc.ServerBase)
type ServerHttp ¶
type ServerHttp struct {
// contains filtered or unexported fields
}
func NewServerHttp ¶
func NewServerHttp(h rpc.HttpHandler) *ServerHttp
func (*ServerHttp) AfterInit ¶
func (b *ServerHttp) AfterInit(s *rpc.ServerBase)
func (*ServerHttp) BeforeShutdown ¶
func (b *ServerHttp) BeforeShutdown(s *rpc.ServerBase)
func (*ServerHttp) Init ¶
func (b *ServerHttp) Init(s *rpc.ServerBase)
func (*ServerHttp) Run ¶
func (b *ServerHttp) Run(s *rpc.ServerBase)
func (*ServerHttp) Shutdown ¶
func (b *ServerHttp) Shutdown(s *rpc.ServerBase)
type ServerSocket ¶
type ServerSocket struct {
// contains filtered or unexported fields
}
func NewServerSocket ¶
func NewServerSocket(ns string, opts *engineio.Options) *ServerSocket
func (*ServerSocket) AfterInit ¶
func (b *ServerSocket) AfterInit(s *rpc.ServerBase)
func (*ServerSocket) BeforeShutdown ¶
func (b *ServerSocket) BeforeShutdown(s *rpc.ServerBase)
func (*ServerSocket) Init ¶
func (b *ServerSocket) Init(s *rpc.ServerBase)
func (*ServerSocket) OnDisconnect ¶
func (b *ServerSocket) OnDisconnect(f func(socketio.Conn, string))
func (*ServerSocket) OnEvent ¶
func (b *ServerSocket) OnEvent(event string, f interface{})
func (*ServerSocket) Run ¶
func (b *ServerSocket) Run(s *rpc.ServerBase)
func (*ServerSocket) Shutdown ¶
func (b *ServerSocket) Shutdown(s *rpc.ServerBase)
Click to show internal directories.
Click to hide internal directories.