Documentation ¶
Index ¶
- Variables
- func RegisterPitayaServer(s *grpc.Server, srv PitayaServer)
- type BindMsg
- type ClientConnect
- func (*ClientConnect) Descriptor() ([]byte, []int)deprecated
- func (x *ClientConnect) GetBootEntityID() string
- func (x *ClientConnect) GetSess() *Session
- func (*ClientConnect) ProtoMessage()
- func (x *ClientConnect) ProtoReflect() protoreflect.Message
- func (x *ClientConnect) Reset()
- func (x *ClientConnect) String() string
- type ClientDisconnect
- func (*ClientDisconnect) Descriptor() ([]byte, []int)deprecated
- func (x *ClientDisconnect) GetOwnEntityID() string
- func (x *ClientDisconnect) GetOwnEntityType() string
- func (*ClientDisconnect) ProtoMessage()
- func (x *ClientDisconnect) ProtoReflect() protoreflect.Message
- func (x *ClientDisconnect) Reset()
- func (x *ClientDisconnect) String() string
- type Doc
- type DocMsg
- type Error
- func (*Error) Descriptor() ([]byte, []int)deprecated
- func (x *Error) GetCode() string
- func (x *Error) GetMetadata() map[string]string
- func (x *Error) GetMsg() string
- func (*Error) ProtoMessage()
- func (x *Error) ProtoReflect() protoreflect.Message
- func (x *Error) Reset()
- func (x *Error) String() string
- type KickAnswer
- type KickMsg
- type MsgType
- type MsgV2
- func (*MsgV2) Descriptor() ([]byte, []int)deprecated
- func (x *MsgV2) GetData() []byte
- func (x *MsgV2) GetEid() string
- func (x *MsgV2) GetId() uint64
- func (x *MsgV2) GetReply() string
- func (x *MsgV2) GetRoute() string
- func (x *MsgV2) GetTyp() string
- func (x *MsgV2) GetType() MsgType
- func (*MsgV2) ProtoMessage()
- func (x *MsgV2) ProtoReflect() protoreflect.Message
- func (x *MsgV2) Reset()
- func (x *MsgV2) String() string
- type PitayaClient
- type PitayaServer
- type ProtoDescriptor
- type ProtoDescriptors
- type ProtoName
- type ProtoNames
- type Push
- func (*Push) Descriptor() ([]byte, []int)deprecated
- func (x *Push) GetClientID() int64
- func (x *Push) GetData() []byte
- func (x *Push) GetRoute() string
- func (x *Push) GetUid() string
- func (*Push) ProtoMessage()
- func (x *Push) ProtoReflect() protoreflect.Message
- func (x *Push) Reset()
- func (x *Push) String() string
- type RPCType
- type Request
- func (*Request) Descriptor() ([]byte, []int)deprecated
- func (x *Request) GetFrontendID() string
- func (x *Request) GetMetadata() []byte
- func (x *Request) GetMsg() *MsgV2
- func (x *Request) GetSession() *Session
- func (x *Request) GetType() RPCType
- func (*Request) ProtoMessage()
- func (x *Request) ProtoReflect() protoreflect.Message
- func (x *Request) Reset()
- func (x *Request) String() string
- type Response
- type Session
- func (*Session) Descriptor() ([]byte, []int)deprecated
- func (x *Session) GetId() int64
- func (x *Session) GetServerID() string
- func (x *Session) GetUid() string
- func (*Session) ProtoMessage()
- func (x *Session) ProtoReflect() protoreflect.Message
- func (x *Session) Reset()
- func (x *Session) String() string
- type SwitchOwner
- func (*SwitchOwner) Descriptor() ([]byte, []int)deprecated
- func (x *SwitchOwner) GetBackgroundServerID() string
- func (x *SwitchOwner) GetId() string
- func (x *SwitchOwner) GetSess() *Session
- func (x *SwitchOwner) GetType() string
- func (*SwitchOwner) ProtoMessage()
- func (x *SwitchOwner) ProtoReflect() protoreflect.Message
- func (x *SwitchOwner) Reset()
- func (x *SwitchOwner) String() string
- type UnimplementedPitayaServer
- func (*UnimplementedPitayaServer) Call(context.Context, *Request) (*Response, error)
- func (*UnimplementedPitayaServer) KickUser(context.Context, *KickMsg) (*KickAnswer, error)
- func (*UnimplementedPitayaServer) PushToUser(context.Context, *Push) (*Response, error)
- func (*UnimplementedPitayaServer) SessionBindRemote(context.Context, *BindMsg) (*Response, error)
Constants ¶
This section is empty.
Variables ¶
var ( MsgType_name = map[int32]string{ 0: "MsgRequest", 1: "MsgNotify", 2: "MsgResponse", 3: "MsgPush", } MsgType_value = map[string]int32{ "MsgRequest": 0, "MsgNotify": 1, "MsgResponse": 2, "MsgPush": 3, } )
Enum value maps for MsgType.
var ( RPCType_name = map[int32]string{ 0: "Sys", 1: "User", } RPCType_value = map[string]int32{ "Sys": 0, "User": 1, } )
Enum value maps for RPCType.
var File_bind_proto protoreflect.FileDescriptor
var File_doc_proto protoreflect.FileDescriptor
var File_docmsg_proto protoreflect.FileDescriptor
var File_error_proto protoreflect.FileDescriptor
var File_kick_proto protoreflect.FileDescriptor
var File_msg_proto protoreflect.FileDescriptor
var File_pitaya_proto protoreflect.FileDescriptor
var File_protodescriptor_proto protoreflect.FileDescriptor
var File_push_proto protoreflect.FileDescriptor
var File_request_proto protoreflect.FileDescriptor
var File_response_proto protoreflect.FileDescriptor
var File_session_proto protoreflect.FileDescriptor
Functions ¶
func RegisterPitayaServer ¶
func RegisterPitayaServer(s *grpc.Server, srv PitayaServer)
Types ¶
type BindMsg ¶
type BindMsg struct { Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` Fid string `protobuf:"bytes,2,opt,name=fid,proto3" json:"fid,omitempty"` // contains filtered or unexported fields }
func (*BindMsg) Descriptor
deprecated
func (*BindMsg) ProtoMessage ¶
func (*BindMsg) ProtoMessage()
func (*BindMsg) ProtoReflect ¶
func (x *BindMsg) ProtoReflect() protoreflect.Message
type ClientConnect ¶ added in v0.1.0
type ClientConnect struct { Sess *Session `protobuf:"bytes,1,opt,name=sess,proto3" json:"sess,omitempty"` BootEntityID string `protobuf:"bytes,2,opt,name=bootEntityID,proto3" json:"bootEntityID,omitempty"` // contains filtered or unexported fields }
func (*ClientConnect) Descriptor
deprecated
added in
v0.1.0
func (*ClientConnect) Descriptor() ([]byte, []int)
Deprecated: Use ClientConnect.ProtoReflect.Descriptor instead.
func (*ClientConnect) GetBootEntityID ¶ added in v0.1.0
func (x *ClientConnect) GetBootEntityID() string
func (*ClientConnect) GetSess ¶ added in v0.1.0
func (x *ClientConnect) GetSess() *Session
func (*ClientConnect) ProtoMessage ¶ added in v0.1.0
func (*ClientConnect) ProtoMessage()
func (*ClientConnect) ProtoReflect ¶ added in v0.1.0
func (x *ClientConnect) ProtoReflect() protoreflect.Message
func (*ClientConnect) Reset ¶ added in v0.1.0
func (x *ClientConnect) Reset()
func (*ClientConnect) String ¶ added in v0.1.0
func (x *ClientConnect) String() string
type ClientDisconnect ¶ added in v0.1.0
type ClientDisconnect struct { OwnEntityID string `protobuf:"bytes,1,opt,name=ownEntityID,proto3" json:"ownEntityID,omitempty"` OwnEntityType string `protobuf:"bytes,2,opt,name=ownEntityType,proto3" json:"ownEntityType,omitempty"` // contains filtered or unexported fields }
客户端断开连接
func (*ClientDisconnect) Descriptor
deprecated
added in
v0.1.0
func (*ClientDisconnect) Descriptor() ([]byte, []int)
Deprecated: Use ClientDisconnect.ProtoReflect.Descriptor instead.
func (*ClientDisconnect) GetOwnEntityID ¶ added in v0.1.0
func (x *ClientDisconnect) GetOwnEntityID() string
func (*ClientDisconnect) GetOwnEntityType ¶ added in v0.1.0
func (x *ClientDisconnect) GetOwnEntityType() string
func (*ClientDisconnect) ProtoMessage ¶ added in v0.1.0
func (*ClientDisconnect) ProtoMessage()
func (*ClientDisconnect) ProtoReflect ¶ added in v0.1.0
func (x *ClientDisconnect) ProtoReflect() protoreflect.Message
func (*ClientDisconnect) Reset ¶ added in v0.1.0
func (x *ClientDisconnect) Reset()
func (*ClientDisconnect) String ¶ added in v0.1.0
func (x *ClientDisconnect) String() string
type Doc ¶
type Doc struct { Doc string `protobuf:"bytes,1,opt,name=doc,proto3" json:"doc,omitempty"` // contains filtered or unexported fields }
func (*Doc) Descriptor
deprecated
func (*Doc) ProtoMessage ¶
func (*Doc) ProtoMessage()
func (*Doc) ProtoReflect ¶
func (x *Doc) ProtoReflect() protoreflect.Message
type DocMsg ¶
type DocMsg struct { GetProtos bool `protobuf:"varint,1,opt,name=getProtos,proto3" json:"getProtos,omitempty"` // contains filtered or unexported fields }
func (*DocMsg) Descriptor
deprecated
func (*DocMsg) GetGetProtos ¶
func (*DocMsg) ProtoMessage ¶
func (*DocMsg) ProtoMessage()
func (*DocMsg) ProtoReflect ¶
func (x *DocMsg) ProtoReflect() protoreflect.Message
type Error ¶
type Error struct { Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Metadata map[string]string `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Error) Descriptor
deprecated
func (*Error) GetMetadata ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type KickAnswer ¶
type KickAnswer struct { Kicked bool `protobuf:"varint,1,opt,name=kicked,proto3" json:"kicked,omitempty"` // contains filtered or unexported fields }
func (*KickAnswer) Descriptor
deprecated
func (*KickAnswer) Descriptor() ([]byte, []int)
Deprecated: Use KickAnswer.ProtoReflect.Descriptor instead.
func (*KickAnswer) GetKicked ¶
func (x *KickAnswer) GetKicked() bool
func (*KickAnswer) ProtoMessage ¶
func (*KickAnswer) ProtoMessage()
func (*KickAnswer) ProtoReflect ¶
func (x *KickAnswer) ProtoReflect() protoreflect.Message
func (*KickAnswer) Reset ¶
func (x *KickAnswer) Reset()
func (*KickAnswer) String ¶
func (x *KickAnswer) String() string
type KickMsg ¶
type KickMsg struct { UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` // contains filtered or unexported fields }
func (*KickMsg) Descriptor
deprecated
func (*KickMsg) ProtoMessage ¶
func (*KickMsg) ProtoMessage()
func (*KickMsg) ProtoReflect ¶
func (x *KickMsg) ProtoReflect() protoreflect.Message
type MsgType ¶
type MsgType int32
func (MsgType) Descriptor ¶
func (MsgType) Descriptor() protoreflect.EnumDescriptor
func (MsgType) EnumDescriptor
deprecated
func (MsgType) Number ¶
func (x MsgType) Number() protoreflect.EnumNumber
func (MsgType) Type ¶
func (MsgType) Type() protoreflect.EnumType
type MsgV2 ¶ added in v0.1.0
type MsgV2 struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // 消息ID,如果是 MsgRequest 或者 MsgResponse 会用到此id Route string `protobuf:"bytes,2,opt,name=route,proto3" json:"route,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` Reply string `protobuf:"bytes,4,opt,name=reply,proto3" json:"reply,omitempty"` Type MsgType `protobuf:"varint,5,opt,name=type,proto3,enum=protos.MsgType" json:"type,omitempty"` Eid string `protobuf:"bytes,6,opt,name=eid,proto3" json:"eid,omitempty"` // 实体id Typ string `protobuf:"bytes,7,opt,name=typ,proto3" json:"typ,omitempty"` // 实体类别 // contains filtered or unexported fields }
func (*MsgV2) Descriptor
deprecated
added in
v0.1.0
func (*MsgV2) ProtoMessage ¶ added in v0.1.0
func (*MsgV2) ProtoMessage()
func (*MsgV2) ProtoReflect ¶ added in v0.1.0
func (x *MsgV2) ProtoReflect() protoreflect.Message
type PitayaClient ¶
type PitayaClient interface { Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) PushToUser(ctx context.Context, in *Push, opts ...grpc.CallOption) (*Response, error) SessionBindRemote(ctx context.Context, in *BindMsg, opts ...grpc.CallOption) (*Response, error) KickUser(ctx context.Context, in *KickMsg, opts ...grpc.CallOption) (*KickAnswer, error) }
PitayaClient is the client API for Pitaya service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewPitayaClient ¶
func NewPitayaClient(cc grpc.ClientConnInterface) PitayaClient
type PitayaServer ¶
type PitayaServer interface { Call(context.Context, *Request) (*Response, error) PushToUser(context.Context, *Push) (*Response, error) SessionBindRemote(context.Context, *BindMsg) (*Response, error) KickUser(context.Context, *KickMsg) (*KickAnswer, error) }
PitayaServer is the server API for Pitaya service.
type ProtoDescriptor ¶
type ProtoDescriptor struct { Desc []byte `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` // contains filtered or unexported fields }
Descriptor proto used to retrieve zipped proto descriptors remotely
func (*ProtoDescriptor) Descriptor
deprecated
func (*ProtoDescriptor) Descriptor() ([]byte, []int)
Deprecated: Use ProtoDescriptor.ProtoReflect.Descriptor instead.
func (*ProtoDescriptor) GetDesc ¶
func (x *ProtoDescriptor) GetDesc() []byte
func (*ProtoDescriptor) ProtoMessage ¶
func (*ProtoDescriptor) ProtoMessage()
func (*ProtoDescriptor) ProtoReflect ¶
func (x *ProtoDescriptor) ProtoReflect() protoreflect.Message
func (*ProtoDescriptor) Reset ¶
func (x *ProtoDescriptor) Reset()
func (*ProtoDescriptor) String ¶
func (x *ProtoDescriptor) String() string
type ProtoDescriptors ¶
type ProtoDescriptors struct { Desc [][]byte `protobuf:"bytes,1,rep,name=desc,proto3" json:"desc,omitempty"` // contains filtered or unexported fields }
func (*ProtoDescriptors) Descriptor
deprecated
func (*ProtoDescriptors) Descriptor() ([]byte, []int)
Deprecated: Use ProtoDescriptors.ProtoReflect.Descriptor instead.
func (*ProtoDescriptors) GetDesc ¶
func (x *ProtoDescriptors) GetDesc() [][]byte
func (*ProtoDescriptors) ProtoMessage ¶
func (*ProtoDescriptors) ProtoMessage()
func (*ProtoDescriptors) ProtoReflect ¶
func (x *ProtoDescriptors) ProtoReflect() protoreflect.Message
func (*ProtoDescriptors) Reset ¶
func (x *ProtoDescriptors) Reset()
func (*ProtoDescriptors) String ¶
func (x *ProtoDescriptors) String() string
type ProtoName ¶
type ProtoName struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*ProtoName) Descriptor
deprecated
func (*ProtoName) ProtoMessage ¶
func (*ProtoName) ProtoMessage()
func (*ProtoName) ProtoReflect ¶
func (x *ProtoName) ProtoReflect() protoreflect.Message
type ProtoNames ¶
type ProtoNames struct { Name []string `protobuf:"bytes,1,rep,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*ProtoNames) Descriptor
deprecated
func (*ProtoNames) Descriptor() ([]byte, []int)
Deprecated: Use ProtoNames.ProtoReflect.Descriptor instead.
func (*ProtoNames) GetName ¶
func (x *ProtoNames) GetName() []string
func (*ProtoNames) ProtoMessage ¶
func (*ProtoNames) ProtoMessage()
func (*ProtoNames) ProtoReflect ¶
func (x *ProtoNames) ProtoReflect() protoreflect.Message
func (*ProtoNames) Reset ¶
func (x *ProtoNames) Reset()
func (*ProtoNames) String ¶
func (x *ProtoNames) String() string
type Push ¶
type Push struct { Route string `protobuf:"bytes,1,opt,name=route,proto3" json:"route,omitempty"` Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` // 连接绑定的uid Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` ClientID int64 `protobuf:"varint,4,opt,name=clientID,proto3" json:"clientID,omitempty"` // 连接在所在网关层的唯一ID // contains filtered or unexported fields }
func (*Push) Descriptor
deprecated
func (*Push) GetClientID ¶ added in v0.1.0
func (*Push) ProtoMessage ¶
func (*Push) ProtoMessage()
func (*Push) ProtoReflect ¶
func (x *Push) ProtoReflect() protoreflect.Message
type RPCType ¶
type RPCType int32
func (RPCType) Descriptor ¶
func (RPCType) Descriptor() protoreflect.EnumDescriptor
func (RPCType) EnumDescriptor
deprecated
func (RPCType) Number ¶
func (x RPCType) Number() protoreflect.EnumNumber
func (RPCType) Type ¶
func (RPCType) Type() protoreflect.EnumType
type Request ¶
type Request struct { Type RPCType `protobuf:"varint,1,opt,name=type,proto3,enum=protos.RPCType" json:"type,omitempty"` Session *Session `protobuf:"bytes,2,opt,name=session,proto3" json:"session,omitempty"` Msg *MsgV2 `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` FrontendID string `protobuf:"bytes,4,opt,name=frontendID,proto3" json:"frontendID,omitempty"` Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) GetFrontendID ¶
func (*Request) GetMetadata ¶
func (*Request) GetSession ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Error *Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type Session ¶
type Session struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // 运行时的session id Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` // 玩家角色id ServerID string `protobuf:"bytes,4,opt,name=serverID,proto3" json:"serverID,omitempty"` // 该连接在哪个server上 // contains filtered or unexported fields }
func (*Session) Descriptor
deprecated
func (*Session) GetServerID ¶ added in v0.1.0
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
func (*Session) ProtoReflect ¶
func (x *Session) ProtoReflect() protoreflect.Message
type SwitchOwner ¶ added in v0.1.0
type SwitchOwner struct { Sess *Session `protobuf:"bytes,1,opt,name=sess,proto3" json:"sess,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` BackgroundServerID string `protobuf:"bytes,4,opt,name=backgroundServerID,proto3" json:"backgroundServerID,omitempty"` // contains filtered or unexported fields }
func (*SwitchOwner) Descriptor
deprecated
added in
v0.1.0
func (*SwitchOwner) Descriptor() ([]byte, []int)
Deprecated: Use SwitchOwner.ProtoReflect.Descriptor instead.
func (*SwitchOwner) GetBackgroundServerID ¶ added in v0.1.0
func (x *SwitchOwner) GetBackgroundServerID() string
func (*SwitchOwner) GetId ¶ added in v0.1.0
func (x *SwitchOwner) GetId() string
func (*SwitchOwner) GetSess ¶ added in v0.1.0
func (x *SwitchOwner) GetSess() *Session
func (*SwitchOwner) GetType ¶ added in v0.1.0
func (x *SwitchOwner) GetType() string
func (*SwitchOwner) ProtoMessage ¶ added in v0.1.0
func (*SwitchOwner) ProtoMessage()
func (*SwitchOwner) ProtoReflect ¶ added in v0.1.0
func (x *SwitchOwner) ProtoReflect() protoreflect.Message
func (*SwitchOwner) Reset ¶ added in v0.1.0
func (x *SwitchOwner) Reset()
func (*SwitchOwner) String ¶ added in v0.1.0
func (x *SwitchOwner) String() string
type UnimplementedPitayaServer ¶
type UnimplementedPitayaServer struct { }
UnimplementedPitayaServer can be embedded to have forward compatible implementations.
func (*UnimplementedPitayaServer) KickUser ¶
func (*UnimplementedPitayaServer) KickUser(context.Context, *KickMsg) (*KickAnswer, error)