proto

package
v0.0.0-...-ddaadf8 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

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

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) Descriptor() ([]byte, []int)

func (*LoginInfo) GetName

func (m *LoginInfo) GetName() string

func (*LoginInfo) ProtoMessage

func (*LoginInfo) ProtoMessage()

func (*LoginInfo) Reset

func (m *LoginInfo) Reset()

func (*LoginInfo) String

func (m *LoginInfo) String() string

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) Descriptor() ([]byte, []int)

func (*Message) GetCards

func (m *Message) GetCards() []int32

func (*Message) GetType

func (m *Message) GetType() int32

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

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) Descriptor() ([]byte, []int)

func (*RoomInfo) GetId

func (m *RoomInfo) GetId() int32

func (*RoomInfo) GetUsers

func (m *RoomInfo) GetUsers() []*User

func (*RoomInfo) ProtoMessage

func (*RoomInfo) ProtoMessage()

func (*RoomInfo) Reset

func (m *RoomInfo) Reset()

func (*RoomInfo) String

func (m *RoomInfo) String() string

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 RoomServer interface {
	Join(context.Context, *RoomJoinRequest) (*RoomInfo, error)
	Create(context.Context, *User) (*RoomInfo, error)
}

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) Descriptor() ([]byte, []int)

func (*User) GetId

func (m *User) GetId() int32

func (*User) GetName

func (m *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL