MCPcopy
hub / github.com/tinode/chat / pbServCtrlSerializeBasic

Function pbServCtrlSerializeBasic

server/pbconverter.go:14–29  ·  view source on GitHub ↗
(ctrl *MsgServerCtrl)

Source from the content-addressed store, hash-verified

12)
13
14func pbServCtrlSerializeBasic(ctrl *MsgServerCtrl) *pbx.ServerCtrl {
15 var params map[string][]byte
16 if ctrl.Params != nil {
17 if in, ok := ctrl.Params.(map[string]any); ok {
18 params = interfaceMapToByteMap(in)
19 }
20 }
21
22 return &pbx.ServerCtrl{
23 Id: ctrl.Id,
24 Topic: ctrl.Topic,
25 Code: int32(ctrl.Code),
26 Text: ctrl.Text,
27 Params: params,
28 }
29}
30
31func pbServCtrlSerialize(ctrl *MsgServerCtrl) *pbx.ServerMsg_Ctrl {
32 return &pbx.ServerMsg_Ctrl{

Callers 1

pbServCtrlSerializeFunction · 0.85

Calls 1

interfaceMapToByteMapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…