Invoke sends the RPC request on the wire and returns after response is received. This is typically called by generated code. All errors returned by Invoke are compatible with the status package.
(ctx context.Context, method string, args, reply any, opts ...CallOption)
| 27 | // |
| 28 | // All errors returned by Invoke are compatible with the status package. |
| 29 | func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply any, opts ...CallOption) error { |
| 30 | // allow interceptor to see all applicable call options, which means those |
| 31 | // configured as defaults from dial option as well as per-call options |
| 32 | opts = combine(cc.dopts.callOptions, opts) |
| 33 | |
| 34 | if cc.dopts.unaryInt != nil { |
| 35 | return cc.dopts.unaryInt(ctx, method, args, reply, cc, invoke, opts...) |
| 36 | } |
| 37 | return invoke(ctx, method, args, reply, cc, opts...) |
| 38 | } |
| 39 | |
| 40 | func combine(o1 []CallOption, o2 []CallOption) []CallOption { |
| 41 | // we don't use append because o1 could have extra capacity whose |