cherryCluster

package
v1.1.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 20 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCloseSessionSubject added in v1.1.17

func GetCloseSessionSubject() string

GetCloseSessionSubject 关闭Session主题 publish-subscribe (每个集群节点订阅)

cherry.close_session

func GetKickSubject added in v1.1.17

func GetKickSubject(nodeType string, nodeId string) string

GetKickSubject 踢用户下线主题 publish-subscribe (仅前端节点订阅)

cherry.kick.{node_type}.{node_id}

func GetLocalSubject added in v1.1.17

func GetLocalSubject(nodeType string, nodeId string) string

GetLocalSubject 本地消息主题 publish-subscribe (每个集群节点订阅)

cherry.local.{node_type}.{node_id}

func GetPushSubject added in v1.1.17

func GetPushSubject(nodeType string, nodeId string) string

GetPushSubject 推送给客户端主题 publish-subscribe (仅前端节点订阅)

cherry.push.{node_type}.{node_id}

func GetRemoteSubject added in v1.1.17

func GetRemoteSubject(nodeType string, nodeId string) string

GetRemoteSubject 远程消息主题 request-reply (每个集群节点订阅)

cherry.remote.{node_type}.{node_id}

Types

type Component added in v1.1.1

type Component struct {
	facade.Component
	// contains filtered or unexported fields
}

func NewComponent added in v1.1.5

func NewComponent(handlerComponent *cherryHandler.Component) *Component

func (*Component) Client added in v1.1.17

func (c *Component) Client() facade.RPCClient

func (*Component) ForwardLocal added in v1.1.17

func (c *Component) ForwardLocal(session *cherrySession.Session, msg *cherryMessage.Message)

func (*Component) ForwardRemote added in v1.1.17

func (c *Component) ForwardRemote(route string, val interface{}, timeout time.Duration) *cherryProto.Response

func (*Component) Init added in v1.1.5

func (c *Component) Init()

func (*Component) Name added in v1.1.5

func (c *Component) Name() string

func (*Component) OnStop added in v1.1.5

func (c *Component) OnStop()

func (*Component) RPCAsyncToNode added in v1.1.17

func (c *Component) RPCAsyncToNode(nodeId string, route string, arg proto.Message)

func (*Component) RPCToNode added in v1.1.17

func (c *Component) RPCToNode(nodeId string, route string, reply proto.Message, arg proto.Message, timeout ...time.Duration) error

func (*Component) SendKickUser added in v1.1.9

func (c *Component) SendKickUser(nodeId string, message *cherryProto.KickMessage)

func (*Component) SendPushToUser added in v1.1.9

func (c *Component) SendPushToUser(nodeId string, message *cherryProto.PushMessage)

func (*Component) Server added in v1.1.17

func (c *Component) Server() facade.RPCServer

type NatsRPCClient added in v1.1.17

type NatsRPCClient struct {
	cherryFacade.IApplication
	// contains filtered or unexported fields
}

func NewNatsRPCClient added in v1.1.17

func NewNatsRPCClient(conn *nats.Conn, natsConfig *cherryProfile.NatsConfig) *NatsRPCClient

func (*NatsRPCClient) CallAsyncRemote added in v1.1.17

func (n *NatsRPCClient) CallAsyncRemote(nodeId string, message *cherryProto.RemoteMessage)

func (*NatsRPCClient) CallLocal added in v1.1.17

func (n *NatsRPCClient) CallLocal(nodeId string, message *cherryProto.LocalMessage) error

func (*NatsRPCClient) CallRemote added in v1.1.17

func (n *NatsRPCClient) CallRemote(nodeId string, message *cherryProto.RemoteMessage, timeout time.Duration) *cherryProto.Response

func (*NatsRPCClient) Init added in v1.1.17

func (*NatsRPCClient) OnStop added in v1.1.17

func (n *NatsRPCClient) OnStop()

func (*NatsRPCClient) Send added in v1.1.17

func (n *NatsRPCClient) Send(route string, data []byte) error

func (*NatsRPCClient) SendKick added in v1.1.17

func (*NatsRPCClient) SendPush added in v1.1.17

type NatsRPCServer added in v1.1.17

type NatsRPCServer struct {
	cherryFacade.IApplication
	// contains filtered or unexported fields
}

func NewRpcServer added in v1.1.17

func NewRpcServer(handler *cherryHandler.Component, conn *nats.Conn, rpcClient cherryFacade.RPCClient) *NatsRPCServer

func (*NatsRPCServer) Init added in v1.1.17

func (*NatsRPCServer) OnStop added in v1.1.17

func (n *NatsRPCServer) OnStop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL