(t testpb.PayloadType, size int32)
| 709 | } |
| 710 | |
| 711 | func serverNewPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) { |
| 712 | if size < 0 { |
| 713 | return nil, fmt.Errorf("requested a response with invalid length %d", size) |
| 714 | } |
| 715 | body := make([]byte, size) |
| 716 | switch t { |
| 717 | case testpb.PayloadType_COMPRESSABLE: |
| 718 | default: |
| 719 | return nil, fmt.Errorf("unsupported payload type: %d", t) |
| 720 | } |
| 721 | return &testpb.Payload{ |
| 722 | Type: t, |
| 723 | Body: body, |
| 724 | }, nil |
| 725 | } |
| 726 | |
| 727 | func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { |
| 728 | st := in.GetResponseStatus() |
no test coverage detected