Versions in this module Expand all Collapse all v0 v0.0.1 Oct 12, 2022 Changes in this version + const Name + type Component struct + func NewComponent(opts ...Option) *Component + func (c *Component) AddAfterFilter(afterFilters ...FilterFn) + func (c *Component) AddBeforeFilter(beforeFilters ...FilterFn) + func (c *Component) GetHandler(handlerName string) (*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 *csession.Session, msg *cmsg.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 Executor struct + func (p *Executor) Index() int + func (p *Executor) SetIndex(index int) + type ExecutorEvent struct + func (p *ExecutorEvent) Event() cfacade.IEvent + func (p *ExecutorEvent) Invoke() + func (p *ExecutorEvent) QueueHash(queueNum int) int + type ExecutorLocal struct + func (p *ExecutorLocal) Context() context.Context + func (p *ExecutorLocal) Invoke() + func (p *ExecutorLocal) Message() *cmsg.Message + func (p *ExecutorLocal) QueueHash(queueNum int) int + func (p *ExecutorLocal) Session() *csession.Session + type ExecutorRemote struct + func (p *ExecutorRemote) Data() []byte + func (p *ExecutorRemote) Invoke() + func (p *ExecutorRemote) QueueHash(queueNum int) int + func (p *ExecutorRemote) Route() *cmessage.Route + func (p *ExecutorRemote) UnmarshalData() (interface{}, error) + type FilterFn func(ctx context.Context, session *csession.Session, message *cmsg.Message) bool + type Handler struct + func (h *Handler) AddAfterFilter(afterFilters ...FilterFn) + func (h *Handler) AddBeforeFilter(beforeFilters ...FilterFn) + func (h *Handler) AddEvent(eventName string, fn cfacade.EventFn, hashFn ...cfacade.QueueHashFn) + func (h *Handler) AddLocal(name string, fn interface{}, hashFn ...cfacade.QueueHashFn) + func (h *Handler) AddLocals(localFns ...interface{}) + func (h *Handler) AddRemote(name string, fn interface{}, hashFn ...cfacade.QueueHashFn) + func (h *Handler) AddRemotes(remoteFns ...interface{}) + func (h *Handler) Component() *Component + func (h *Handler) Event(name string) (*cfacade.EventInfo, bool) + func (h *Handler) Events() map[string]*cfacade.EventInfo + func (h *Handler) LocalHandler(funcName string) (*cfacade.MethodInfo, bool) + func (h *Handler) LocalHandlers() map[string]*cfacade.MethodInfo + 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.MethodInfo, bool) + func (h *Handler) RemoteHandlers() map[string]*cfacade.MethodInfo + func (h *Handler) Response(ctx context.Context, session *csession.Session, data interface{}) + func (h *Handler) SetName(name string) + type HandlerGroup struct + func NewGroup(queueNum, queueCap int) *HandlerGroup + func NewGroupWithHandler(handlers ...cfacade.IHandler) *HandlerGroup + func (h *HandlerGroup) AddHandlers(handlers ...cfacade.IHandler) + func (h *HandlerGroup) InQueue(hashFn cfacade.QueueHashFn, executor cfacade.IExecutor) + func (h *HandlerGroup) SetQueueHash(fn cfacade.QueueHashFn) + type Option func(options *options) + func WithAfterFilter(afterFilters ...FilterFn) Option + func WithBeforeFilter(beforeFilters ...FilterFn) Option + func WithNameFunc(fn func(string) string) Option + type Queue struct