NewTestServer creates a test server for test service. opts carries optional settings and does not need to be provided. If multiple opts are provided, only the first one is used.
(opts ...NewTestServerOptions)
| 698 | // settings and does not need to be provided. If multiple opts are provided, |
| 699 | // only the first one is used. |
| 700 | func NewTestServer(opts ...NewTestServerOptions) testgrpc.TestServiceServer { |
| 701 | if len(opts) > 0 { |
| 702 | return &testServer{metricsRecorder: opts[0].MetricsRecorder} |
| 703 | } |
| 704 | return &testServer{} |
| 705 | } |
| 706 | |
| 707 | func (s *testServer) EmptyCall(context.Context, *testpb.Empty) (*testpb.Empty, error) { |
| 708 | return new(testpb.Empty), nil |
no outgoing calls