rpc

package
v1.6.9 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	actor.Actor
	// contains filtered or unexported fields
}

集群客户端

func (*Cluster) AddCluster

func (c *Cluster) AddCluster(info *common.ClusterInfo)

func (*Cluster) BindPacket

func (c *Cluster) BindPacket(packet IClusterPacket)

func (*Cluster) BindPacketFunc

func (c *Cluster) BindPacketFunc(callfunc network.PacketFunc)

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) DISCONNECT

func (c *Cluster) DISCONNECT(ctx context.Context, ClusterId uint32)

链接断开

func (*Cluster) DelCluster

func (c *Cluster) DelCluster(info *common.ClusterInfo)

func (*Cluster) GetCluster

func (c *Cluster) GetCluster(head rpc.RpcHead) *ClusterNode

func (*Cluster) InitCluster

func (c *Cluster) InitCluster(info *common.ClusterInfo, Endpoints []string)

func (*Cluster) RandomCluster

func (c *Cluster) RandomCluster(head rpc.RpcHead) rpc.RpcHead

func (*Cluster) Send

func (c *Cluster) Send(head rpc.RpcHead, packet rpc.Packet)

func (*Cluster) SendMsg

func (c *Cluster) SendMsg(head rpc.RpcHead, funcName string, params ...interface{})

type ClusterNode

type ClusterNode struct {
	*network.ClientSocket
	*common.ClusterInfo
}

type ClusterServer

type ClusterServer struct {
	actor.Actor
	*Service //集群注册
	// contains filtered or unexported fields
}

集群服务器

func (*ClusterServer) AddCluster

func (c *ClusterServer) AddCluster(info *common.ClusterInfo)

func (*ClusterServer) BindServer

func (c *ClusterServer) BindServer(pService *network.ServerSocket)

func (*ClusterServer) COMMON_RegisterRequest

func (c *ClusterServer) COMMON_RegisterRequest(ctx context.Context, info *common.ClusterInfo)

func (*ClusterServer) DISCONNECT

func (c *ClusterServer) DISCONNECT(ctx context.Context, socketId uint32)

链接断开

func (*ClusterServer) DelCluster

func (c *ClusterServer) DelCluster(info *common.ClusterInfo)

func (*ClusterServer) GetCluster

func (c *ClusterServer) GetCluster(head rpc.RpcHead) *common.ClusterInfo

func (*ClusterServer) GetClusterBySocket

func (c *ClusterServer) GetClusterBySocket(socketId uint32) *common.ClusterInfo

func (*ClusterServer) InitService

func (c *ClusterServer) InitService(info *common.ClusterInfo, Endpoints []string)

func (*ClusterServer) RandomCluster

func (c *ClusterServer) RandomCluster(head rpc.RpcHead) rpc.RpcHead

func (*ClusterServer) RegisterClusterCall

func (c *ClusterServer) RegisterClusterCall()

func (*ClusterServer) Send

func (c *ClusterServer) Send(head rpc.RpcHead, packet rpc.Packet)

func (*ClusterServer) SendMsg

func (c *ClusterServer) SendMsg(head rpc.RpcHead, funcName string, params ...interface{})

type HashClusterMap

type HashClusterMap map[uint32]*common.ClusterInfo

type HashClusterSocketMap

type HashClusterSocketMap map[uint32]*common.ClusterInfo

type ICluster

type ICluster interface {
	actor.IActor
	InitCluster(info *common.ClusterInfo, Endpoints []string)
	AddCluster(info *common.ClusterInfo)
	DelCluster(info *common.ClusterInfo)
	GetCluster(rpc.RpcHead) *ClusterNode

	BindPacket(IClusterPacket)
	BindPacketFunc(network.PacketFunc)

	RandomCluster(head rpc.RpcHead) rpc.RpcHead ///随机分配
	// contains filtered or unexported methods
}

type IClusterPacket

type IClusterPacket interface {
	actor.IActor
	SetClusterId(uint32)
}

集群包管理

type IClusterServer

type IClusterServer interface {
	InitService(info *common.ClusterInfo, Endpoints []string)
	RegisterClusterCall() //注册集群通用回调
	AddCluster(info *common.ClusterInfo)
	DelCluster(info *common.ClusterInfo)
	GetCluster(rpc.RpcHead) *common.ClusterInfo
	GetClusterBySocket(uint32) *common.ClusterInfo

	BindServer(*network.ServerSocket)
	SendMsg(rpc.RpcHead, string, ...interface{}) //发送给集群特定服务器
	Send(rpc.RpcHead, []byte)                    //发送给集群特定服务器

	RandomCluster(head rpc.RpcHead) rpc.RpcHead //随机分配
	// contains filtered or unexported methods
}

type MailBox

type MailBox etv3.MailBox

type Master

type Master etv3.Master

func NewMaster

func NewMaster(info *common.ClusterInfo, Endpoints []string) *Master

监控服务器

type Service

type Service etv3.Service

func NewService

func NewService(info *common.ClusterInfo, Endpoints []string) *Service

注册服务器

type Snowflake

type Snowflake etv3.Snowflake

func NewSnowflake

func NewSnowflake(Endpoints []string) *Snowflake

uuid生成器

Jump to

Keyboard shortcuts

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