Rename to CallFuncWrappers
This commit is contained in:
parent
c6b5237cce
commit
5ee585e77d
@ -53,7 +53,7 @@ type CallOptions struct {
|
|||||||
RequestTimeout time.Duration
|
RequestTimeout time.Duration
|
||||||
|
|
||||||
// Middleware for low level call func
|
// Middleware for low level call func
|
||||||
CallWrappers []CallFuncWrapper
|
CallFuncWrappers []CallFuncWrapper
|
||||||
|
|
||||||
// Other options for implementations of the interface
|
// Other options for implementations of the interface
|
||||||
// can be stored in a context
|
// can be stored in a context
|
||||||
@ -183,7 +183,7 @@ func Wrap(w Wrapper) Option {
|
|||||||
// Adds a Wrapper to the list of CallFunc wrappers
|
// Adds a Wrapper to the list of CallFunc wrappers
|
||||||
func WrapCallFunc(cw ...CallFuncWrapper) Option {
|
func WrapCallFunc(cw ...CallFuncWrapper) Option {
|
||||||
return func(o *Options) {
|
return func(o *Options) {
|
||||||
o.CallOptions.CallWrappers = append(o.CallOptions.CallWrappers, cw...)
|
o.CallOptions.CallFuncWrappers = append(o.CallOptions.CallFuncWrappers, cw...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,7 +229,7 @@ func WithSelectOption(so ...selector.SelectOption) CallOption {
|
|||||||
// WithCallFuncWrapper is a CallOption which adds to the existing CallFunc wrappers
|
// WithCallFuncWrapper is a CallOption which adds to the existing CallFunc wrappers
|
||||||
func WithCallFuncWrapper(cw ...CallFuncWrapper) CallOption {
|
func WithCallFuncWrapper(cw ...CallFuncWrapper) CallOption {
|
||||||
return func(o *CallOptions) {
|
return func(o *CallOptions) {
|
||||||
o.CallWrappers = append(o.CallWrappers, cw...)
|
o.CallFuncWrappers = append(o.CallFuncWrappers, cw...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,8 +279,8 @@ func (r *rpcClient) Call(ctx context.Context, request Request, response interfac
|
|||||||
|
|
||||||
// wrap the call in reverse
|
// wrap the call in reverse
|
||||||
rcall := r.call
|
rcall := r.call
|
||||||
for i := len(callOpts.CallWrappers); i > 0; i-- {
|
for i := len(callOpts.CallFuncWrappers); i > 0; i-- {
|
||||||
rcall = callOpts.CallWrappers[i-1](rcall)
|
rcall = callOpts.CallFuncWrappers[i-1](rcall)
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the call
|
// make the call
|
||||||
|
Loading…
Reference in New Issue
Block a user