Documentation
¶
Index ¶
- Constants
- type 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
- 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.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
- type Option
- type Queue
Constants ¶
View Source
const (
Name = "handler_component"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
Component handler component
func NewComponent ¶
func (*Component) AddAfterFilter ¶
func (*Component) AddBeforeFilter ¶
func (*Component) GetHandler ¶
func (*Component) OnAfterInit ¶
func (c *Component) OnAfterInit()
func (*Component) ProcessLocal ¶
func (*Component) ProcessRemote ¶
func (*Component) Register ¶
func (c *Component) Register(handlerGroup *HandlerGroup)
func (*Component) Register2Group ¶
type ExecutorEvent ¶
type ExecutorEvent struct { Executor // contains filtered or unexported fields }
func (*ExecutorEvent) Event ¶
func (p *ExecutorEvent) Event() cfacade.IEvent
func (*ExecutorEvent) Invoke ¶
func (p *ExecutorEvent) Invoke()
func (*ExecutorEvent) QueueHash ¶
func (p *ExecutorEvent) QueueHash(queueNum int) int
type ExecutorLocal ¶
type ExecutorLocal struct { Executor cfacade.IApplication // contains filtered or unexported fields }
func (*ExecutorLocal) Context ¶
func (p *ExecutorLocal) Context() context.Context
func (*ExecutorLocal) Invoke ¶
func (p *ExecutorLocal) Invoke()
func (*ExecutorLocal) Message ¶
func (p *ExecutorLocal) Message() *cmsg.Message
func (*ExecutorLocal) QueueHash ¶
func (p *ExecutorLocal) QueueHash(queueNum int) int
func (*ExecutorLocal) Session ¶
func (p *ExecutorLocal) Session() *csession.Session
type ExecutorRemote ¶
type ExecutorRemote struct { Executor cfacade.IApplication // contains filtered or unexported fields }
func (*ExecutorRemote) Data ¶
func (p *ExecutorRemote) Data() []byte
func (*ExecutorRemote) Invoke ¶
func (p *ExecutorRemote) Invoke()
func (*ExecutorRemote) QueueHash ¶
func (p *ExecutorRemote) QueueHash(queueNum int) int
func (*ExecutorRemote) Route ¶
func (p *ExecutorRemote) Route() *cmessage.Route
func (*ExecutorRemote) UnmarshalData ¶
func (p *ExecutorRemote) UnmarshalData() (interface{}, error)
type Handler ¶
type Handler struct { cfacade.AppContext // contains filtered or unexported fields }
func (*Handler) AddAfterFilter ¶
func (*Handler) AddBeforeFilter ¶
func (*Handler) AddLocal ¶
func (h *Handler) AddLocal(name string, fn interface{}, hashFn ...cfacade.QueueHashFn)
func (*Handler) AddRemote ¶
func (h *Handler) AddRemote(name string, fn interface{}, hashFn ...cfacade.QueueHashFn)
func (*Handler) AddRemotes ¶
func (h *Handler) AddRemotes(remoteFns ...interface{})
func (*Handler) LocalHandler ¶
func (h *Handler) LocalHandler(funcName string) (*cfacade.MethodInfo, bool)
func (*Handler) LocalHandlers ¶
func (h *Handler) LocalHandlers() map[string]*cfacade.MethodInfo
func (*Handler) OnAfterInit ¶
func (h *Handler) OnAfterInit()
func (*Handler) RemoteHandler ¶
func (h *Handler) RemoteHandler(funcName string) (*cfacade.MethodInfo, bool)
func (*Handler) RemoteHandlers ¶
func (h *Handler) RemoteHandlers() map[string]*cfacade.MethodInfo
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 ¶
func (h *HandlerGroup) InQueue(hashFn cfacade.QueueHashFn, executor cfacade.IExecutor)
func (*HandlerGroup) SetQueueHash ¶
func (h *HandlerGroup) SetQueueHash(fn cfacade.QueueHashFn)
type Option ¶
type Option func(options *options)
func WithAfterFilter ¶
func WithBeforeFilter ¶
func WithNameFunc ¶
Click to show internal directories.
Click to hide internal directories.