rpc

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEvent

func CreateEvent(evType int32, content []byte) *pb.Event

func CreateEventRequest

func CreateEventRequest(session *pb.Session, ev *pb.Event) *pb.EventReq

func CreateMessageRequest

func CreateMessageRequest(session *pb.Session, ev *pb.Event, to *pb.User) *pb.MessageReq

func CreateRequest

func CreateRequest() *pb.Request

func CreateRequestWithHead

func CreateRequestWithHead(head request.Head) *pb.Request

func CreateResponse

func CreateResponse(recvAt, clientAt int64, seqId string, code int32, desc string) *pb.Response

func CreateResponseWithHead

func CreateResponseWithHead(recvAt int64, req *pb.Request, code int32, desc string) *pb.Response

func CreateSession

func CreateSession(uid uint64, appId string, plat int32, token string) *pb.Session

func CreateSessionRequest

func CreateSessionRequest(session *pb.Session) *pb.SessionReq

func ReturnResponse

func ReturnResponse(rsp *pb.Response)

func WithError

func WithError(res *pb.Response, err error) *pb.Response

Types

type Client added in v0.2.11

type Client interface {
	QueryOnline(addr string, req *pb.SessionReq) (bool, error)
	QueryAllOnline(addr string, req *pb.SessionReq) (bool, error)
	// SendMsgAll
	// 给所有人发消息
	SendMsgAll(addr string, req *pb.MessageReq) (*pb.Response, error)

	// SendMsg
	// 发送消息
	SendMsg(addr string, req *pb.MessageReq) (*pb.Response, error)

	// GetUserList
	// 获取本地用户列表
	GetUserList(addr string, req *pb.EventReq) (*pb.CommonReply, error)

	// GetAllUserList
	// 获取机器用户列表
	GetAllUserList(addr string, req *pb.EventReq) (*pb.CommonReply, error)
}

Jump to

Keyboard shortcuts

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