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

Function GetSubChannel

channelz/internal/protoconv/subchannel.go:59–65  ·  view source on GitHub ↗

GetSubChannel returns the protobuf representation of the subchannel with the given ID.

(id int64)

Source from the content-addressed store, hash-verified

57// GetSubChannel returns the protobuf representation of the subchannel with the
58// given ID.
59func GetSubChannel(id int64) (*channelzpb.Subchannel, error) {
60 subChan := channelz.GetSubChannel(id)
61 if subChan == nil {
62 return nil, status.Errorf(codes.NotFound, "requested sub channel %d not found", id)
63 }
64 return subChannelToProto(subChan), nil
65}

Callers 1

GetSubchannelMethod · 0.92

Calls 3

GetSubChannelFunction · 0.92
ErrorfFunction · 0.92
subChannelToProtoFunction · 0.85

Tested by

no test coverage detected