rpc

package
v0.0.0-...-261bb52 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() (err error)

Init is func to initial comet rpc server

func ParseNetwork

func ParseNetwork(str string) (network, addr string, err error)

ParseNetwork is util func used to parse network

Types

type PushMsgArg

type PushMsgArg struct {
	UID string
	P   comet.Proto
}

PushMsgArg is struct of push msg arg

type Server

type Server int

Server is struct of Comet RPC Server

func (*Server) PushRoomMsg

func (rpc *Server) PushRoomMsg(ctx context.Context, args *comet.RoomMsgArg, SuccessReply *SuccessReply) (err error)

PushRoomMsg is func used tp push room msg

func (*Server) PushSingleMsg

func (rpc *Server) PushSingleMsg(ctx context.Context, args *PushMsgArg, SuccessReply *SuccessReply) (err error)

PushSingleMsg is rpc func used to push single msg

type SuccessReply

type SuccessReply struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

SuccessReply if struct of success reply

Jump to

Keyboard shortcuts

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