grpc

package
v0.0.0-...-63a9e4b Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 20 Imported by: 0

README

仅用于初期测试目的

Documentation

Index

Constants

View Source
const (
	CoreProtocolVersion    = "1.1"
	CoreProtocolVersionInt = 0x010100
	GatewayVersionInt      = 0x010000
)
View Source
const (
	CANNOT_FOUND_FWDRS = "Something was wrong. NO fwdrs definition can be FOUND."
)

Variables

This section is empty.

Functions

func BaseResult

func BaseResult(ok bool, count int32, msg string, errCode int32, data []*any.Any) (res *v10.Result)

func ErrorBaseResult

func ErrorBaseResult(errCode int, msg string) (res *v10.Result)

func StartServer

func StartServer()

StartServer to start the grpc server

func StopServer

func StopServer()

StopServer to stop the grpc server

Types

type ApplyService

type ApplyService struct {
}

func (*ApplyService) FetchApplyByUid

func (*ApplyService) FetchApplyByUid(ctx context.Context, req *v10.ApplyRequest) (*v10.Result, error)

type CmdFunc

type CmdFunc func(from WsClientSkel, body []byte)

type CmdInfo

type CmdInfo struct {
	Op          v10.Op
	OpAck       v10.Op
	Target      func(ctx context.Context, req proto.Message) (res proto.Message, err error)
	InTemplate  func() proto.Message
	OutTemplate func(op v10.Op, seq uint32, errCode v10.Err) proto.Message // by xmas()

}

CmdInfo 为 ws 端提供调用转换。 ws 服务端收到报文后,按照 Op 指令的不同直接调用 ImCoreService.PooledInvoke() 从而实现到GRPC调用的转换

type ImCorePrivateService

type ImCorePrivateService struct {
}
var PrivateInstance *ImCorePrivateService

func NewImCorePrivateService

func NewImCorePrivateService() *ImCorePrivateService

func (*ImCorePrivateService) ExchangeNotifyingUsers

func (s *ImCorePrivateService) ExchangeNotifyingUsers(ctx context.Context, req *v10.ExchangeNotifyingUsersReq) (res *v10.ExchangeNotifyingUsersReply, err error)

func (*ImCorePrivateService) Shutdown

func (s *ImCorePrivateService) Shutdown()

type ImCoreService

type ImCoreService struct {
	// contains filtered or unexported fields
}

ImCoreService 是 vx-core 的主要 GRPC 服务

var (
	Instance *ImCoreService
)

func NewImCoreService

func NewImCoreService() *ImCoreService

func (*ImCoreService) AckMsg

func (s *ImCoreService) AckMsg(ctx context.Context, req *v10.AckMsgReq) (res *v10.AckMsgReply, err error)

func (*ImCoreService) AckMsgX

func (s *ImCoreService) AckMsgX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) AddContact

func (s *ImCoreService) AddContact(ctx context.Context, req *v10.AddContactReq) (res *v10.AddContactReply, err error)

func (*ImCoreService) AddContactX

func (s *ImCoreService) AddContactX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) AddFriend

func (s *ImCoreService) AddFriend(ctx context.Context, req *v10.AddFriendReq) (res *v10.AddFriendReply, err error)

func (*ImCoreService) AddFriendX

func (s *ImCoreService) AddFriendX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) Broadcast

func (s *ImCoreService) Broadcast(ctx context.Context, req *v10.BroadcastReq) (res *v10.BroadcastReply, err error)

func (*ImCoreService) BroadcastRoom

func (s *ImCoreService) BroadcastRoom(ctx context.Context, req *v10.BroadcastRoomReq) (res *v10.BroadcastRoomReply, err error)

func (*ImCoreService) BroadcastRoomX

func (s *ImCoreService) BroadcastRoomX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) BroadcastX

func (s *ImCoreService) BroadcastX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) CircleOperate

func (s *ImCoreService) CircleOperate(ctx context.Context, req *v10.CircleAllReq) (res *v10.CircleAllReply, err error)

