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

Method newServerMessageEntry

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

Source from the content-addressed store, hash-verified

527}
528
529func (ed *expectedData) newServerMessageEntry(client bool, rpcID, inRPCID uint64, msg proto.Message) *binlogpb.GrpcLogEntry {
530 logger := binlogpb.GrpcLogEntry_LOGGER_CLIENT
531 if !client {
532 logger = binlogpb.GrpcLogEntry_LOGGER_SERVER
533 }
534 data, err := proto.Marshal(msg)
535 if err != nil {
536 grpclogLogger.Infof("binarylogging_testing: failed to marshal proto message: %v", err)
537 }
538 return &binlogpb.GrpcLogEntry{
539 Timestamp: nil,
540 CallId: rpcID,
541 SequenceIdWithinCall: inRPCID,
542 Type: binlogpb.GrpcLogEntry_EVENT_TYPE_SERVER_MESSAGE,
543 Logger: logger,
544 Payload: &binlogpb.GrpcLogEntry_Message{
545 Message: &binlogpb.Message{
546 Length: uint32(len(data)),
547 Data: data,
548 },
549 },
550 }
551}
552
553func (ed *expectedData) newHalfCloseEntry(client bool, rpcID, inRPCID uint64) *binlogpb.GrpcLogEntry {
554 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