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) DoMessage(session *cherrySession.Session, msg *cherryMessage.Message)
- func (c *Component) Init()
- func (c *Component) LocalProcess(session *cherrySession.Session, msg *cherryMessage.Message)
- func (c *Component) Name() string
- func (c *Component) OnAfterInit()
- func (c *Component) OnStop()
- func (c *Component) PostEvent(event facade.IEvent)
- func (c *Component) Register(handlerGroup *HandlerGroup)
- func (c *Component) Register2Group(handler ...facade.IHandler)
- func (c *Component) RemoteProcess(msg *cherryProto2.RemoteMessage)
- 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 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 Option
- type Queue
- type QueueHash
- type RemoteHandler
- type ServiceBackend
- func (c *ServiceBackend) CloseSession(_ context.Context, sessionId *cherryProto2.Session) (*cherryProto2.Response, error)
- func (c *ServiceBackend) KickUser(_ context.Context, msg *cherryProto2.KickMessage) (*cherryProto2.Response, error)
- func (c *ServiceBackend) LocalHandle(_ context.Context, msg *cherryProto2.LocalMessage) (*cherryProto2.Response, error)
- func (c *ServiceBackend) PushToUser(_ context.Context, msg *cherryProto2.PushMessage) (*cherryProto2.Response, error)
- func (c *ServiceBackend) RemoteHandle(_ context.Context, msg *cherryProto2.RemoteMessage) (*cherryProto2.Response, error)
- type ServiceFrontend
- func (c *ServiceFrontend) CloseSession(_ context.Context, sessionId *cherryProto2.Session) (*cherryProto2.Response, error)
- func (c *ServiceFrontend) KickUser(_ context.Context, msg *cherryProto2.KickMessage) (*cherryProto2.Response, error)
- func (c *ServiceFrontend) LocalHandle(_ context.Context, msg *cherryProto2.LocalMessage) (*cherryProto2.Response, error)
- func (c *ServiceFrontend) PushToUser(_ context.Context, msg *cherryProto2.PushMessage) (*cherryProto2.Response, error)
- func (c *ServiceFrontend) RemoteHandle(_ context.Context, msg *cherryProto2.RemoteMessage) (*cherryProto2.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultQueueHash ¶
Types ¶
type Component ¶
type Component struct { facade.Component RemoteHandler RemoteHandler // 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) DoMessage ¶ added in v1.1.9
func (c *Component) DoMessage(session *cherrySession.Session, msg *cherryMessage.Message)
func (*Component) LocalProcess ¶ added in v1.1.9
func (c *Component) LocalProcess(session *cherrySession.Session, msg *cherryMessage.Message)
func (*Component) OnAfterInit ¶ added in v1.1.6
func (c *Component) OnAfterInit()
func (*Component) Register ¶
func (c *Component) Register(handlerGroup *HandlerGroup)
func (*Component) Register2Group ¶
func (*Component) RemoteProcess ¶ added in v1.1.9
func (c *Component) RemoteProcess(msg *cherryProto2.RemoteMessage)
type ExecutorEvent ¶ added in v1.1.9
func (*ExecutorEvent) Invoke ¶ added in v1.1.9
func (e *ExecutorEvent) Invoke()
func (*ExecutorEvent) String ¶ added in v1.1.9
func (e *ExecutorEvent) String() string
type ExecutorLocal ¶ added in v1.1.9
type ExecutorLocal struct { facade.IApplication Session *cherrySession.Session Msg *cherryMessage.Message HandlerFn *facade.HandlerFn BeforeFilters []FilterFn AfterFilters []FilterFn }
func (*ExecutorLocal) Invoke ¶ added in v1.1.9
func (m *ExecutorLocal) Invoke()
func (*ExecutorLocal) String ¶ added in v1.1.9
func (m *ExecutorLocal) String() string
type ExecutorRemote ¶ added in v1.1.9
type ExecutorRemote struct { facade.IApplication HandlerFn *facade.HandlerFn Msg *cherryProto2.RemoteMessage }
func (*ExecutorRemote) Invoke ¶ added in v1.1.9
func (r *ExecutorRemote) Invoke()
func (*ExecutorRemote) String ¶ added in v1.1.9
func (r *ExecutorRemote) String() string
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 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 RemoteHandler ¶ added in v1.1.9
type RemoteHandler func(session *cherrySession.Session, msg *cherryMessage.Message)
type ServiceBackend ¶ added in v1.1.9
type ServiceBackend struct { cherryFacade.IApplication ClusterComponent *cherryCluster.Component HandlerComponent *Component }
ServiceBackend 后端
func (*ServiceBackend) CloseSession ¶ added in v1.1.9
func (c *ServiceBackend) CloseSession(_ context.Context, sessionId *cherryProto2.Session) (*cherryProto2.Response, error)
func (*ServiceBackend) KickUser ¶ added in v1.1.9
func (c *ServiceBackend) KickUser(_ context.Context, msg *cherryProto2.KickMessage) (*cherryProto2.Response, error)
func (*ServiceBackend) LocalHandle ¶ added in v1.1.9
func (c *ServiceBackend) LocalHandle(_ context.Context, msg *cherryProto2.LocalMessage) (*cherryProto2.Response, error)
func (*ServiceBackend) PushToUser ¶ added in v1.1.9
func (c *ServiceBackend) PushToUser(_ context.Context, msg *cherryProto2.PushMessage) (*cherryProto2.Response, error)
func (*ServiceBackend) RemoteHandle ¶ added in v1.1.9
func (c *ServiceBackend) RemoteHandle(_ context.Context, msg *cherryProto2.RemoteMessage) (*cherryProto2.Response, error)
RemoteHandle 收到后端节点的remote消息
type ServiceFrontend ¶ added in v1.1.9
type ServiceFrontend struct {
HandlerComponent *Component
}
func (*ServiceFrontend) CloseSession ¶ added in v1.1.9
func (c *ServiceFrontend) CloseSession(_ context.Context, sessionId *cherryProto2.Session) (*cherryProto2.Response, error)
func (*ServiceFrontend) KickUser ¶ added in v1.1.9
func (c *ServiceFrontend) KickUser(_ context.Context, msg *cherryProto2.KickMessage) (*cherryProto2.Response, error)
func (*ServiceFrontend) LocalHandle ¶ added in v1.1.9
func (c *ServiceFrontend) LocalHandle(_ context.Context, msg *cherryProto2.LocalMessage) (*cherryProto2.Response, error)
LocalHandle 收到后端节点的request类型消息转发给客户端
func (*ServiceFrontend) PushToUser ¶ added in v1.1.9
func (c *ServiceFrontend) PushToUser(_ context.Context, msg *cherryProto2.PushMessage) (*cherryProto2.Response, error)
func (*ServiceFrontend) RemoteHandle ¶ added in v1.1.9
func (c *ServiceFrontend) RemoteHandle(_ context.Context, msg *cherryProto2.RemoteMessage) (*cherryProto2.Response, error)
RemoteHandle 收到后端节点的remote消息
Click to show internal directories.
Click to hide internal directories.