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

Function NewServer

health/server.go:53–58  ·  view source on GitHub ↗

NewServer returns a new Server.

()

Source from the content-addressed store, hash-verified

51
52// NewServer returns a new Server.
53func NewServer() *Server {
54 return &Server{
55 statusMap: map[string]healthpb.HealthCheckResponse_ServingStatus{"": healthpb.HealthCheckResponse_SERVING},
56 updates: make(map[string]map[healthgrpc.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus),
57 }
58}
59
60// Check implements `service Health`.
61func (s *Server) Check(_ context.Context, in *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error) {

Callers 10

mainFunction · 0.92
listenAndServeMethod · 0.92
mainFunction · 0.92
mainFunction · 0.92
TestRegisterMethod · 0.92
TestShutdownMethod · 0.70
TestListMethod · 0.70

Calls

no outgoing calls

Tested by 7

listenAndServeMethod · 0.74
TestRegisterMethod · 0.74
TestShutdownMethod · 0.56
TestListMethod · 0.56