client: export types implementing CallOptions for access by interceptors (#1902)

This commit is contained in:
Joshua Humphries
2018-03-16 18:57:34 -04:00
committed by dfawley
parent ec9275ba9a
commit fa28bef939
4 changed files with 262 additions and 61 deletions

View File

@ -27,6 +27,10 @@ import (
//
// All errors returned by Invoke are compatible with the status package.
func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...CallOption) error {
// allow interceptor to see all applicable call options, which means those
// configured as defaults from dial option as well as per-call options
opts = append(cc.dopts.callOptions, opts...)
if cc.dopts.unaryInt != nil {
return cc.dopts.unaryInt(ctx, method, args, reply, cc, invoke, opts...)
}