Documentation ¶
Index ¶
- Constants
- Variables
- func GetGrafanaRequestIDHeaders(req *http.Request, cfg *setting.Cfg, logger log.Logger) map[string]string
- func IsRequestURLInAllowList(url *url.URL, cfg *setting.Cfg) bool
- func NewCachingMiddleware(cachingService caching.CachingService) plugins.ClientMiddleware
- func NewCachingMiddlewareWithFeatureManager(cachingService caching.CachingService, features featuremgmt.FeatureToggles) plugins.ClientMiddleware
- func NewClearAuthHeadersMiddleware() plugins.ClientMiddleware
- func NewContextualLoggerMiddleware() plugins.ClientMiddleware
- func NewCookiesMiddleware(skipCookiesNames []string) plugins.ClientMiddleware
- func NewForwardIDMiddleware() plugins.ClientMiddleware
- func NewHTTPClientMiddleware() plugins.ClientMiddleware
- func NewHostedGrafanaACHeaderMiddleware(cfg *setting.Cfg) plugins.ClientMiddleware
- func NewLoggerMiddleware(logger plog.Logger) plugins.ClientMiddleware
- func NewMetricsMiddleware(promRegisterer prometheus.Registerer, pluginRegistry registry.Service) plugins.ClientMiddleware
- func NewOAuthTokenMiddleware(oAuthTokenService oauthtoken.OAuthTokenService) plugins.ClientMiddleware
- func NewPluginRequestMetaMiddleware() plugins.ClientMiddleware
- func NewResourceResponseMiddleware() plugins.ClientMiddleware
- func NewStatusSourceMiddleware() plugins.ClientMiddleware
- func NewTracingHeaderMiddleware() plugins.ClientMiddleware
- func NewTracingMiddleware(tracer tracing.Tracer) plugins.ClientMiddleware
- func NewUserHeaderMiddleware() plugins.ClientMiddleware
- type CachingMiddleware
- func (m *CachingMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *CachingMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *CachingMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *CachingMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *CachingMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *CachingMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *CachingMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *CachingMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *CachingMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *CachingMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type ClearAuthHeadersMiddleware
- func (m *ClearAuthHeadersMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *ClearAuthHeadersMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *ClearAuthHeadersMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *ClearAuthHeadersMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *ClearAuthHeadersMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *ClearAuthHeadersMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *ClearAuthHeadersMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *ClearAuthHeadersMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *ClearAuthHeadersMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *ClearAuthHeadersMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type ContextualLoggerMiddleware
- func (m *ContextualLoggerMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *ContextualLoggerMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *ContextualLoggerMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *ContextualLoggerMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *ContextualLoggerMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *ContextualLoggerMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *ContextualLoggerMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *ContextualLoggerMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *ContextualLoggerMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *ContextualLoggerMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type CookiesMiddleware
- func (m *CookiesMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *CookiesMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *CookiesMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *CookiesMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *CookiesMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *CookiesMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *CookiesMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *CookiesMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *CookiesMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *CookiesMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type ForwardIDMiddleware
- func (m *ForwardIDMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *ForwardIDMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *ForwardIDMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *ForwardIDMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *ForwardIDMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *ForwardIDMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *ForwardIDMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *ForwardIDMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *ForwardIDMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *ForwardIDMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type HTTPClientMiddleware
- func (m *HTTPClientMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *HTTPClientMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *HTTPClientMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *HTTPClientMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *HTTPClientMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *HTTPClientMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *HTTPClientMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *HTTPClientMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *HTTPClientMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *HTTPClientMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type HostedGrafanaACHeaderMiddleware
- func (m *HostedGrafanaACHeaderMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *HostedGrafanaACHeaderMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *HostedGrafanaACHeaderMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *HostedGrafanaACHeaderMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *HostedGrafanaACHeaderMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *HostedGrafanaACHeaderMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *HostedGrafanaACHeaderMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *HostedGrafanaACHeaderMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *HostedGrafanaACHeaderMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *HostedGrafanaACHeaderMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type LoggerMiddleware
- func (m *LoggerMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *LoggerMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *LoggerMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *LoggerMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *LoggerMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *LoggerMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *LoggerMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *LoggerMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *LoggerMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *LoggerMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type MetricsMiddleware
- func (m *MetricsMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *MetricsMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *MetricsMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *MetricsMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *MetricsMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *MetricsMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *MetricsMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *MetricsMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *MetricsMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *MetricsMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type OAuthTokenMiddleware
- func (m *OAuthTokenMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *OAuthTokenMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *OAuthTokenMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *OAuthTokenMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *OAuthTokenMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *OAuthTokenMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *OAuthTokenMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *OAuthTokenMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *OAuthTokenMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *OAuthTokenMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type PluginRequestMetaMiddleware
- func (m *PluginRequestMetaMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *PluginRequestMetaMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *PluginRequestMetaMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *PluginRequestMetaMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *PluginRequestMetaMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *PluginRequestMetaMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *PluginRequestMetaMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *PluginRequestMetaMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *PluginRequestMetaMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *PluginRequestMetaMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type ResourceResponseMiddleware
- func (m *ResourceResponseMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *ResourceResponseMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *ResourceResponseMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *ResourceResponseMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *ResourceResponseMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *ResourceResponseMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *ResourceResponseMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *ResourceResponseMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *ResourceResponseMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *ResourceResponseMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type StatusSourceMiddleware
- func (m *StatusSourceMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *StatusSourceMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *StatusSourceMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *StatusSourceMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *StatusSourceMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *StatusSourceMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *StatusSourceMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *StatusSourceMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *StatusSourceMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *StatusSourceMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type TracingHeaderMiddleware
- func (m *TracingHeaderMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *TracingHeaderMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *TracingHeaderMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *TracingHeaderMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *TracingHeaderMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *TracingHeaderMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *TracingHeaderMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *TracingHeaderMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *TracingHeaderMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *TracingHeaderMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type TracingMiddleware
- func (m *TracingMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *TracingMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *TracingMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *TracingMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *TracingMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *TracingMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *TracingMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *TracingMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *TracingMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *TracingMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type UserHeaderMiddleware
- func (m *UserHeaderMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (m *UserHeaderMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (m *UserHeaderMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (m *UserHeaderMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (m *UserHeaderMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (m *UserHeaderMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (m *UserHeaderMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (m *UserHeaderMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (m *UserHeaderMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (m *UserHeaderMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
Constants ¶
const ( QueryPubdash = "pubdash" QueryDashboard = "dashboard" )
const GrafanaInternalRequest = "X-Grafana-Internal-Request"
const GrafanaRequestID = "X-Grafana-Request-Id"
const GrafanaSignedRequestID = "X-Grafana-Signed-Request-Id"
const XRealIPHeader = "X-Real-Ip"
Variables ¶
var QueryCachingRequestHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Namespace: metrics.ExporterName, Subsystem: "caching", Name: "query_caching_request_duration_seconds", Help: "histogram of grafana query endpoint requests in seconds", Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25, 50, 100}, }, []string{"datasource_type", "cache", "query_type"})
var ResourceCachingRequestHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Namespace: metrics.ExporterName, Subsystem: "caching", Name: "resource_caching_request_duration_seconds", Help: "histogram of grafana resource endpoint requests in seconds", Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25, 50, 100}, }, []string{"plugin_id", "cache"})
var ShouldCacheQueryHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Namespace: metrics.ExporterName, Subsystem: "caching", Name: "should_cache_query_request_duration_seconds", Help: "histogram of grafana query endpoint requests in seconds", Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25, 50, 100}, }, []string{"datasource_type", "cache", "shouldCache", "query_type"})
Functions ¶
func NewCachingMiddleware ¶
func NewCachingMiddleware(cachingService caching.CachingService) plugins.ClientMiddleware
NewCachingMiddleware creates a new plugins.ClientMiddleware that will attempt to read and write query results to the cache
func NewCachingMiddlewareWithFeatureManager ¶
func NewCachingMiddlewareWithFeatureManager(cachingService caching.CachingService, features featuremgmt.FeatureToggles) plugins.ClientMiddleware
NewCachingMiddlewareWithFeatureManager creates a new plugins.ClientMiddleware that will attempt to read and write query results to the cache with a feature manager
func NewClearAuthHeadersMiddleware ¶
func NewClearAuthHeadersMiddleware() plugins.ClientMiddleware
NewClearAuthHeadersMiddleware creates a new plugins.ClientMiddleware that will clear any outgoing HTTP headers that was part of the incoming HTTP request and used when authenticating to Grafana.
func NewContextualLoggerMiddleware ¶
func NewContextualLoggerMiddleware() plugins.ClientMiddleware
NewContextualLoggerMiddleware creates a new plugins.ClientMiddleware that adds a contextual logger to the request context.
func NewCookiesMiddleware ¶
func NewCookiesMiddleware(skipCookiesNames []string) plugins.ClientMiddleware
NewCookiesMiddleware creates a new plugins.ClientMiddleware that will forward incoming HTTP request Cookies to outgoing plugins.Client requests if the datasource has enabled forwarding of cookies (keepCookies).
func NewForwardIDMiddleware ¶
func NewForwardIDMiddleware() plugins.ClientMiddleware
NewForwardIDMiddleware creates a new plugins.ClientMiddleware that will set grafana id header on outgoing plugins.Client requests if the feature toggle FlagIdForwarding is enabled
func NewHTTPClientMiddleware ¶
func NewHTTPClientMiddleware() plugins.ClientMiddleware
NewHTTPClientMiddleware creates a new plugins.ClientMiddleware that will forward plugin request headers as outgoing HTTP headers.
func NewHostedGrafanaACHeaderMiddleware ¶
func NewHostedGrafanaACHeaderMiddleware(cfg *setting.Cfg) plugins.ClientMiddleware
NewHostedGrafanaACHeaderMiddleware creates a new plugins.ClientMiddleware that will generate a random request ID, sign it using internal key and populate X-Grafana-Request-ID with the request ID and X-Grafana-Signed-Request-ID with signed request ID. We can then use this to verify that the request is coming from hosted Grafana and is not an external request. This is used for IP range access control.
func NewLoggerMiddleware ¶
func NewLoggerMiddleware(logger plog.Logger) plugins.ClientMiddleware
NewLoggerMiddleware creates a new plugins.ClientMiddleware that will log requests.
func NewMetricsMiddleware ¶
func NewMetricsMiddleware(promRegisterer prometheus.Registerer, pluginRegistry registry.Service) plugins.ClientMiddleware
NewMetricsMiddleware returns a new MetricsMiddleware.
func NewOAuthTokenMiddleware ¶
func NewOAuthTokenMiddleware(oAuthTokenService oauthtoken.OAuthTokenService) plugins.ClientMiddleware
NewOAuthTokenMiddleware creates a new plugins.ClientMiddleware that will set OAuth token headers on outgoing plugins.Client requests if the datasource has enabled Forward OAuth Identity (oauthPassThru).
func NewPluginRequestMetaMiddleware ¶
func NewPluginRequestMetaMiddleware() plugins.ClientMiddleware
NewPluginRequestMetaMiddleware returns a new plugins.ClientMiddleware that sets up the default values for the plugin request meta in the context.Context. All middlewares that are executed after this one are be able to access plugin request meta via the pluginrequestmeta package.
func NewResourceResponseMiddleware ¶
func NewResourceResponseMiddleware() plugins.ClientMiddleware
NewResourceResponseMiddleware creates a new plugins.ClientMiddleware that will enforce HTTP header rules for backend.CallResourceResponse's.
func NewStatusSourceMiddleware ¶
func NewStatusSourceMiddleware() plugins.ClientMiddleware
NewStatusSourceMiddleware returns a new plugins.ClientMiddleware that sets the status source in the plugin request meta stored in the context.Context, according to the query data responses returned by QueryError. If at least one query data response has a "downstream" status source and there isn't one with a "plugin" status source, the plugin request meta in the context is set to "downstream".
func NewTracingHeaderMiddleware ¶
func NewTracingHeaderMiddleware() plugins.ClientMiddleware
NewTracingHeaderMiddleware creates a new plugins.ClientMiddleware that will populate useful tracing headers on outgoing plugins.Client and HTTP requests. Tracing headers are X-Datasource-Uid, X-Dashboard-Uid, X-Panel-Id, X-Grafana-Org-Id.
func NewTracingMiddleware ¶
func NewTracingMiddleware(tracer tracing.Tracer) plugins.ClientMiddleware
NewTracingMiddleware returns a new middleware that creates a new span on every method call.
func NewUserHeaderMiddleware ¶
func NewUserHeaderMiddleware() plugins.ClientMiddleware
NewUserHeaderMiddleware creates a new plugins.ClientMiddleware that will populate the X-Grafana-User header on outgoing plugins.Client requests.
Types ¶
type CachingMiddleware ¶
type CachingMiddleware struct {
// contains filtered or unexported fields
}
func (*CachingMiddleware) CallResource ¶
func (m *CachingMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
CallResource receives a resource request and attempts to access results already stored in the cache for that request. If data is found, it will return it immediately. Otherwise, it will perform the request as usual. The caller of CallResource is expected to explicitly update the cache with any responses. If the cache service is implemented, we capture the request duration as a metric. The service is expected to write any response headers.
func (*CachingMiddleware) CheckHealth ¶
func (m *CachingMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*CachingMiddleware) CollectMetrics ¶
func (m *CachingMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*CachingMiddleware) ConvertObject ¶
func (m *CachingMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*CachingMiddleware) MutateAdmission ¶
func (m *CachingMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*CachingMiddleware) PublishStream ¶
func (m *CachingMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*CachingMiddleware) QueryData ¶
func (m *CachingMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
QueryData receives a data request and attempts to access results already stored in the cache for that request. If data is found, it will return it immediately. Otherwise, it will perform the queries as usual, then write the response to the cache. If the cache service is implemented, we capture the request duration as a metric. The service is expected to write any response headers.
func (*CachingMiddleware) RunStream ¶
func (m *CachingMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*CachingMiddleware) SubscribeStream ¶
func (m *CachingMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*CachingMiddleware) ValidateAdmission ¶
func (m *CachingMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type ClearAuthHeadersMiddleware ¶
type ClearAuthHeadersMiddleware struct {
// contains filtered or unexported fields
}
func (*ClearAuthHeadersMiddleware) CallResource ¶
func (m *ClearAuthHeadersMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*ClearAuthHeadersMiddleware) CheckHealth ¶
func (m *ClearAuthHeadersMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*ClearAuthHeadersMiddleware) CollectMetrics ¶
func (m *ClearAuthHeadersMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*ClearAuthHeadersMiddleware) ConvertObject ¶
func (m *ClearAuthHeadersMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*ClearAuthHeadersMiddleware) MutateAdmission ¶
func (m *ClearAuthHeadersMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*ClearAuthHeadersMiddleware) PublishStream ¶
func (m *ClearAuthHeadersMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*ClearAuthHeadersMiddleware) QueryData ¶
func (m *ClearAuthHeadersMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*ClearAuthHeadersMiddleware) RunStream ¶
func (m *ClearAuthHeadersMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*ClearAuthHeadersMiddleware) SubscribeStream ¶
func (m *ClearAuthHeadersMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*ClearAuthHeadersMiddleware) ValidateAdmission ¶
func (m *ClearAuthHeadersMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type ContextualLoggerMiddleware ¶
type ContextualLoggerMiddleware struct {
// contains filtered or unexported fields
}
func (*ContextualLoggerMiddleware) CallResource ¶
func (m *ContextualLoggerMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*ContextualLoggerMiddleware) CheckHealth ¶
func (m *ContextualLoggerMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*ContextualLoggerMiddleware) CollectMetrics ¶
func (m *ContextualLoggerMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*ContextualLoggerMiddleware) ConvertObject ¶
func (m *ContextualLoggerMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*ContextualLoggerMiddleware) MutateAdmission ¶
func (m *ContextualLoggerMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*ContextualLoggerMiddleware) PublishStream ¶
func (m *ContextualLoggerMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*ContextualLoggerMiddleware) QueryData ¶
func (m *ContextualLoggerMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*ContextualLoggerMiddleware) RunStream ¶
func (m *ContextualLoggerMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*ContextualLoggerMiddleware) SubscribeStream ¶
func (m *ContextualLoggerMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*ContextualLoggerMiddleware) ValidateAdmission ¶
func (m *ContextualLoggerMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type CookiesMiddleware ¶
type CookiesMiddleware struct {
// contains filtered or unexported fields
}
func (*CookiesMiddleware) CallResource ¶
func (m *CookiesMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*CookiesMiddleware) CheckHealth ¶
func (m *CookiesMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*CookiesMiddleware) CollectMetrics ¶
func (m *CookiesMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*CookiesMiddleware) ConvertObject ¶
func (m *CookiesMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*CookiesMiddleware) MutateAdmission ¶
func (m *CookiesMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*CookiesMiddleware) PublishStream ¶
func (m *CookiesMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*CookiesMiddleware) QueryData ¶
func (m *CookiesMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*CookiesMiddleware) RunStream ¶
func (m *CookiesMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*CookiesMiddleware) SubscribeStream ¶
func (m *CookiesMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*CookiesMiddleware) ValidateAdmission ¶
func (m *CookiesMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type ForwardIDMiddleware ¶
type ForwardIDMiddleware struct {
// contains filtered or unexported fields
}
func (*ForwardIDMiddleware) CallResource ¶
func (m *ForwardIDMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*ForwardIDMiddleware) CheckHealth ¶
func (m *ForwardIDMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*ForwardIDMiddleware) CollectMetrics ¶
func (m *ForwardIDMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*ForwardIDMiddleware) ConvertObject ¶
func (m *ForwardIDMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*ForwardIDMiddleware) MutateAdmission ¶
func (m *ForwardIDMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*ForwardIDMiddleware) PublishStream ¶
func (m *ForwardIDMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*ForwardIDMiddleware) QueryData ¶
func (m *ForwardIDMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*ForwardIDMiddleware) RunStream ¶
func (m *ForwardIDMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*ForwardIDMiddleware) SubscribeStream ¶
func (m *ForwardIDMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*ForwardIDMiddleware) ValidateAdmission ¶
func (m *ForwardIDMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type HTTPClientMiddleware ¶
type HTTPClientMiddleware struct {
// contains filtered or unexported fields
}
func (*HTTPClientMiddleware) CallResource ¶
func (m *HTTPClientMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*HTTPClientMiddleware) CheckHealth ¶
func (m *HTTPClientMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*HTTPClientMiddleware) CollectMetrics ¶
func (m *HTTPClientMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*HTTPClientMiddleware) ConvertObject ¶
func (m *HTTPClientMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*HTTPClientMiddleware) MutateAdmission ¶
func (m *HTTPClientMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*HTTPClientMiddleware) PublishStream ¶
func (m *HTTPClientMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*HTTPClientMiddleware) QueryData ¶
func (m *HTTPClientMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*HTTPClientMiddleware) RunStream ¶
func (m *HTTPClientMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*HTTPClientMiddleware) SubscribeStream ¶
func (m *HTTPClientMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*HTTPClientMiddleware) ValidateAdmission ¶
func (m *HTTPClientMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type HostedGrafanaACHeaderMiddleware ¶
type HostedGrafanaACHeaderMiddleware struct {
// contains filtered or unexported fields
}
func (*HostedGrafanaACHeaderMiddleware) CallResource ¶
func (m *HostedGrafanaACHeaderMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*HostedGrafanaACHeaderMiddleware) CheckHealth ¶
func (m *HostedGrafanaACHeaderMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*HostedGrafanaACHeaderMiddleware) CollectMetrics ¶
func (m *HostedGrafanaACHeaderMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*HostedGrafanaACHeaderMiddleware) ConvertObject ¶
func (m *HostedGrafanaACHeaderMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*HostedGrafanaACHeaderMiddleware) MutateAdmission ¶
func (m *HostedGrafanaACHeaderMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*HostedGrafanaACHeaderMiddleware) PublishStream ¶
func (m *HostedGrafanaACHeaderMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*HostedGrafanaACHeaderMiddleware) QueryData ¶
func (m *HostedGrafanaACHeaderMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*HostedGrafanaACHeaderMiddleware) RunStream ¶
func (m *HostedGrafanaACHeaderMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*HostedGrafanaACHeaderMiddleware) SubscribeStream ¶
func (m *HostedGrafanaACHeaderMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*HostedGrafanaACHeaderMiddleware) ValidateAdmission ¶
func (m *HostedGrafanaACHeaderMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type LoggerMiddleware ¶
type LoggerMiddleware struct {
// contains filtered or unexported fields
}
func (*LoggerMiddleware) CallResource ¶
func (m *LoggerMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*LoggerMiddleware) CheckHealth ¶
func (m *LoggerMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*LoggerMiddleware) CollectMetrics ¶
func (m *LoggerMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*LoggerMiddleware) ConvertObject ¶
func (m *LoggerMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*LoggerMiddleware) MutateAdmission ¶
func (m *LoggerMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*LoggerMiddleware) PublishStream ¶
func (m *LoggerMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*LoggerMiddleware) QueryData ¶
func (m *LoggerMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*LoggerMiddleware) RunStream ¶
func (m *LoggerMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*LoggerMiddleware) SubscribeStream ¶
func (m *LoggerMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*LoggerMiddleware) ValidateAdmission ¶
func (m *LoggerMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type MetricsMiddleware ¶
type MetricsMiddleware struct {
// contains filtered or unexported fields
}
MetricsMiddleware is a middleware that instruments plugin requests. It tracks requests count, duration and size as prometheus metrics.
func (*MetricsMiddleware) CallResource ¶
func (m *MetricsMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*MetricsMiddleware) CheckHealth ¶
func (m *MetricsMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*MetricsMiddleware) CollectMetrics ¶
func (m *MetricsMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*MetricsMiddleware) ConvertObject ¶
func (m *MetricsMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
func (*MetricsMiddleware) MutateAdmission ¶
func (m *MetricsMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
func (*MetricsMiddleware) PublishStream ¶
func (m *MetricsMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*MetricsMiddleware) QueryData ¶
func (m *MetricsMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*MetricsMiddleware) RunStream ¶
func (m *MetricsMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*MetricsMiddleware) SubscribeStream ¶
func (m *MetricsMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*MetricsMiddleware) ValidateAdmission ¶
func (m *MetricsMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
type OAuthTokenMiddleware ¶
type OAuthTokenMiddleware struct {
// contains filtered or unexported fields
}
func (*OAuthTokenMiddleware) CallResource ¶
func (m *OAuthTokenMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*OAuthTokenMiddleware) CheckHealth ¶
func (m *OAuthTokenMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*OAuthTokenMiddleware) CollectMetrics ¶
func (m *OAuthTokenMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*OAuthTokenMiddleware) ConvertObject ¶
func (m *OAuthTokenMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*OAuthTokenMiddleware) MutateAdmission ¶
func (m *OAuthTokenMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*OAuthTokenMiddleware) PublishStream ¶
func (m *OAuthTokenMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*OAuthTokenMiddleware) QueryData ¶
func (m *OAuthTokenMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*OAuthTokenMiddleware) RunStream ¶
func (m *OAuthTokenMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*OAuthTokenMiddleware) SubscribeStream ¶
func (m *OAuthTokenMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*OAuthTokenMiddleware) ValidateAdmission ¶
func (m *OAuthTokenMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type PluginRequestMetaMiddleware ¶
type PluginRequestMetaMiddleware struct {
// contains filtered or unexported fields
}
func (*PluginRequestMetaMiddleware) CallResource ¶
func (m *PluginRequestMetaMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*PluginRequestMetaMiddleware) CheckHealth ¶
func (m *PluginRequestMetaMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*PluginRequestMetaMiddleware) CollectMetrics ¶
func (m *PluginRequestMetaMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*PluginRequestMetaMiddleware) ConvertObject ¶
func (m *PluginRequestMetaMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*PluginRequestMetaMiddleware) MutateAdmission ¶
func (m *PluginRequestMetaMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*PluginRequestMetaMiddleware) PublishStream ¶
func (m *PluginRequestMetaMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*PluginRequestMetaMiddleware) QueryData ¶
func (m *PluginRequestMetaMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*PluginRequestMetaMiddleware) RunStream ¶
func (m *PluginRequestMetaMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*PluginRequestMetaMiddleware) SubscribeStream ¶
func (m *PluginRequestMetaMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*PluginRequestMetaMiddleware) ValidateAdmission ¶
func (m *PluginRequestMetaMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type ResourceResponseMiddleware ¶
type ResourceResponseMiddleware struct {
// contains filtered or unexported fields
}
func (*ResourceResponseMiddleware) CallResource ¶
func (m *ResourceResponseMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*ResourceResponseMiddleware) CheckHealth ¶
func (m *ResourceResponseMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*ResourceResponseMiddleware) CollectMetrics ¶
func (m *ResourceResponseMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*ResourceResponseMiddleware) ConvertObject ¶
func (m *ResourceResponseMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*ResourceResponseMiddleware) MutateAdmission ¶
func (m *ResourceResponseMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*ResourceResponseMiddleware) PublishStream ¶
func (m *ResourceResponseMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*ResourceResponseMiddleware) QueryData ¶
func (m *ResourceResponseMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*ResourceResponseMiddleware) RunStream ¶
func (m *ResourceResponseMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*ResourceResponseMiddleware) SubscribeStream ¶
func (m *ResourceResponseMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*ResourceResponseMiddleware) ValidateAdmission ¶
func (m *ResourceResponseMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type StatusSourceMiddleware ¶
type StatusSourceMiddleware struct {
// contains filtered or unexported fields
}
func (*StatusSourceMiddleware) CallResource ¶
func (m *StatusSourceMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*StatusSourceMiddleware) CheckHealth ¶
func (m *StatusSourceMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*StatusSourceMiddleware) CollectMetrics ¶
func (m *StatusSourceMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*StatusSourceMiddleware) ConvertObject ¶
func (m *StatusSourceMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*StatusSourceMiddleware) MutateAdmission ¶
func (m *StatusSourceMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*StatusSourceMiddleware) PublishStream ¶
func (m *StatusSourceMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*StatusSourceMiddleware) QueryData ¶
func (m *StatusSourceMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*StatusSourceMiddleware) RunStream ¶
func (m *StatusSourceMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*StatusSourceMiddleware) SubscribeStream ¶
func (m *StatusSourceMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*StatusSourceMiddleware) ValidateAdmission ¶
func (m *StatusSourceMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type TracingHeaderMiddleware ¶
type TracingHeaderMiddleware struct {
// contains filtered or unexported fields
}
func (*TracingHeaderMiddleware) CallResource ¶
func (m *TracingHeaderMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*TracingHeaderMiddleware) CheckHealth ¶
func (m *TracingHeaderMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*TracingHeaderMiddleware) CollectMetrics ¶
func (m *TracingHeaderMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*TracingHeaderMiddleware) ConvertObject ¶
func (m *TracingHeaderMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*TracingHeaderMiddleware) MutateAdmission ¶
func (m *TracingHeaderMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*TracingHeaderMiddleware) PublishStream ¶
func (m *TracingHeaderMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*TracingHeaderMiddleware) QueryData ¶
func (m *TracingHeaderMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*TracingHeaderMiddleware) RunStream ¶
func (m *TracingHeaderMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*TracingHeaderMiddleware) SubscribeStream ¶
func (m *TracingHeaderMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*TracingHeaderMiddleware) ValidateAdmission ¶
func (m *TracingHeaderMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type TracingMiddleware ¶
type TracingMiddleware struct {
// contains filtered or unexported fields
}
func (*TracingMiddleware) CallResource ¶
func (m *TracingMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*TracingMiddleware) CheckHealth ¶
func (m *TracingMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*TracingMiddleware) CollectMetrics ¶
func (m *TracingMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*TracingMiddleware) ConvertObject ¶
func (m *TracingMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*TracingMiddleware) MutateAdmission ¶
func (m *TracingMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*TracingMiddleware) PublishStream ¶
func (m *TracingMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*TracingMiddleware) QueryData ¶
func (m *TracingMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*TracingMiddleware) RunStream ¶
func (m *TracingMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*TracingMiddleware) SubscribeStream ¶
func (m *TracingMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*TracingMiddleware) ValidateAdmission ¶
func (m *TracingMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
type UserHeaderMiddleware ¶
type UserHeaderMiddleware struct {
// contains filtered or unexported fields
}
func (*UserHeaderMiddleware) CallResource ¶
func (m *UserHeaderMiddleware) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*UserHeaderMiddleware) CheckHealth ¶
func (m *UserHeaderMiddleware) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*UserHeaderMiddleware) CollectMetrics ¶
func (m *UserHeaderMiddleware) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*UserHeaderMiddleware) ConvertObject ¶
func (m *UserHeaderMiddleware) ConvertObject(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
ConvertObject implements backend.AdmissionHandler.
func (*UserHeaderMiddleware) MutateAdmission ¶
func (m *UserHeaderMiddleware) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
MutateAdmission implements backend.AdmissionHandler.
func (*UserHeaderMiddleware) PublishStream ¶
func (m *UserHeaderMiddleware) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*UserHeaderMiddleware) QueryData ¶
func (m *UserHeaderMiddleware) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*UserHeaderMiddleware) RunStream ¶
func (m *UserHeaderMiddleware) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*UserHeaderMiddleware) SubscribeStream ¶
func (m *UserHeaderMiddleware) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*UserHeaderMiddleware) ValidateAdmission ¶
func (m *UserHeaderMiddleware) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
ValidateAdmission implements backend.AdmissionHandler.
Source Files ¶
- base_middleware.go
- caching_metrics.go
- caching_middleware.go
- clear_auth_headers_middleware.go
- contextual_logger_middleware.go
- cookies_middleware.go
- forward_id_middleware.go
- grafana_request_id_header_middleware.go
- httpclient_middleware.go
- logger_middleware.go
- metrics_middleware.go
- oauthtoken_middleware.go
- plugin_request_meta_middleware.go
- resource_response_middleware.go
- status_source_middleware.go
- testing.go
- tracing_header_middleware.go
- tracing_middleware.go
- user_header_middleware.go
- utils.go