rpc

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 9 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 *rpc.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 *rpc.ClusterInfo)

集群新加member

func (*Cluster) Cluster_Del

func (c *Cluster) Cluster_Del(ctx context.Context, info *rpc.ClusterInfo)

集群删除member

func (*Cluster) DISCONNECT

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

链接断开

func (*Cluster) DelCluster

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

func (*Cluster) GetCluster

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

func (*Cluster) InitCluster

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

type ClusterNode

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

type ClusterServer

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

集群服务器

func (*ClusterServer) AddCluster

func (this *ClusterServer) AddCluster(info *rpc.ClusterInfo)

func (*ClusterServer) BindServer

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

func (*ClusterServer) DelCluster

func (this *ClusterServer) DelCluster(info *rpc.ClusterInfo)

func (*ClusterServer) GetCluster

func (this *ClusterServer) GetCluster(head rpc.RpcHead) *rpc.ClusterInfo

func (*ClusterServer) GetClusterBySocket

func (this *ClusterServer) GetClusterBySocket(socketId uint32) *rpc.ClusterInfo

func (*ClusterServer) InitService

func (this *ClusterServer) InitService(info *rpc.ClusterInfo, Endpoints []string)

func (*ClusterServer) RandomCluster

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

func (*ClusterServer) RegisterClusterCall

func (this *ClusterServer) RegisterClusterCall()

func (*ClusterServer) Send

func (this *ClusterServer) Send(head rpc.RpcHead, buff []byte)

func (*ClusterServer) SendMsg

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

type HashClusterMap

type HashClusterMap map[uint32]*rpc.ClusterInfo

type HashClusterSocketMap

type HashClusterSocketMap map[uint32]*rpc.ClusterInfo

type ICluster

type ICluster interface {
	actor.IActor
	InitCluster(info *rpc.ClusterInfo, Endpoints []string)
	AddCluster(info *rpc.ClusterInfo)
	DelCluster(info *rpc.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 *rpc.ClusterInfo, Endpoints []string)
	RegisterClusterCall() //注册集群通用回调
	AddCluster(info *rpc.ClusterInfo)
	DelCluster(info *rpc.ClusterInfo)
	GetCluster(rpc.RpcHead) *rpc.ClusterInfo
	GetClusterBySocket(uint32) *rpc.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 *rpc.ClusterInfo, Endpoints []string) *Master

监控服务器

type Service

type Service etv3.Service

func NewService

func NewService(info *rpc.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