Documentation ¶
Index ¶
- func NewLib() listener.Listener
- type Listener
- func (c *Listener) AddOrSkip(l *listenerproto.RouterListener, h http.HandlerFunc)
- func (c *Listener) AddOrSkipTcp(l *listenerproto.RouterListener, h interfaces.TcpHandler)
- func (c *Listener) NewHTTPListener(s *listenerproto.RouterListener, h http.HandlerFunc)
- func (c *Listener) NewTCPListener(s *listenerproto.RouterListener, h interfaces.TcpHandler)
- func (c *Listener) Remove(name string) error
- func (c *Listener) RemoveTcp(name string) error
- type ListenerItems
- type Modules
- func (c *Modules) GetAllServices() (res []*listenerproto.ServicesItems)
- func (c *Modules) GetInterceptor() (interceptor []listener.Interceptor)
- func (c *Modules) GetLimiter() *limiter.Limiter
- func (c *Modules) GetMonitor() (mm interface{})
- func (c *Modules) GetMonitorResponse() *listenerproto.MonitorResponse
- func (c *Modules) GetOptions() listener.Options
- func (c *Modules) GetServices() []string
- func (c *Modules) GetTracer() (tr tracing.Tracing)
- func (c *Modules) Init(opt listener.Options, interceptor ...listener.Interceptor)
- func (c *Modules) New() listener.Listener
- func (c *Modules) NewMonitor() (mm interface{})
- func (c *Modules) OnPushMessage(request *global.PushRequest, onMsg listener.OnPushMessageResponse)
- func (c *Modules) PushRouterListener(l *listenerproto.RouterListener, h httpn.HandlerFunc)
- func (c *Modules) PushRouterTcpListener(l *listenerproto.RouterListener, h listener.TcpHandler)
- func (c *Modules) RegisterHttpHandler(path, method string, handler httpn.Handler)
- func (c *Modules) RegisterMultipleHandler(handler listener.MethodMultipleHandler)
- func (c *Modules) RemoveRouterListener(name string) error
- func (c *Modules) RemoveRouterTcpListener(name string) error
- func (c *Modules) Run() (err error)
- func (c *Modules) RunRouter() (err error)
- func (c *Modules) SetMonitor(mm interface{})
- func (c *Modules) SetTracer(tr tracing.Tracing)
- func (c *Modules) UseWebSocket(pa string, onConnected listener.WebSocketHandler, ...) error
- type Router
- func (c *Router) PushRouterListener(l *listenerproto.RouterListener, h http.HandlerFunc)
- func (c *Router) PushRouterTcpListener(l *listenerproto.RouterListener, h interfaces.TcpHandler)
- func (c *Router) RemoveRouterListener(name string) error
- func (c *Router) RemoveRouterTcpListener(name string) error
- func (c *Router) Start()
- type RouterHeader
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Listener ¶
func NewListener ¶
func NewListener(listener interfaces.Listener) *Listener
func (*Listener) AddOrSkip ¶
func (c *Listener) AddOrSkip(l *listenerproto.RouterListener, h http.HandlerFunc)
func (*Listener) AddOrSkipTcp ¶ added in v1.1.2
func (c *Listener) AddOrSkipTcp(l *listenerproto.RouterListener, h interfaces.TcpHandler)
func (*Listener) NewHTTPListener ¶
func (c *Listener) NewHTTPListener(s *listenerproto.RouterListener, h http.HandlerFunc)
func (*Listener) NewTCPListener ¶ added in v1.1.2
func (c *Listener) NewTCPListener(s *listenerproto.RouterListener, h interfaces.TcpHandler)
type ListenerItems ¶
type ListenerItems struct {
// contains filtered or unexported fields
}
func (*ListenerItems) Add ¶ added in v1.1.3
func (c *ListenerItems) Add(cw int64)
func (*ListenerItems) Count ¶ added in v1.1.3
func (c *ListenerItems) Count() int
func (*ListenerItems) OnStateChange ¶ added in v1.1.3
func (c *ListenerItems) OnStateChange(conn net.Conn, state http.ConnState)
type Modules ¶
func (*Modules) GetAllServices ¶
func (c *Modules) GetAllServices() (res []*listenerproto.ServicesItems)
func (*Modules) GetInterceptor ¶ added in v0.0.7
func (c *Modules) GetInterceptor() (interceptor []listener.Interceptor)
func (*Modules) GetLimiter ¶ added in v1.1.3
func (*Modules) GetMonitor ¶
func (c *Modules) GetMonitor() (mm interface{})
func (*Modules) GetMonitorResponse ¶ added in v1.1.0
func (c *Modules) GetMonitorResponse() *listenerproto.MonitorResponse
func (*Modules) GetOptions ¶
func (*Modules) GetServices ¶
func (*Modules) Init ¶
func (c *Modules) Init(opt listener.Options, interceptor ...listener.Interceptor)
func (*Modules) NewMonitor ¶ added in v1.1.0
func (c *Modules) NewMonitor() (mm interface{})
func (*Modules) OnPushMessage ¶
func (c *Modules) OnPushMessage(request *global.PushRequest, onMsg listener.OnPushMessageResponse)
func (*Modules) PushRouterListener ¶
func (c *Modules) PushRouterListener(l *listenerproto.RouterListener, h httpn.HandlerFunc)
func (*Modules) PushRouterTcpListener ¶ added in v1.1.2
func (c *Modules) PushRouterTcpListener(l *listenerproto.RouterListener, h listener.TcpHandler)
func (*Modules) RegisterHttpHandler ¶ added in v0.0.11
func (*Modules) RegisterMultipleHandler ¶
func (c *Modules) RegisterMultipleHandler(handler listener.MethodMultipleHandler)
func (*Modules) RemoveRouterListener ¶ added in v1.1.0
func (*Modules) RemoveRouterTcpListener ¶ added in v1.1.2
func (*Modules) SetMonitor ¶ added in v1.1.0
func (c *Modules) SetMonitor(mm interface{})
func (*Modules) UseWebSocket ¶ added in v0.0.10
func (c *Modules) UseWebSocket(pa string, onConnected listener.WebSocketHandler, onMsg listener.WebSocketHandlerOnMsg, onDisconnected listener.WebSocketHandler) error
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter(listener interfaces.Listener) *Router
func (*Router) PushRouterListener ¶
func (c *Router) PushRouterListener(l *listenerproto.RouterListener, h http.HandlerFunc)
func (*Router) PushRouterTcpListener ¶ added in v1.1.2
func (c *Router) PushRouterTcpListener(l *listenerproto.RouterListener, h interfaces.TcpHandler)
func (*Router) RemoveRouterListener ¶ added in v1.1.0
func (*Router) RemoveRouterTcpListener ¶ added in v1.1.2
type RouterHeader ¶
type RouterHeader struct {
LimiterID string
}
Click to show internal directories.
Click to hide internal directories.