MCPcopy
hub / github.com/grpc/grpc-go / newClientMessageEntry

Method newClientMessageEntry

binarylog/binarylog_end2end_test.go:505–527  ·  view source on GitHub ↗
(client bool, rpcID, inRPCID uint64, msg proto.Message)

Source from the content-addressed store, hash-verified

503}
504
505func (ed *expectedData) newClientMessageEntry(client bool, rpcID, inRPCID uint64, msg proto.Message) *binlogpb.GrpcLogEntry {
506 logger := binlogpb.GrpcLogEntry_LOGGER_CLIENT
507 if !client {
508 logger = binlogpb.GrpcLogEntry_LOGGER_SERVER
509 }
510 data, err := proto.Marshal(msg)
511 if err != nil {
512 grpclogLogger.Infof("binarylogging_testing: failed to marshal proto message: %v", err)
513 }
514 return &binlogpb.GrpcLogEntry{
515 Timestamp: nil,
516 CallId: rpcID,
517 SequenceIdWithinCall: inRPCID,
518 Type: binlogpb.GrpcLogEntry_EVENT_TYPE_CLIENT_MESSAGE,
519 Logger: logger,
520 Payload: &binlogpb.GrpcLogEntry_Message{
521 Message: &binlogpb.Message{
522 Length: uint32(len(data)),
523 Data: data,
524 },
525 },
526 }
527}
528
529func (ed *expectedData) newServerMessageEntry(client bool, rpcID, inRPCID uint64, msg proto.Message) *binlogpb.GrpcLogEntry {
530 logger := binlogpb.GrpcLogEntry_LOGGER_CLIENT

Callers 2

toClientLogEntriesMethod · 0.95
toServerLogEntriesMethod · 0.95

Calls 2

MarshalMethod · 0.65
InfofMethod · 0.65

Tested by

no test coverage detected