func (*ImCoreService) CircleOperateX

func (s *ImCoreService) CircleOperateX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) Close

func (s *ImCoreService) Close(ctx context.Context, req *v10.Empty) (empty *v10.Empty, err error)

func (*ImCoreService) CloseX

func (s *ImCoreService) CloseX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) ContactOperate

func (s *ImCoreService) ContactOperate(ctx context.Context, req *v10.ContactAllReq) (res *v10.ContactAllReply, err error)

func (*ImCoreService) ContactOperateX

func (s *ImCoreService) ContactOperateX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) DeleteFriend

func (s *ImCoreService) DeleteFriend(ctx context.Context, req *v10.DeleteFriendReq) (res *v10.DeleteFriendReply, err error)

func (*ImCoreService) DeleteFriendX

func (s *ImCoreService) DeleteFriendX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) GenerateQrCode

func (s *ImCoreService) GenerateQrCode(ctx context.Context, req *v10.GenerateQrCodeReq) (res *v10.GenerateQrCodeReply, err error)

func (*ImCoreService) GenerateQrCodeX

func (s *ImCoreService) GenerateQrCodeX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) Get

func (*ImCoreService) GetContact

func (s *ImCoreService) GetContact(ctx context.Context, req *v10.GetContactReq) (res *v10.GetContactReply, err error)

func (*ImCoreService) GetContactX

func (s *ImCoreService) GetContactX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) GetFriendList

func (s *ImCoreService) GetFriendList(ctx context.Context, req *v10.GetFriendListReq) (res *v10.GetFriendListReply, err error)

func (*ImCoreService) GetFriendListX

func (s *ImCoreService) GetFriendListX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) GetMsgHistory

func (s *ImCoreService) GetMsgHistory(ctx context.Context, req *v10.GetMsgHistoryReq) (res *v10.GetMsgHistoryReply, err error)

func (*ImCoreService) GetMsgHistoryX

func (s *ImCoreService) GetMsgHistoryX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) GetMsgList

func (s *ImCoreService) GetMsgList(ctx context.Context, req *v10.GetMsgListReq) (res *v10.GetMsgListReply, err error)

func (*ImCoreService) GetMsgListX

func (s *ImCoreService) GetMsgListX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) GetNotReadConversationSet

func (s *ImCoreService) GetNotReadConversationSet(ctx context.Context, req *v10.GetNotReadConversationSetReq) (res *v10.GetNotReadConversationSetReply, err error)

func (*ImCoreService) GetNotReadConversationSetX

func (s *ImCoreService) GetNotReadConversationSetX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) GetOffLineConversationSet

func (s *ImCoreService) GetOffLineConversationSet(ctx context.Context, req *v10.GetOffLineConversationSetReq) (res *v10.GetOffLineConversationSetReply, err error)

func (*ImCoreService) GetOffLineConversationSetX

func (s *ImCoreService) GetOffLineConversationSetX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) GetUserContacts

func (s *ImCoreService) GetUserContacts(ctx context.Context, req *v10.GetUserContactsReq) (res *v10.GetUserContactsReply, err error)

func (*ImCoreService) GetUserContactsX

func (s *ImCoreService) GetUserContactsX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) GetX

func (s *ImCoreService) GetX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) Handshake

func (s *ImCoreService) Handshake(ctx context.Context, req *v10.HandshakeReq) (res *v10.ServiceDiag, err error)

func (*ImCoreService) HandshakeX

func (s *ImCoreService) HandshakeX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) ListContacts

func (s *ImCoreService) ListContacts(ctx context.Context, req *v10.ListContactsReq) (res *v10.ListContactsReply, err error)

func (*ImCoreService) ListContactsX

func (s *ImCoreService) ListContactsX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) Login

func (s *ImCoreService) Login(ctx context.Context, request *v10.AuthReq) (res *v10.AuthReply, err error)

func (*ImCoreService) LoginV11

