forked from grafana.jool/grafana-jool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
443 B
18 lines
443 B
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
|
|
})
|
|
}
|
|
|