Documentation ¶
Index ¶
- func DefaultQueueHash(executor IExecutor, queueNum int) int
- type Component
- func (c *Component) AddAfterFilter(afterFilters ...FilterFn)
- func (c *Component) AddBeforeFilter(beforeFilters ...FilterFn)
- func (c *Component) Init()
- func (c *Component) Name() string
- func (c *Component) OnAfterInit()
- func (c *Component) OnStop()
- func (c *Component) PostEvent(event facade.IEvent)
- func (c *Component) PostMessage(session *cherrySession.Session, msg *cherryMessage.Message)
- func (c *Component) Register(handlerGroup *HandlerGroup)
- func (c *Component) Register2Group(handler ...facade.IHandler)
- type EventExecutor
- type FilterFn
- type Handler
- func (h *Handler) AddAfterFilter(afterFilters ...FilterFn)
- func (h *Handler) AddBeforeFilter(beforeFilters ...FilterFn)
- func (h *Handler) AddEvent(eventName string, fn facade.EventFunc)
- func (h *Handler) AddLocal(name string, fn interface{})
- func (h *Handler) AddLocals(localFns ...interface{})
- func (h *Handler) AddRemote(name string, fn interface{})
- func (h *Handler) AddRemotes(remoteFns ...interface{})
- func (h *Handler) Component() *Component
- func (h *Handler) Event(name string) ([]facade.EventFunc, bool)
- func (h *Handler) Events() map[string][]facade.EventFunc
- func (h *Handler) LocalHandler(funcName string) (*facade.HandlerFn, bool)
- func (h *Handler) LocalHandlers() map[string]*facade.HandlerFn
- func (h *Handler) Name() string
- func (h *Handler) OnAfterInit()
- func (h *Handler) OnInit()
- func (h *Handler) OnPreInit()
- func (h *Handler) OnStop()
- func (h *Handler) PostEvent(e facade.IEvent)
- func (h *Handler) RemoteHandler(funcName string) (*facade.HandlerFn, bool)
- func (h *Handler) RemoteHandlers() map[string]*facade.HandlerFn
- func (h *Handler) SetName(name string)
- type HandlerGroup
- type IExecutor
- type MessageExecutor
- type Option
- type Queue
- type QueueHash
- type SysRPCExecutor
- type UserRPCExecutor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultQueueHash ¶
Types ¶
type Component ¶
type Component struct { facade.Component RemoteHandler cherryAgent.RPCHandler // contains filtered or unexported fields }
Component handler component
func NewComponent ¶
func (*Component) AddAfterFilter ¶ added in v1.1.1
func (*Component) AddBeforeFilter ¶ added in v1.1.1
func (*Component) OnAfterInit ¶ added in v1.1.6
func (c *Component) OnAfterInit()
func (*Component) PostMessage ¶
func (c *Component) PostMessage(session *cherrySession.Session, msg *cherryMessage.Message)
func (*Component) Register ¶
func (c *Component) Register(handlerGroup *HandlerGroup)
func (*Component) Register2Group ¶
type EventExecutor ¶
func (*EventExecutor) Invoke ¶
func (e *EventExecutor) Invoke()
func (*EventExecutor) String ¶
func (e *EventExecutor) String() string
type FilterFn ¶
type FilterFn func(session *cherrySession.Session, message *cherryMessage.Message) bool
type Handler ¶
type Handler struct { facade.AppContext // contains filtered or unexported fields }
func (*Handler) AddAfterFilter ¶
func (*Handler) AddBeforeFilter ¶
func (*Handler) AddRemotes ¶
func (h *Handler) AddRemotes(remoteFns ...interface{})
func (*Handler) LocalHandler ¶
func (*Handler) OnAfterInit ¶
func (h *Handler) OnAfterInit()
func (*Handler) RemoteHandler ¶
type HandlerGroup ¶
type HandlerGroup struct {
// contains filtered or unexported fields
}
func NewGroup ¶
func NewGroup(queueNum, queueCap int) *HandlerGroup
func NewGroupWithHandler ¶
func NewGroupWithHandler(handlers ...facade.IHandler) *HandlerGroup
func (*HandlerGroup) AddHandlers ¶
func (h *HandlerGroup) AddHandlers(handlers ...facade.IHandler)
func (*HandlerGroup) SetQueueHash ¶
func (h *HandlerGroup) SetQueueHash(fn QueueHash)
type MessageExecutor ¶
type MessageExecutor struct { App facade.IApplication Session *cherrySession.Session Msg *cherryMessage.Message HandlerFn *facade.HandlerFn BeforeFilters []FilterFn AfterFilters []FilterFn }
func (*MessageExecutor) Invoke ¶
func (m *MessageExecutor) Invoke()
func (*MessageExecutor) String ¶
func (m *MessageExecutor) String() string
type Option ¶ added in v1.1.1
type Option func(options *options)
func WithAfterFilter ¶ added in v1.1.1
func WithBeforeFilter ¶ added in v1.1.1
func WithNameFunc ¶ added in v1.1.1
func WithPrintRouteLog ¶ added in v1.1.1
type SysRPCExecutor ¶
func (*SysRPCExecutor) Invoke ¶
func (s *SysRPCExecutor) Invoke()
func (*SysRPCExecutor) String ¶
func (s *SysRPCExecutor) String() string
type UserRPCExecutor ¶
func (*UserRPCExecutor) Invoke ¶
func (u *UserRPCExecutor) Invoke()
func (*UserRPCExecutor) String ¶
func (u *UserRPCExecutor) String() string
Click to show internal directories.
Click to hide internal directories.