defaultReceivingMethodHandler is the initial MethodHandler for servers and clients, before being wrapped by middleware.
(ctx context.Context, method string, req Request)
| 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) { |
| 149 | info, ok := req.GetSession().receivingMethodInfos()[method] |
| 150 | if !ok { |
| 151 | // This can be called from user code, with an arbitrary value for method. |
| 152 | return nil, jsonrpc2.ErrNotHandled |
| 153 | } |
| 154 | return info.handleMethod(ctx, method, req) |
| 155 | } |
| 156 | |
| 157 | func handleReceive[S Session](ctx context.Context, session S, jreq *jsonrpc.Request) (Result, error) { |
| 158 | info, err := checkRequest(jreq, session.receivingMethodInfos()) |
nothing calls this directly
no test coverage detected
searching dependent graphs…