(ctx context.Context, method string, req Request)
| 134 | } |
| 135 | |
| 136 | func handleSend[R Result](ctx context.Context, method string, req Request) (R, error) { |
| 137 | mh := req.GetSession().sendingMethodHandler() |
| 138 | // mh might be user code, so ensure that it returns the right values for the jsonrpc2 protocol. |
| 139 | res, err := mh(ctx, method, req) |
| 140 | if err != nil { |
| 141 | var z R |
| 142 | return z, err |
| 143 | } |
| 144 | return res.(R), nil |
| 145 | } |
| 146 | |
| 147 | // defaultReceivingMethodHandler is the initial MethodHandler for servers and clients, before being wrapped by middleware. |
| 148 | func defaultReceivingMethodHandler[S Session](ctx context.Context, method string, req Request) (Result, error) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…