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) GetHandler(route string) (*cherryMessage.Route, *HandlerGroup, cfacade.IHandler, bool)
- func (c *Component) Init()
- func (c *Component) Name() string
- func (c *Component) OnAfterInit()
- func (c *Component) OnStop()
- func (c *Component) PostEvent(event cfacade.IEvent)
- func (c *Component) ProcessLocal(session *cherrySession.Session, msg *cherryMessage.Message)
- func (c *Component) ProcessRemote(route string, data []byte, natsMsg *nats.Msg) int32
- func (c *Component) Register(handlerGroup *HandlerGroup)
- func (c *Component) Register2Group(handler ...cfacade.IHandler)
- type ExecutorEvent
- type ExecutorLocal
- type ExecutorRemote
- type FilterFn
- type Handler
- func (h *Handler) AddAfterFilter(afterFilters ...FilterFn)
- func (h *Handler) AddBeforeFilter(beforeFilters ...FilterFn)
- func (h *Handler) AddEvent(eventName string, fn cfacade.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) ([]cfacade.EventFunc, bool)
- func (h *Handler) Events() map[string][]cfacade.EventFunc
- func (h *Handler) LocalHandler(funcName string) (*cfacade.HandlerFn, bool)
- func (h *Handler) LocalHandlers() map[string]*cfacade.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 cfacade.IEvent)
- func (h *Handler) RemoteHandler(funcName string) (*cfacade.HandlerFn, bool)
- func (h *Handler) RemoteHandlers() map[string]*cfacade.HandlerFn
- func (h *Handler) Response(ctx context.Context, session *csession.Session, data interface{})
- func (h *Handler) SetName(name string)
- type HandlerGroup
- type IExecutor
- type Option
- type Queue
- type QueueHashFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultQueueHash ¶
Types ¶
type Component ¶
Component handler component
func NewComponent ¶
func (*Component) AddAfterFilter ¶ added in v1.1.1
func (*Component) AddBeforeFilter ¶ added in v1.1.1
func (*Component) GetHandler ¶ added in v1.1.17
func (*Component) OnAfterInit ¶ added in v1.1.6
func (c *Component) OnAfterInit()
func (*Component) ProcessLocal ¶ added in v1.1.17
func (c *Component) ProcessLocal(session *cherrySession.Session, msg *cherryMessage.Message)
func (*Component) ProcessRemote ¶ added in v1.1.17
func (*Component) Register ¶
func (c *Component) Register(handlerGroup *HandlerGroup)
func (*Component) Register2Group ¶
type ExecutorEvent ¶ added in v1.1.9
type ExecutorEvent struct {
Event cfacade.IEvent
EventSlice []cfacade.EventFunc
// contains filtered or unexported fields
}
func (*ExecutorEvent) Index ¶ added in v1.1.29
func (p *ExecutorEvent) Index() int
func (*ExecutorEvent) Invoke ¶ added in v1.1.9
func (p *ExecutorEvent) Invoke()
func (*ExecutorEvent) SetIndex ¶ added in v1.1.29
func (p *ExecutorEvent) SetIndex(index int)
func (*ExecutorEvent) String ¶ added in v1.1.9
func (p *ExecutorEvent) String() string
type ExecutorLocal ¶ added in v1.1.9
type ExecutorLocal struct {
cfacade.IApplication
// contains filtered or unexported fields
}
func (*ExecutorLocal) Index ¶ added in v1.1.29
func (p *ExecutorLocal) Index() int
func (*ExecutorLocal) Invoke ¶ added in v1.1.9
func (p *ExecutorLocal) Invoke()
func (*ExecutorLocal) SetIndex ¶ added in v1.1.29
func (p *ExecutorLocal) SetIndex(index int)
func (*ExecutorLocal) String ¶ added in v1.1.9
func (p *ExecutorLocal) String() string
type ExecutorRemote ¶ added in v1.1.9
type ExecutorRemote struct {
cfacade.IApplication
// contains filtered or unexported fields
}
func NewExecutorRemote ¶ added in v1.1.29
func NewExecutorRemote(route string, data []byte, natsMsg *nats.Msg) ExecutorRemote
func (*ExecutorRemote) Index ¶ added in v1.1.29
func (p *ExecutorRemote) Index() int
func (*ExecutorRemote) Invoke ¶ added in v1.1.9
func (p *ExecutorRemote) Invoke()
func (*ExecutorRemote) SetIndex ¶ added in v1.1.29
func (p *ExecutorRemote) SetIndex(index int)
func (*ExecutorRemote) String ¶ added in v1.1.9
func (p *ExecutorRemote) String() string
type Handler ¶
type Handler struct {
cfacade.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 ...cfacade.IHandler) *HandlerGroup
func (*HandlerGroup) AddHandlers ¶
func (h *HandlerGroup) AddHandlers(handlers ...cfacade.IHandler)
func (*HandlerGroup) InQueue ¶ added in v1.1.29
func (h *HandlerGroup) InQueue(executor IExecutor)
func (*HandlerGroup) SetQueueHash ¶
func (h *HandlerGroup) SetQueueHash(fn QueueHashFn)
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
type QueueHashFn ¶ added in v1.1.29
Click to show internal directories.
Click to hide internal directories.