func (s *ImCoreService) LoginV11(ctx context.Context, req *v10.AuthReq) (res *v10.AuthReply, err error)

func (*ImCoreService) LoginV11X

func (s *ImCoreService) LoginV11X(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) Nothing

func (s *ImCoreService) Nothing(ctx context.Context, req *v10.Empty) (res *v10.Result, err error)

func (*ImCoreService) NothingX

func (s *ImCoreService) NothingX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) Ping

func (s *ImCoreService) Ping(ctx context.Context, req *v10.Empty) (empty *v10.Empty, err error)

func (*ImCoreService) PingX

func (s *ImCoreService) PingX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) PooledInvoke

func (s *ImCoreService) PooledInvoke(op v10.Op, from WsClientSkel, body []byte) (err error)

func (*ImCoreService) PushMsg

func (s *ImCoreService) PushMsg(ctx context.Context, req *v10.PushMsgReq) (res *v10.PushMsgReply, err error)

//PushMsg push by key or mid rpc PushMsg (PushMsgReq) returns (PushMsgReply); // Broadcast send to every entity rpc Broadcast (BroadcastReq) returns (BroadcastReply); // BroadcastRoom broadcast to one room rpc BroadcastRoom (BroadcastRoomReq) returns (BroadcastRoomReply); // Rooms get all rooms rpc Rooms (RoomsReq) returns (RoomsReply);

func (*ImCoreService) PushMsgX

func (s *ImCoreService) PushMsgX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) RefreshToken

func (s *ImCoreService) RefreshToken(ctx context.Context, request *v10.AuthReq) (res *v10.AuthReply, err error)

func (*ImCoreService) RefreshTokenV11

func (s *ImCoreService) RefreshTokenV11(ctx context.Context, req *v10.AuthReq) (res *v10.AuthReply, err error)

func (*ImCoreService) RefreshTokenV11X

func (s *ImCoreService) RefreshTokenV11X(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) RefreshUserInfo

func (s *ImCoreService) RefreshUserInfo(ctx context.Context, request *v10.AuthReq) (res *v10.AuthReply, err error)

func (*ImCoreService) RegisterV11

func (s *ImCoreService) RegisterV11(ctx context.Context, req *v10.AuthReq) (res *v10.AuthReply, err error)

func (*ImCoreService) RegisterV11X

func (s *ImCoreService) RegisterV11X(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) RemoveContact

func (s *ImCoreService) RemoveContact(ctx context.Context, req *v10.RemoveContactReq) (res *v10.RemoveContactReply, err error)

func (*ImCoreService) RemoveContactX

func (s *ImCoreService) RemoveContactX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) Rooms

func (s *ImCoreService) Rooms(ctx context.Context, req *v10.RoomsReq) (res *v10.RoomsReply, err error)

func (*ImCoreService) RoomsX

func (s *ImCoreService) RoomsX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) SearchGlobal

func (s *ImCoreService) SearchGlobal(ctx context.Context, req *v10.SearchGlobalReq) (res *v10.SearchGlobalReply, err error)

func (*ImCoreService) SearchGlobalX

func (s *ImCoreService) SearchGlobalX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) SendMail

func (s *ImCoreService) SendMail(ctx context.Context, req *v10.Empty) (res *v10.Empty, err error)

func (*ImCoreService) SendMailX

func (s *ImCoreService) SendMailX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) SendMsg

func (s *ImCoreService) SendMsg(ctx context.Context, req *v10.SendMsgReq) (res *v10.SendMsgReply, err error)

SendMsg send the message of a client/user's device. rpc SendMsg (SendMsgReq) returns (SendMsgReply)

func (*ImCoreService) SendMsgX

func (s *ImCoreService) SendMsgX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) SendSMS

func (s *ImCoreService) SendSMS(ctx context.Context, req *v10.Empty) (res *v10.Empty, err error)

func (*ImCoreService) SendSMSX

func (s *ImCoreService) SendSMSX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) SetUserContacts

func (s *ImCoreService) SetUserContacts(ctx context.Context, req *v10.SetUserContactsReq) (res *v10.SetUserContactsReply, err error)

