MCPcopy Create free account
hub / github.com/LockGit/gochat / PushSingleMsg

Method PushSingleMsg

connect/rpc.go:110–130  ·  view source on GitHub ↗
(ctx context.Context, pushMsgReq *proto.PushMsgRequest, successReply *proto.SuccessReply)

Source from the content-addressed store, hash-verified

108}
109
110func (rpc *RpcConnectPush) PushSingleMsg(ctx context.Context, pushMsgReq *proto.PushMsgRequest, successReply *proto.SuccessReply) (err error) {
111 var (
112 bucket *Bucket
113 channel *Channel
114 )
115 logrus.Info("rpc PushMsg :%v ", pushMsgReq)
116 if pushMsgReq == nil {
117 logrus.Errorf("rpc PushSingleMsg() args:(%v)", pushMsgReq)
118 return
119 }
120 bucket = DefaultServer.Bucket(pushMsgReq.UserId)
121 if channel = bucket.Channel(pushMsgReq.UserId); channel != nil {
122 err = channel.Push(&pushMsgReq.Msg)
123 logrus.Infof("DefaultServer Channel err nil ,args: %v", pushMsgReq)
124 return
125 }
126 successReply.Code = config.SuccessReplyCode
127 successReply.Msg = config.SuccessReplyMsg
128 logrus.Infof("successReply:%v", successReply)
129 return
130}
131
132func (rpc *RpcConnectPush) PushRoomMsg(ctx context.Context, pushRoomMsgReq *proto.PushRoomMsgRequest, successReply *proto.SuccessReply) (err error) {
133 successReply.Code = config.SuccessReplyCode

Callers

nothing calls this directly

Calls 3

BucketMethod · 0.80
ChannelMethod · 0.80
PushMethod · 0.45

Tested by

no test coverage detected