mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 02:52:27 +08:00

* feat: remove kube-aggregator for OSS and provide injection points with runner iface * upgrade authlib to support expiresIn * new FT * new FT again * update go.mod * get rid of the slice implementation * reconcile conflicts * gracefully handle enterprise not being linked situation with kubeAggregator FT true * allow dataplane agg and kube agg to both be added to delegate chain * make update-workspace * address feedback * revert go.mod changes * go.mod updates * elaborate on why and how of skipping the Ready channel handling * after rebase and make run
22 lines
618 B
Go
22 lines
618 B
Go
package options
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// NOTE: both dataplane aggregator and kubernetes aggregator (when enterprise is linked) have logic around
|
|
// setting this RoundTripper as ready, however, kubernetes aggregator part is skipped naturally,
|
|
// given it is invoked as part of the delegate chain headed by the dataplane aggregator, and not through
|
|
// its own Run method.
|
|
type RoundTripperFunc struct {
|
|
Ready chan struct{}
|
|
Fn func(req *http.Request) (*http.Response, error)
|
|
}
|
|
|
|
func (f *RoundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error) {
|
|
if f.Fn == nil {
|
|
<-f.Ready
|
|
}
|
|
return f.Fn(req)
|
|
}
|