func (*ImCoreService) SetUserContactsX

func (s *ImCoreService) SetUserContactsX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) Shutdown

func (s *ImCoreService) Shutdown()

func (*ImCoreService) Subscribe

func (s *ImCoreService) Subscribe(ctx context.Context, req *v10.SubscribeReq) (res *v10.SubscribeReply, err error)

rpc Subscribe (SubscribeReq) returns (SubscribeReply); rpc Unsubscribe (UnsubscribeReq) returns (UnsubscribeReply);

func (*ImCoreService) SubscribeX

func (s *ImCoreService) SubscribeX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) Unsubscribe

func (s *ImCoreService) Unsubscribe(ctx context.Context, req *v10.UnsubscribeReq) (res *v10.UnsubscribeReply, err error)

func (*ImCoreService) UnsubscribeX

func (s *ImCoreService) UnsubscribeX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) UpdateContact

func (s *ImCoreService) UpdateContact(ctx context.Context, req *v10.UpdateContactReq) (res *v10.UpdateContactReply, err error)

func (*ImCoreService) UpdateContactX

func (s *ImCoreService) UpdateContactX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) UpdateFriend

func (s *ImCoreService) UpdateFriend(ctx context.Context, req *v10.UpdateFriendReq) (res *v10.UpdateFriendReply, err error)

func (*ImCoreService) UpdateFriendX

func (s *ImCoreService) UpdateFriendX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) UpdateMsg

func (s *ImCoreService) UpdateMsg(ctx context.Context, req *v10.UpdateMsgReq) (res *v10.UpdateMsgReply, err error)

func (*ImCoreService) UpdateMsgX

func (s *ImCoreService) UpdateMsgX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) UpdateUserInfo

func (s *ImCoreService) UpdateUserInfo(ctx context.Context, request *v10.AuthReq) (res *v10.AuthReply, err error)

func (*ImCoreService) UploadIdCard

func (s *ImCoreService) UploadIdCard(ctx context.Context, req *v10.Empty) (res *v10.Empty, err error)

func (*ImCoreService) UploadIdCardX

func (s *ImCoreService) UploadIdCardX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) UploadVerifyAttachments

func (s *ImCoreService) UploadVerifyAttachments(ctx context.Context, req *v10.Empty) (res *v10.Empty, err error)

func (*ImCoreService) UploadVerifyAttachmentsX

func (s *ImCoreService) UploadVerifyAttachmentsX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) UserOperate

func (s *ImCoreService) UserOperate(ctx context.Context, req *v10.UserAllReq) (res *v10.UserAllReply, err error)

func (*ImCoreService) UserOperateX

func (s *ImCoreService) UserOperateX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) ValidateToken

func (s *ImCoreService) ValidateToken(ctx context.Context, request *v10.AuthReq) (res *v10.AuthReply, err error)

func (*ImCoreService) VerifyIdCard

func (s *ImCoreService) VerifyIdCard(ctx context.Context, req *v10.Empty) (res *v10.Empty, err error)

func (*ImCoreService) VerifyIdCardX

func (s *ImCoreService) VerifyIdCardX(ctx context.Context, req proto.Message) (res proto.Message, err error)

func (*ImCoreService) VerifyMobileNumber

func (s *ImCoreService) VerifyMobileNumber(ctx context.Context, req *v10.Empty) (res *v10.Empty, err error)

func (*ImCoreService) VerifyMobileNumberX

func (s *ImCoreService) VerifyMobileNumberX(ctx context.Context, req proto.Message) (res proto.Message, err error)

type Request

type Request struct {
	CmdInfo *CmdInfo
	From    WsClientSkel
	InParam []byte
}

type WsClientSkel

type WsClientSkel interface {
	PostBinaryMsg([]byte) // 向WS客户端写回响应报文
}

type XmasPM

type XmasPM interface {
	GetSeq() uint32
	GetProtoOp() v10.Op
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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