protos

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var (
	RPCType_name = map[int32]string{
		0: "Sys",
		1: "User",
	}
	RPCType_value = map[string]int32{
		"Sys":  0,
		"User": 1,
	}
)

Enum value maps for RPCType.

View Source
var File_docmsg_proto protoreflect.FileDescriptor
View Source
var File_error_proto protoreflect.FileDescriptor
View Source
var File_pitaya_proto protoreflect.FileDescriptor
View Source
var File_protodescriptor_proto protoreflect.FileDescriptor
View Source
var File_request_proto protoreflect.FileDescriptor
View Source
var File_response_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use BindMsg.ProtoReflect.Descriptor instead.

func (*BindMsg) GetFid

func (x *BindMsg) GetFid() string

func (*BindMsg) GetUid

func (x *BindMsg) GetUid() string

func (*BindMsg) ProtoMessage

func (*BindMsg) ProtoMessage()

func (*BindMsg) ProtoReflect

func (x *BindMsg) ProtoReflect() protoreflect.Message

func (*BindMsg) Reset

func (x *BindMsg) Reset()

func (*BindMsg) String

func (x *BindMsg) String() string

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

Deprecated: Use Doc.ProtoReflect.Descriptor instead.

func (*Doc) GetDoc

func (x *Doc) GetDoc() string

func (*Doc) ProtoMessage

func (*Doc) ProtoMessage()

func (*Doc) ProtoReflect

func (x *Doc) ProtoReflect() protoreflect.Message

func (*Doc) Reset

func (x *Doc) Reset()

func (*Doc) String

func (x *Doc) String() string

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

Deprecated: Use DocMsg.ProtoReflect.Descriptor instead.

func (*DocMsg) GetGetProtos

func (x *DocMsg) GetGetProtos() bool

func (*DocMsg) ProtoMessage

func (*DocMsg) ProtoMessage()

func (*DocMsg) ProtoReflect

func (x *DocMsg) ProtoReflect() protoreflect.Message

func (*DocMsg) Reset

func (x *DocMsg) Reset()

func (*DocMsg) String

func (x *DocMsg) String() string

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetCode

func (x *Error) GetCode() string

func (*Error) GetMetadata

func (x *Error) GetMetadata() map[string]string

func (*Error) GetMsg

func (x *Error) GetMsg() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

func (x *Error) ProtoReflect() protoreflect.Message

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

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

Deprecated: Use KickMsg.ProtoReflect.Descriptor instead.

func (*KickMsg) GetUserId

func (x *KickMsg) GetUserId() string

func (*KickMsg) ProtoMessage

func (*KickMsg) ProtoMessage()

func (*KickMsg) ProtoReflect

func (x *KickMsg) ProtoReflect() protoreflect.Message

func (*KickMsg) Reset

func (x *KickMsg) Reset()

func (*KickMsg) String

func (x *KickMsg) String() string

type MsgType

type MsgType int32
const (
	MsgType_MsgRequest  MsgType = 0
	MsgType_MsgNotify   MsgType = 1
	MsgType_MsgResponse MsgType = 2
	MsgType_MsgPush     MsgType = 3
)

func (MsgType) Descriptor

func (MsgType) Descriptor() protoreflect.EnumDescriptor

func (MsgType) Enum

func (x MsgType) Enum() *MsgType

func (MsgType) EnumDescriptor deprecated

func (MsgType) EnumDescriptor() ([]byte, []int)

Deprecated: Use MsgType.Descriptor instead.

func (MsgType) Number

func (x MsgType) Number() protoreflect.EnumNumber

func (MsgType) String

func (x MsgType) String() string

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

Deprecated: Use MsgV2.ProtoReflect.Descriptor instead.

func (*MsgV2) GetData added in v0.1.0

func (x *MsgV2) GetData() []byte

func (*MsgV2) GetEid added in v0.1.0

func (x *MsgV2) GetEid() string

func (*MsgV2) GetId added in v0.1.0

func (x *MsgV2) GetId() uint64

func (*MsgV2) GetReply added in v0.1.0

func (x *MsgV2) GetReply() string

func (*MsgV2) GetRoute added in v0.1.0

func (x *MsgV2) GetRoute() string

func (*MsgV2) GetTyp added in v0.1.0

func (x *MsgV2) GetTyp() string

func (*MsgV2) GetType added in v0.1.0

func (x *MsgV2) GetType() MsgType

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

func (*MsgV2) Reset added in v0.1.0

func (x *MsgV2) Reset()

func (*MsgV2) String added in v0.1.0

func (x *MsgV2) String() string

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

Deprecated: Use ProtoName.ProtoReflect.Descriptor instead.

func (*ProtoName) GetName

func (x *ProtoName) GetName() string

func (*ProtoName) ProtoMessage

func (*ProtoName) ProtoMessage()

func (*ProtoName) ProtoReflect

func (x *ProtoName) ProtoReflect() protoreflect.Message

func (*ProtoName) Reset

func (x *ProtoName) Reset()

func (*ProtoName) String

func (x *ProtoName) String() string

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

Deprecated: Use Push.ProtoReflect.Descriptor instead.

func (*Push) GetClientID added in v0.1.0

func (x *Push) GetClientID() int64

func (*Push) GetData

func (x *Push) GetData() []byte

func (*Push) GetRoute

func (x *Push) GetRoute() string

func (*Push) GetUid

func (x *Push) GetUid() string

func (*Push) ProtoMessage

func (*Push) ProtoMessage()

func (*Push) ProtoReflect

func (x *Push) ProtoReflect() protoreflect.Message

func (*Push) Reset

func (x *Push) Reset()

func (*Push) String

func (x *Push) String() string

type RPCType

type RPCType int32
const (
	RPCType_Sys  RPCType = 0
	RPCType_User RPCType = 1
)

func (RPCType) Descriptor

func (RPCType) Descriptor() protoreflect.EnumDescriptor

func (RPCType) Enum

func (x RPCType) Enum() *RPCType

func (RPCType) EnumDescriptor deprecated

func (RPCType) EnumDescriptor() ([]byte, []int)

Deprecated: Use RPCType.Descriptor instead.

func (RPCType) Number

func (x RPCType) Number() protoreflect.EnumNumber

func (RPCType) String

func (x RPCType) String() string

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetFrontendID

func (x *Request) GetFrontendID() string

func (*Request) GetMetadata

func (x *Request) GetMetadata() []byte

func (*Request) GetMsg

func (x *Request) GetMsg() *MsgV2

func (*Request) GetSession

func (x *Request) GetSession() *Session

func (*Request) GetType

func (x *Request) GetType() RPCType

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetData

func (x *Response) GetData() []byte

func (*Response) GetError

func (x *Response) GetError() *Error

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

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

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetId

func (x *Session) GetId() int64

func (*Session) GetServerID added in v0.1.0

func (x *Session) GetServerID() string

func (*Session) GetUid

func (x *Session) GetUid() string

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

func (x *Session) ProtoReflect() protoreflect.Message

func (*Session) Reset

func (x *Session) Reset()

func (*Session) String

func (x *Session) String() string

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) Call

func (*UnimplementedPitayaServer) KickUser

func (*UnimplementedPitayaServer) PushToUser

func (*UnimplementedPitayaServer) SessionBindRemote

func (*UnimplementedPitayaServer) SessionBindRemote(context.Context, *BindMsg) (*Response, error)

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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