MCPcopy
hub / github.com/TarsCloud/TarsGo / ReportMicMsgOneWayWithContext

Method ReportMicMsgOneWayWithContext

tars/protocol/res/statf/StatF.tars.go:155–205  ·  view source on GitHub ↗

ReportMicMsgOneWayWithContext is the proxy function for the method defined in the tars file, with the context

(tarsCtx context.Context, msg map[StatMicMsgHead]StatMicMsgBody, bFromClient bool, opts ...map[string]string)

Source from the content-addressed store, hash-verified

153
154// ReportMicMsgOneWayWithContext is the proxy function for the method defined in the tars file, with the context
155func (obj *StatF) ReportMicMsgOneWayWithContext(tarsCtx context.Context, msg map[StatMicMsgHead]StatMicMsgBody, bFromClient bool, opts ...map[string]string) (ret int32, err error) {
156 var (
157 length int32
158 have bool
159 ty byte
160 )
161 buf := codec.NewBuffer()
162 err = buf.WriteHead(codec.MAP, 1)
163 if err != nil {
164 return ret, err
165 }
166 err = buf.WriteInt32(int32(len(msg)), 0)
167 if err != nil {
168 return ret, err
169 }
170 for k1, v1 := range msg {
171 err = k1.WriteBlock(buf, 0)
172 if err != nil {
173 return ret, err
174 }
175 err = v1.WriteBlock(buf, 1)
176 if err != nil {
177 return ret, err
178 }
179 }
180
181 err = buf.WriteBool(bFromClient, 2)
182 if err != nil {
183 return ret, err
184 }
185
186 var statusMap map[string]string
187 var contextMap map[string]string
188 if len(opts) == 1 {
189 contextMap = opts[0]
190 } else if len(opts) == 2 {
191 contextMap = opts[0]
192 statusMap = opts[1]
193 }
194
195 tarsResp := new(requestf.ResponsePacket)
196 err = obj.servant.TarsInvoke(tarsCtx, 1, "reportMicMsg", buf.ToBytes(), statusMap, contextMap, tarsResp)
197 if err != nil {
198 return ret, err
199 }
200
201 _ = length
202 _ = have
203 _ = ty
204 return ret, nil
205}
206
207// ReportSampleMsg is the proxy function for the method defined in the tars file, with the context
208func (obj *StatF) ReportSampleMsg(msg []StatSampleMsg, opts ...map[string]string) (int32, error) {

Callers

nothing calls this directly

Calls 7

WriteHeadMethod · 0.95
WriteInt32Method · 0.95
WriteBoolMethod · 0.95
ToBytesMethod · 0.95
NewBufferFunction · 0.92
WriteBlockMethod · 0.65
TarsInvokeMethod · 0.65

Tested by

no test coverage detected