Documentation ¶
Index ¶
- Constants
- type CallFunc
- type Cluster
- func (c *Cluster) AddCluster(info *common.ClusterInfo)
- func (c *Cluster) BindPacketFunc(callfunc network.PacketFunc)
- func (c *Cluster) Call(parmas ...interface{})
- func (c *Cluster) CallMsg(cb interface{}, head rpc.RpcHead, funcName string, params ...interface{}) error
- func (c *Cluster) Cluster_Add(ctx context.Context, info *common.ClusterInfo)
- func (c *Cluster) Cluster_Del(ctx context.Context, info *common.ClusterInfo)
- func (c *Cluster) DelCluster(info *common.ClusterInfo)
- func (c *Cluster) GetCluster(head rpc.RpcHead) *common.ClusterInfo
- func (c *Cluster) HandlePacket(packet rpc.Packet)
- func (c *Cluster) InitCluster(info *common.ClusterInfo, endpoints []string, natsUrl string, ...)
- func (c *Cluster) IsEnoughStub(stub rpc.STUB) bool
- func (c *Cluster) RandomCluster(head rpc.RpcHead) rpc.RpcHead
- func (c *Cluster) RegisterClusterCall()
- func (c *Cluster) Send(head rpc.RpcHead, packet rpc.Packet)
- func (c *Cluster) SendMsg(head rpc.RpcHead, funcName string, params ...interface{})
- type ClusterMap
- type ClusterSocketMap
- type EmptyClusterInfo
- type ICluster
- type Master
- type Op
- type OpOption
- type Service
- type Snowflake
- type Stub
Constants ¶
View Source
const ( MAX_CLUSTER_NUM = int(rpc.SERVICE_NUM) CALL_TIME_OUT = 500 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { actor.Actor *Service MailBox etcd.MailBox StubMailBox etcd.StubMailBox Stub common.Stub // contains filtered or unexported fields }
var (
MGR Cluster
)
func (*Cluster) AddCluster ¶
func (c *Cluster) AddCluster(info *common.ClusterInfo)
func (*Cluster) BindPacketFunc ¶
func (c *Cluster) BindPacketFunc(callfunc network.PacketFunc)
func (*Cluster) Call ¶
func (c *Cluster) Call(parmas ...interface{})
params[0]:rpc.RpcHead params[1]:error
func (*Cluster) Cluster_Add ¶
func (c *Cluster) Cluster_Add(ctx context.Context, info *common.ClusterInfo)
集群新加member
func (*Cluster) Cluster_Del ¶
func (c *Cluster) Cluster_Del(ctx context.Context, info *common.ClusterInfo)
集群删除member
func (*Cluster) DelCluster ¶
func (c *Cluster) DelCluster(info *common.ClusterInfo)
func (*Cluster) GetCluster ¶
func (c *Cluster) GetCluster(head rpc.RpcHead) *common.ClusterInfo
func (*Cluster) HandlePacket ¶
func (*Cluster) InitCluster ¶
func (*Cluster) RegisterClusterCall ¶ added in v0.0.3
func (c *Cluster) RegisterClusterCall()
type ClusterMap ¶
type ClusterMap map[uint32]*common.ClusterInfo
type ClusterSocketMap ¶
type ClusterSocketMap map[uint32]*common.ClusterInfo
type EmptyClusterInfo ¶
type EmptyClusterInfo struct {
common.ClusterInfo
}
func (*EmptyClusterInfo) String ¶
func (c *EmptyClusterInfo) String() string
type ICluster ¶
type ICluster interface { actor.IActor InitCluster(info *common.ClusterInfo, endpoints []string, natsUrl string, params ...OpOption) RegisterClusterCall() //注册集群通用回调 AddCluster(info *common.ClusterInfo) DelCluster(info *common.ClusterInfo) GetCluster(rpc.RpcHead) *common.ClusterInfo BindPacketFunc(packetFunc network.PacketFunc) CallMsg(interface{}, rpc.RpcHead, string, ...interface{}) error //同步给集群特定服务器 RandomCluster(head rpc.RpcHead) rpc.RpcHead //随机分配 IsEnoughStub(stub rpc.STUB) bool }
type Service ¶
func NewService ¶
func NewService(info *common.ClusterInfo, endpoints []string) *Service
type Snowflake ¶
func NewSnowflake ¶
Click to show internal directories.
Click to hide internal directories.