MCPcopy
hub / github.com/connectrpc/connect-go / Ping

Method Ping

client_ext_test.go:807–817  ·  view source on GitHub ↗
(
	_ context.Context,
	req *connect.Request[pingv1.PingRequest],
)

Source from the content-addressed store, hash-verified

805}
806
807func (s *notModifiedPingServer) Ping(
808 _ context.Context,
809 req *connect.Request[pingv1.PingRequest],
810) (*connect.Response[pingv1.PingResponse], error) {
811 if req.HTTPMethod() == http.MethodGet && req.Header().Get("If-None-Match") == s.etag {
812 return nil, connect.NewNotModifiedError(http.Header{"Etag": []string{s.etag}})
813 }
814 resp := connect.NewResponse(&pingv1.PingResponse{})
815 resp.Header().Set("Etag", s.etag)
816 return resp, nil
817}
818
819type assertPeerInterceptor struct {
820 tb testing.TB

Callers

nothing calls this directly

Calls 5

NewNotModifiedErrorFunction · 0.92
NewResponseFunction · 0.92
HTTPMethodMethod · 0.65
GetMethod · 0.65
HeaderMethod · 0.65

Tested by

no test coverage detected