Plugins: Add baseMiddleware support (#87799)
This commit is contained in:
@@ -17,13 +17,15 @@ const forwardIDHeaderName = "X-Grafana-Id"
|
||||
func NewForwardIDMiddleware() plugins.ClientMiddleware {
|
||||
return plugins.ClientMiddlewareFunc(func(next plugins.Client) plugins.Client {
|
||||
return &ForwardIDMiddleware{
|
||||
next: next,
|
||||
baseMiddleware: baseMiddleware{
|
||||
next: next,
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type ForwardIDMiddleware struct {
|
||||
next plugins.Client
|
||||
baseMiddleware
|
||||
}
|
||||
|
||||
func (m *ForwardIDMiddleware) applyToken(ctx context.Context, pCtx backend.PluginContext, req backend.ForwardHTTPHeaders) error {
|
||||
@@ -79,19 +81,3 @@ func (m *ForwardIDMiddleware) CheckHealth(ctx context.Context, req *backend.Chec
|
||||
|
||||
return m.next.CheckHealth(ctx, req)
|
||||
}
|
||||
|
||||
func (m *ForwardIDMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error) {
|
||||
return m.next.CollectMetrics(ctx, req)
|
||||
}
|
||||
|
||||
func (m *ForwardIDMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error) {
|
||||
return m.next.SubscribeStream(ctx, req)
|
||||
}
|
||||
|
||||
func (m *ForwardIDMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error) {
|
||||
return m.next.PublishStream(ctx, req)
|
||||
}
|
||||
|
||||
func (m *ForwardIDMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error {
|
||||
return m.next.RunStream(ctx, req, sender)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user