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

Method LoggerbyInfoOneWayWithContext

tars/protocol/res/logf/Log.tars.go:301–347  ·  view source on GitHub ↗

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

(tarsCtx context.Context, info *LogInfo, buffer []string, opts ...map[string]string)

Source from the content-addressed store, hash-verified

299
300// LoggerbyInfoOneWayWithContext is the proxy function for the method defined in the tars file, with the context
301func (obj *Log) LoggerbyInfoOneWayWithContext(tarsCtx context.Context, info *LogInfo, buffer []string, opts ...map[string]string) (err error) {
302 var (
303 length int32
304 have bool
305 ty byte
306 )
307 buf := codec.NewBuffer()
308 err = info.WriteBlock(buf, 1)
309 if err != nil {
310 return err
311 }
312
313 err = buf.WriteHead(codec.LIST, 2)
314 if err != nil {
315 return err
316 }
317 err = buf.WriteInt32(int32(len(buffer)), 0)
318 if err != nil {
319 return err
320 }
321 for _, v := range buffer {
322 err = buf.WriteString(v, 0)
323 if err != nil {
324 return err
325 }
326 }
327
328 var statusMap map[string]string
329 var contextMap map[string]string
330 if len(opts) == 1 {
331 contextMap = opts[0]
332 } else if len(opts) == 2 {
333 contextMap = opts[0]
334 statusMap = opts[1]
335 }
336
337 tarsResp := new(requestf.ResponsePacket)
338 err = obj.servant.TarsInvoke(tarsCtx, 1, "loggerbyInfo", buf.ToBytes(), statusMap, contextMap, tarsResp)
339 if err != nil {
340 return err
341 }
342
343 _ = length
344 _ = have
345 _ = ty
346 return nil
347}
348
349// Dispatch is used to call the server side implement for the method defined in the tars file. withContext shows using context or not.
350func (obj *Log) Dispatch(tarsCtx context.Context, val interface{}, tarsReq *requestf.RequestPacket, tarsResp *requestf.ResponsePacket, withContext bool) (err error) {

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected