gen/httpsender: NewSender accepts RequestOpt varargs
@@ -41,7 +41,7 @@ var DefaultResponseClassifier = ResponseClassifier(classifyResponse)
// NewSender generates a sender that uses the Mesos v1 HTTP API for encoding/decoding requests/responses.
// The ResponseClass is inferred from the first object generated by the given Request.
-func NewSender(cf ClientFunc) calls.Sender {
+func NewSender(cf ClientFunc, ro ...httpcli.RequestOpt) calls.Sender {
return calls.SenderFunc(func(ctx context.Context, r calls.Request) (mesos.Response, error) {
var (
obj = r.Call()
@@ -60,7 +60,7 @@ func NewSender(cf ClientFunc) calls.Sender {
req = calls.NonStreaming(obj)
}
- return cf(req, rc, httpcli.Context(ctx))
+ return cf(req, rc, append(ro, httpcli.Context(ctx))...)
})
}
`))
