Files
Marcus Efraimsson 60d0c8d0ec HTTP Client: Outgoing tracing middleware (#34466)
Following #33439 this adds support for outgoing tracing middleware 
in HTTP client provider.

Fixes #24004
2021-05-20 11:16:55 +02:00

19 lines
443 B
Go

package httpclientprovider
import (
"net/http"
"github.com/grafana/grafana-plugin-sdk-go/backend/httpclient"
)
type testContext struct {
callChain []string
}
func (c *testContext) createRoundTripper(name string) http.RoundTripper {
return httpclient.RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
c.callChain = append(c.callChain, name)
return &http.Response{StatusCode: http.StatusOK, Request: req}, nil
})
}