Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
- type C2S_Login
- type C2S_Ping
- type C2S_Say
- type GetUserInfoArgs
- type GetUserInfoReply
- type OpCode
- type S2C_Login
- type S2C_Pong
- type S2C_Say
- type UnimplementedUserServiceServer
- type UnsafeUserServiceServer
- type UserServiceClient
- type UserServiceServer
Constants ¶
const (
UserService_GetUserInfo_FullMethodName = "/pb.UserService/GetUserInfo"
)
Variables ¶
var ( OpCode_name = map[int32]string{ 0: "None", 1: "Op_C2S_Login", 2: "Op_S2C_Login", 3: "Op_C2S_Say", 4: "Op_S2C_Say", } OpCode_value = map[string]int32{ "None": 0, "Op_C2S_Login": 1, "Op_S2C_Login": 2, "Op_C2S_Say": 3, "Op_S2C_Say": 4, } )
Enum value maps for OpCode.
var File_gameserver_proto protoreflect.FileDescriptor
var File_user_service_proto protoreflect.FileDescriptor
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUserInfo", Handler: _UserService_GetUserInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user.service.proto", }
UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
Types ¶
type C2S_Login ¶
type C2S_Login struct { Account string `protobuf:"bytes,1,opt,name=Account,proto3" json:"Account"` Password string `protobuf:"bytes,2,opt,name=Password,proto3" json:"Password"` // contains filtered or unexported fields }
C2S_Login 登录服务器
func (*C2S_Login) Descriptor
deprecated
func (*C2S_Login) GetAccount ¶
func (*C2S_Login) GetPassword ¶
func (*C2S_Login) ProtoMessage ¶
func (*C2S_Login) ProtoMessage()
func (*C2S_Login) ProtoReflect ¶
func (x *C2S_Login) ProtoReflect() protoreflect.Message
type C2S_Ping ¶
type C2S_Ping struct { TickTime int64 `protobuf:"varint,1,opt,name=TickTime,proto3" json:"TickTime"` // contains filtered or unexported fields }
C2S_Ping 客户端向服务器发送心跳
func (*C2S_Ping) Descriptor
deprecated
func (*C2S_Ping) GetTickTime ¶
func (*C2S_Ping) ProtoMessage ¶
func (*C2S_Ping) ProtoMessage()
func (*C2S_Ping) ProtoReflect ¶
func (x *C2S_Ping) ProtoReflect() protoreflect.Message
type C2S_Say ¶ added in v0.0.4
type C2S_Say struct { Actor int64 `protobuf:"varint,1,opt,name=Actor,proto3" json:"Actor"` Word string `protobuf:"bytes,2,opt,name=Word,proto3" json:"Word"` // contains filtered or unexported fields }
C2S_Say 玩家通信
func (*C2S_Say) Descriptor
deprecated
added in
v0.0.4
func (*C2S_Say) ProtoMessage ¶ added in v0.0.4
func (*C2S_Say) ProtoMessage()
func (*C2S_Say) ProtoReflect ¶ added in v0.0.4
func (x *C2S_Say) ProtoReflect() protoreflect.Message
type GetUserInfoArgs ¶
type GetUserInfoArgs struct { UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id"` // 用户ID // contains filtered or unexported fields }
func (*GetUserInfoArgs) Descriptor
deprecated
func (*GetUserInfoArgs) Descriptor() ([]byte, []int)
Deprecated: Use GetUserInfoArgs.ProtoReflect.Descriptor instead.
func (*GetUserInfoArgs) GetUserId ¶
func (x *GetUserInfoArgs) GetUserId() int64
func (*GetUserInfoArgs) ProtoMessage ¶
func (*GetUserInfoArgs) ProtoMessage()
func (*GetUserInfoArgs) ProtoReflect ¶
func (x *GetUserInfoArgs) ProtoReflect() protoreflect.Message
func (*GetUserInfoArgs) Reset ¶
func (x *GetUserInfoArgs) Reset()
func (*GetUserInfoArgs) String ¶
func (x *GetUserInfoArgs) String() string
type GetUserInfoReply ¶
type GetUserInfoReply struct { UserName string `protobuf:"bytes,1,opt,name=user_name,json=userName,proto3" json:"user_name"` // 用户名 // contains filtered or unexported fields }
func (*GetUserInfoReply) Descriptor
deprecated
func (*GetUserInfoReply) Descriptor() ([]byte, []int)
Deprecated: Use GetUserInfoReply.ProtoReflect.Descriptor instead.
func (*GetUserInfoReply) GetUserName ¶
func (x *GetUserInfoReply) GetUserName() string
func (*GetUserInfoReply) ProtoMessage ¶
func (*GetUserInfoReply) ProtoMessage()
func (*GetUserInfoReply) ProtoReflect ¶
func (x *GetUserInfoReply) ProtoReflect() protoreflect.Message
func (*GetUserInfoReply) Reset ¶
func (x *GetUserInfoReply) Reset()
func (*GetUserInfoReply) String ¶
func (x *GetUserInfoReply) String() string
type OpCode ¶
type OpCode int32
OpCode 操作符定义
func (OpCode) Descriptor ¶
func (OpCode) Descriptor() protoreflect.EnumDescriptor
func (OpCode) EnumDescriptor
deprecated
func (OpCode) Number ¶
func (x OpCode) Number() protoreflect.EnumNumber
func (OpCode) Type ¶
func (OpCode) Type() protoreflect.EnumType
type S2C_Login ¶
type S2C_Login struct { Ok bool `protobuf:"varint,1,opt,name=Ok,proto3" json:"Ok"` // contains filtered or unexported fields }
func (*S2C_Login) Descriptor
deprecated
func (*S2C_Login) ProtoMessage ¶
func (*S2C_Login) ProtoMessage()
func (*S2C_Login) ProtoReflect ¶
func (x *S2C_Login) ProtoReflect() protoreflect.Message
type S2C_Pong ¶
type S2C_Pong struct { OK bool `protobuf:"varint,1,opt,name=OK,proto3" json:"OK"` // contains filtered or unexported fields }
func (*S2C_Pong) Descriptor
deprecated
func (*S2C_Pong) ProtoMessage ¶
func (*S2C_Pong) ProtoMessage()
func (*S2C_Pong) ProtoReflect ¶
func (x *S2C_Pong) ProtoReflect() protoreflect.Message
type S2C_Say ¶ added in v0.0.4
type S2C_Say struct { Word string `protobuf:"bytes,1,opt,name=Word,proto3" json:"Word"` // contains filtered or unexported fields }
func (*S2C_Say) Descriptor
deprecated
added in
v0.0.4
func (*S2C_Say) ProtoMessage ¶ added in v0.0.4
func (*S2C_Say) ProtoMessage()
func (*S2C_Say) ProtoReflect ¶ added in v0.0.4
func (x *S2C_Say) ProtoReflect() protoreflect.Message
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct { }
UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServiceServer) GetUserInfo ¶
func (UnimplementedUserServiceServer) GetUserInfo(context.Context, *GetUserInfoArgs) (*GetUserInfoReply, error)
type UnsafeUserServiceServer ¶
type UnsafeUserServiceServer interface {
// contains filtered or unexported methods
}
UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServiceServer will result in compilation errors.
type UserServiceClient ¶
type UserServiceClient interface {
GetUserInfo(ctx context.Context, in *GetUserInfoArgs, opts ...grpc.CallOption) (*GetUserInfoReply, error)
}
UserServiceClient is the client API for UserService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface { GetUserInfo(context.Context, *GetUserInfoArgs) (*GetUserInfoReply, error) // contains filtered or unexported methods }
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility