Documentation ¶
Overview ¶
Package proto is a generated protocol buffer package.
It is generated from these files:
game.proto login.proto push.proto room.proto user.proto
It has these top-level messages:
GameRequest GameResponse LoginInfo LoginResult Message PushRequest RoomInfo RoomJoinRequest User
Index ¶
- func RegisterGameServerServer(s *grpc.Server, srv GameServerServer)
- func RegisterLoginServer(s *grpc.Server, srv LoginServer)
- func RegisterPushServerServer(s *grpc.Server, srv PushServerServer)
- func RegisterRoomServer(s *grpc.Server, srv RoomServer)
- type GameRequest
- type GameResponse
- type GameServerClient
- type GameServerServer
- type LoginClient
- type LoginInfo
- type LoginResult
- type LoginServer
- type Message
- type PushRequest
- type PushServerClient
- type PushServerServer
- type PushServer_FetchClient
- type PushServer_FetchServer
- type RoomClient
- type RoomInfo
- type RoomJoinRequest
- type RoomServer
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterGameServerServer ¶
func RegisterGameServerServer(s *grpc.Server, srv GameServerServer)
func RegisterLoginServer ¶
func RegisterLoginServer(s *grpc.Server, srv LoginServer)
func RegisterPushServerServer ¶
func RegisterPushServerServer(s *grpc.Server, srv PushServerServer)
func RegisterRoomServer ¶
func RegisterRoomServer(s *grpc.Server, srv RoomServer)
Types ¶
type GameRequest ¶
type GameRequest struct { Type int32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` Cards []int32 `protobuf:"varint,2,rep,packed,name=cards" json:"cards,omitempty"` }
func (*GameRequest) Descriptor ¶
func (*GameRequest) Descriptor() ([]byte, []int)
func (*GameRequest) GetCards ¶
func (m *GameRequest) GetCards() []int32
func (*GameRequest) GetType ¶
func (m *GameRequest) GetType() int32
func (*GameRequest) ProtoMessage ¶
func (*GameRequest) ProtoMessage()
func (*GameRequest) Reset ¶
func (m *GameRequest) Reset()
func (*GameRequest) String ¶
func (m *GameRequest) String() string
type GameResponse ¶
type GameResponse struct {
Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
}
func (*GameResponse) Descriptor ¶
func (*GameResponse) Descriptor() ([]byte, []int)
func (*GameResponse) GetCode ¶
func (m *GameResponse) GetCode() int32
func (*GameResponse) ProtoMessage ¶
func (*GameResponse) ProtoMessage()
func (*GameResponse) Reset ¶
func (m *GameResponse) Reset()
func (*GameResponse) String ¶
func (m *GameResponse) String() string
type GameServerClient ¶
type GameServerClient interface {
Request(ctx context.Context, in *GameRequest, opts ...grpc.CallOption) (*GameResponse, error)
}
func NewGameServerClient ¶
func NewGameServerClient(cc *grpc.ClientConn) GameServerClient
type GameServerServer ¶
type GameServerServer interface {
Request(context.Context, *GameRequest) (*GameResponse, error)
}
type LoginClient ¶
type LoginClient interface {
Login(ctx context.Context, in *LoginInfo, opts ...grpc.CallOption) (*LoginResult, error)
}
func NewLoginClient ¶
func NewLoginClient(cc *grpc.ClientConn) LoginClient
type LoginInfo ¶
type LoginInfo struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}
func (*LoginInfo) Descriptor ¶
func (*LoginInfo) ProtoMessage ¶
func (*LoginInfo) ProtoMessage()
type LoginResult ¶
type LoginResult struct {
Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
}
func (*LoginResult) Descriptor ¶
func (*LoginResult) Descriptor() ([]byte, []int)
func (*LoginResult) GetCode ¶
func (m *LoginResult) GetCode() int32
func (*LoginResult) ProtoMessage ¶
func (*LoginResult) ProtoMessage()
func (*LoginResult) Reset ¶
func (m *LoginResult) Reset()
func (*LoginResult) String ¶
func (m *LoginResult) String() string
type LoginServer ¶
type LoginServer interface {
Login(context.Context, *LoginInfo) (*LoginResult, error)
}
type Message ¶
type Message struct { Type int32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` Cards []int32 `protobuf:"varint,2,rep,packed,name=cards" json:"cards,omitempty"` }
推送的消息类型 出牌,叫地主,抢地主,加倍,
func (*Message) Descriptor ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
type PushRequest ¶
type PushRequest struct {
Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
}
func (*PushRequest) Descriptor ¶
func (*PushRequest) Descriptor() ([]byte, []int)
func (*PushRequest) GetToken ¶
func (m *PushRequest) GetToken() string
func (*PushRequest) ProtoMessage ¶
func (*PushRequest) ProtoMessage()
func (*PushRequest) Reset ¶
func (m *PushRequest) Reset()
func (*PushRequest) String ¶
func (m *PushRequest) String() string
type PushServerClient ¶
type PushServerClient interface {
Fetch(ctx context.Context, in *PushRequest, opts ...grpc.CallOption) (PushServer_FetchClient, error)
}
func NewPushServerClient ¶
func NewPushServerClient(cc *grpc.ClientConn) PushServerClient
type PushServerServer ¶
type PushServerServer interface {
Fetch(*PushRequest, PushServer_FetchServer) error
}
type PushServer_FetchClient ¶
type PushServer_FetchClient interface { Recv() (*Message, error) grpc.ClientStream }
type PushServer_FetchServer ¶
type PushServer_FetchServer interface { Send(*Message) error grpc.ServerStream }
type RoomClient ¶
type RoomClient interface { Join(ctx context.Context, in *RoomJoinRequest, opts ...grpc.CallOption) (*RoomInfo, error) Create(ctx context.Context, in *User, opts ...grpc.CallOption) (*RoomInfo, error) }
func NewRoomClient ¶
func NewRoomClient(cc *grpc.ClientConn) RoomClient
type RoomInfo ¶
type RoomInfo struct { Id int32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` Users []*User `protobuf:"bytes,2,rep,name=users" json:"users,omitempty"` }
func (*RoomInfo) Descriptor ¶
func (*RoomInfo) ProtoMessage ¶
func (*RoomInfo) ProtoMessage()
type RoomJoinRequest ¶
type RoomJoinRequest struct { Id int32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` UserId int32 `protobuf:"varint,2,opt,name=userId" json:"userId,omitempty"` }
func (*RoomJoinRequest) Descriptor ¶
func (*RoomJoinRequest) Descriptor() ([]byte, []int)
func (*RoomJoinRequest) GetId ¶
func (m *RoomJoinRequest) GetId() int32
func (*RoomJoinRequest) GetUserId ¶
func (m *RoomJoinRequest) GetUserId() int32
func (*RoomJoinRequest) ProtoMessage ¶
func (*RoomJoinRequest) ProtoMessage()
func (*RoomJoinRequest) Reset ¶
func (m *RoomJoinRequest) Reset()
func (*RoomJoinRequest) String ¶
func (m *RoomJoinRequest) String() string
type RoomServer ¶
type User ¶
type User struct { Id int32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` }
func (*User) Descriptor ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.