Documentation ¶
Index ¶
- Variables
- func Route(head *RpcHead, funcName string) string
- func Unmarshal(buff []byte) (*RpcPacket, RpcHead)
- func UnmarshalBody(rpcPacket *RpcPacket, pFuncType reflect.Type) []interface{}
- func UnmarshalBodyCall(rpcPacket *RpcPacket, pFuncType reflect.Type) (error, []interface{})
- func UnmarshalHead(buff []byte) (*RpcPacket, RpcHead)
- type ClusterInfo
- func (*ClusterInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ClusterInfo) GetIp() string
- func (x *ClusterInfo) GetPort() int32
- func (x *ClusterInfo) GetSocketId() uint32
- func (x *ClusterInfo) GetType() SERVICE
- func (x *ClusterInfo) GetWeight() int32
- func (*ClusterInfo) ProtoMessage()
- func (x *ClusterInfo) ProtoReflect() protoreflect.Message
- func (x *ClusterInfo) Reset()
- func (x *ClusterInfo) String() string
- type ICluster
- type MAIL
- type MailBox
- func (*MailBox) Descriptor() ([]byte, []int)deprecated
- func (x *MailBox) GetClusterId() uint32
- func (x *MailBox) GetId() int64
- func (x *MailBox) GetLeaseId() int64
- func (x *MailBox) GetMailType() MAIL
- func (*MailBox) ProtoMessage()
- func (x *MailBox) ProtoReflect() protoreflect.Message
- func (x *MailBox) Reset()
- func (x *MailBox) String() string
- type Packet
- func (*Packet) Descriptor() ([]byte, []int)deprecated
- func (x *Packet) GetBuff() []byte
- func (x *Packet) GetId() uint32
- func (x *Packet) GetReply() string
- func (x *Packet) GetRpcPacket() *RpcPacket
- func (*Packet) ProtoMessage()
- func (x *Packet) ProtoReflect() protoreflect.Message
- func (x *Packet) Reset()
- func (x *Packet) String() string
- type RpcHead
- func (*RpcHead) Descriptor() ([]byte, []int)deprecated
- func (x *RpcHead) GetActorName() string
- func (x *RpcHead) GetClusterId() uint32
- func (x *RpcHead) GetDestServerType() SERVICE
- func (x *RpcHead) GetId() int64
- func (x *RpcHead) GetReply() string
- func (x *RpcHead) GetSendType() SEND
- func (x *RpcHead) GetSocketId() uint32
- func (x *RpcHead) GetSrcClusterId() uint32
- func (*RpcHead) ProtoMessage()
- func (x *RpcHead) ProtoReflect() protoreflect.Message
- func (x *RpcHead) Reset()
- func (x *RpcHead) String() string
- type RpcPacket
- func (*RpcPacket) Descriptor() ([]byte, []int)deprecated
- func (x *RpcPacket) GetArgLen() int32
- func (x *RpcPacket) GetFuncName() string
- func (x *RpcPacket) GetRpcBody() []byte
- func (x *RpcPacket) GetRpcHead() *RpcHead
- func (*RpcPacket) ProtoMessage()
- func (x *RpcPacket) ProtoReflect() protoreflect.Message
- func (x *RpcPacket) Reset()
- func (x *RpcPacket) String() string
- type SEND
- type SERVICE
- type STUB
- type StubMailBox
- func (*StubMailBox) Descriptor() ([]byte, []int)deprecated
- func (x *StubMailBox) GetClusterId() uint32
- func (x *StubMailBox) GetId() int64
- func (x *StubMailBox) GetLeaseId() int64
- func (x *StubMailBox) GetStubType() STUB
- func (*StubMailBox) ProtoMessage()
- func (x *StubMailBox) ProtoReflect() protoreflect.Message
- func (x *StubMailBox) Reset()
- func (x *StubMailBox) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SERVICE_name = map[int32]string{ 0: "NONE", 1: "CLIENT", 2: "GATE", 3: "GAME", 4: "ZONE", 5: "DB", 6: "NUM", } SERVICE_value = map[string]int32{ "NONE": 0, "CLIENT": 1, "GATE": 2, "GAME": 3, "ZONE": 4, "DB": 5, "NUM": 6, } )
Enum value maps for SERVICE.
View Source
var ( SEND_name = map[int32]string{ 0: "POINT", 1: "BOARD_CAST", } SEND_value = map[string]int32{ "POINT": 0, "BOARD_CAST": 1, } )
Enum value maps for SEND.
View Source
var ( STUB_name = map[int32]string{ 0: "Master", 1: "PlayerMgr", 2: "AccountMgr", 3: "ChatMgr", 4: "END", } STUB_value = map[string]int32{ "Master": 0, "PlayerMgr": 1, "AccountMgr": 2, "ChatMgr": 3, "END": 4, } )
Enum value maps for STUB.
View Source
var ( MAIL_name = map[int32]string{ 0: "Player", } MAIL_value = map[string]int32{ "Player": 0, } )
Enum value maps for MAIL.
View Source
var File_rpc_rpc3_proto protoreflect.FileDescriptor
Functions ¶
func UnmarshalBody ¶
rpc Unmarshal pFuncType for (this *X)func(conttext, params)
func UnmarshalBodyCall ¶
Types ¶
type ClusterInfo ¶
type ClusterInfo struct { Type SERVICE `protobuf:"varint,1,opt,name=Type,proto3,enum=rpc.SERVICE" json:"Type,omitempty"` Ip string `protobuf:"bytes,2,opt,name=Ip,proto3" json:"Ip,omitempty"` Port int32 `protobuf:"varint,3,opt,name=Port,proto3" json:"Port,omitempty"` Weight int32 `protobuf:"varint,4,opt,name=Weight,proto3" json:"Weight,omitempty"` SocketId uint32 `protobuf:"varint,5,opt,name=SocketId,proto3" json:"SocketId,omitempty"` // contains filtered or unexported fields }
集群信息
func (*ClusterInfo) Descriptor
deprecated
func (*ClusterInfo) Descriptor() ([]byte, []int)
Deprecated: Use ClusterInfo.ProtoReflect.Descriptor instead.
func (*ClusterInfo) GetIp ¶
func (x *ClusterInfo) GetIp() string
func (*ClusterInfo) GetPort ¶
func (x *ClusterInfo) GetPort() int32
func (*ClusterInfo) GetSocketId ¶
func (x *ClusterInfo) GetSocketId() uint32
func (*ClusterInfo) GetType ¶
func (x *ClusterInfo) GetType() SERVICE
func (*ClusterInfo) GetWeight ¶
func (x *ClusterInfo) GetWeight() int32
func (*ClusterInfo) ProtoMessage ¶
func (*ClusterInfo) ProtoMessage()
func (*ClusterInfo) ProtoReflect ¶
func (x *ClusterInfo) ProtoReflect() protoreflect.Message
func (*ClusterInfo) Reset ¶
func (x *ClusterInfo) Reset()
func (*ClusterInfo) String ¶
func (x *ClusterInfo) String() string
type ICluster ¶
type ICluster interface { SendMsg(head RpcHead, funcName string, params ...interface{}) Call(params ...interface{}) Id() uint32 }
var MGR ICluster
type MAIL ¶
type MAIL int32
邮件类型
const (
MAIL_Player MAIL = 0 //player
)
func (MAIL) Descriptor ¶
func (MAIL) Descriptor() protoreflect.EnumDescriptor
func (MAIL) EnumDescriptor
deprecated
func (MAIL) Number ¶
func (x MAIL) Number() protoreflect.EnumNumber
func (MAIL) Type ¶
func (MAIL) Type() protoreflect.EnumType
type MailBox ¶
type MailBox struct { Id int64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` LeaseId int64 `protobuf:"varint,2,opt,name=LeaseId,proto3" json:"LeaseId,omitempty"` MailType MAIL `protobuf:"varint,3,opt,name=MailType,proto3,enum=rpc.MAIL" json:"MailType,omitempty"` ClusterId uint32 `protobuf:"varint,5,opt,name=ClusterId,proto3" json:"ClusterId,omitempty"` //集群id // contains filtered or unexported fields }
邮箱
func (*MailBox) Descriptor
deprecated
func (*MailBox) GetClusterId ¶
func (*MailBox) GetLeaseId ¶
func (*MailBox) GetMailType ¶
func (*MailBox) ProtoMessage ¶
func (*MailBox) ProtoMessage()
func (*MailBox) ProtoReflect ¶
func (x *MailBox) ProtoReflect() protoreflect.Message
type Packet ¶
type Packet struct { Id uint32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` //socketid Reply string `protobuf:"bytes,2,opt,name=Reply,proto3" json:"Reply,omitempty"` //call sessionid Buff []byte `protobuf:"bytes,3,opt,name=Buff,proto3" json:"Buff,omitempty"` //buff RpcPacket *RpcPacket `protobuf:"bytes,4,opt,name=RpcPacket,proto3" json:"RpcPacket,omitempty"` //rpc packet // contains filtered or unexported fields }
原始包
func (*Packet) Descriptor
deprecated
func (*Packet) GetRpcPacket ¶
func (*Packet) ProtoMessage ¶
func (*Packet) ProtoMessage()
func (*Packet) ProtoReflect ¶
func (x *Packet) ProtoReflect() protoreflect.Message
type RpcHead ¶
type RpcHead struct { Id int64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` //token SocketId uint32 `protobuf:"varint,2,opt,name=SocketId,proto3" json:"SocketId,omitempty"` SrcClusterId uint32 `protobuf:"varint,3,opt,name=SrcClusterId,proto3" json:"SrcClusterId,omitempty"` //源集群id ClusterId uint32 `protobuf:"varint,4,opt,name=ClusterId,proto3" json:"ClusterId,omitempty"` //目标集群id DestServerType SERVICE `protobuf:"varint,5,opt,name=DestServerType,proto3,enum=rpc.SERVICE" json:"DestServerType,omitempty"` //目标集群 SendType SEND `protobuf:"varint,6,opt,name=SendType,proto3,enum=rpc.SEND" json:"SendType,omitempty"` ActorName string `protobuf:"bytes,7,opt,name=ActorName,proto3" json:"ActorName,omitempty"` Reply string `protobuf:"bytes,8,opt,name=Reply,proto3" json:"Reply,omitempty"` //call sessionid // contains filtered or unexported fields }
rpc 包头
func (*RpcHead) Descriptor
deprecated
func (*RpcHead) GetActorName ¶
func (*RpcHead) GetClusterId ¶
func (*RpcHead) GetDestServerType ¶
func (*RpcHead) GetSendType ¶
func (*RpcHead) GetSocketId ¶
func (*RpcHead) GetSrcClusterId ¶
func (*RpcHead) ProtoMessage ¶
func (*RpcHead) ProtoMessage()
func (*RpcHead) ProtoReflect ¶
func (x *RpcHead) ProtoReflect() protoreflect.Message
type RpcPacket ¶
type RpcPacket struct { FuncName string `protobuf:"bytes,1,opt,name=FuncName,proto3" json:"FuncName,omitempty"` ArgLen int32 `protobuf:"varint,2,opt,name=ArgLen,proto3" json:"ArgLen,omitempty"` RpcHead *RpcHead `protobuf:"bytes,3,opt,name=RpcHead,proto3" json:"RpcHead,omitempty"` RpcBody []byte `protobuf:"bytes,4,opt,name=RpcBody,proto3" json:"RpcBody,omitempty"` // contains filtered or unexported fields }
rpc 包
func (*RpcPacket) Descriptor
deprecated
func (*RpcPacket) GetFuncName ¶
func (*RpcPacket) GetRpcBody ¶
func (*RpcPacket) GetRpcHead ¶
func (*RpcPacket) ProtoMessage ¶
func (*RpcPacket) ProtoMessage()
func (*RpcPacket) ProtoReflect ¶
func (x *RpcPacket) ProtoReflect() protoreflect.Message
type SEND ¶
type SEND int32
发送标志
func (SEND) Descriptor ¶
func (SEND) Descriptor() protoreflect.EnumDescriptor
func (SEND) EnumDescriptor
deprecated
func (SEND) Number ¶
func (x SEND) Number() protoreflect.EnumNumber
func (SEND) Type ¶
func (SEND) Type() protoreflect.EnumType
type SERVICE ¶
type SERVICE int32
服务器类型
func (SERVICE) Descriptor ¶
func (SERVICE) Descriptor() protoreflect.EnumDescriptor
func (SERVICE) EnumDescriptor
deprecated
func (SERVICE) Number ¶
func (x SERVICE) Number() protoreflect.EnumNumber
func (SERVICE) Type ¶
func (SERVICE) Type() protoreflect.EnumType
type STUB ¶
type STUB int32
STUB类型
func (STUB) Descriptor ¶
func (STUB) Descriptor() protoreflect.EnumDescriptor
func (STUB) EnumDescriptor
deprecated
func (STUB) Number ¶
func (x STUB) Number() protoreflect.EnumNumber
func (STUB) Type ¶
func (STUB) Type() protoreflect.EnumType
type StubMailBox ¶
type StubMailBox struct { Id int64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` LeaseId int64 `protobuf:"varint,2,opt,name=LeaseId,proto3" json:"LeaseId,omitempty"` StubType STUB `protobuf:"varint,3,opt,name=StubType,proto3,enum=rpc.STUB" json:"StubType,omitempty"` ClusterId uint32 `protobuf:"varint,5,opt,name=ClusterId,proto3" json:"ClusterId,omitempty"` //集群id // contains filtered or unexported fields }
玩法集群信息
func (*StubMailBox) Descriptor
deprecated
func (*StubMailBox) Descriptor() ([]byte, []int)
Deprecated: Use StubMailBox.ProtoReflect.Descriptor instead.
func (*StubMailBox) GetClusterId ¶
func (x *StubMailBox) GetClusterId() uint32
func (*StubMailBox) GetId ¶
func (x *StubMailBox) GetId() int64
func (*StubMailBox) GetLeaseId ¶
func (x *StubMailBox) GetLeaseId() int64
func (*StubMailBox) GetStubType ¶
func (x *StubMailBox) GetStubType() STUB
func (*StubMailBox) ProtoMessage ¶
func (*StubMailBox) ProtoMessage()
func (*StubMailBox) ProtoReflect ¶
func (x *StubMailBox) ProtoReflect() protoreflect.Message
func (*StubMailBox) Reset ¶
func (x *StubMailBox) Reset()
func (*StubMailBox) String ¶
func (x *StubMailBox) String() string
Click to show internal directories.
Click to hide internal directories.