The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
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.
 
 
 
 
 
 
grafana/pkg/services/searchV2/extender.go

48 lines
1.1 KiB

package searchV2
import (
"github.com/blugelabs/bluge"
"github.com/grafana/grafana-plugin-sdk-go/data"
)
type ExtendDashboardFunc func(uid string, doc *bluge.Document) error
type FramerFunc func(field string, value []byte)
type QueryExtender interface {
GetFramer(frame *data.Frame) FramerFunc
}
type DocumentExtender interface {
GetDashboardExtender(orgID int64, uids ...string) ExtendDashboardFunc
}
type DashboardIndexExtender interface {
GetDocumentExtender() DocumentExtender
GetQueryExtender(query DashboardQuery) QueryExtender
}
type NoopExtender struct{}
func (n NoopExtender) GetDocumentExtender() DocumentExtender {
return &NoopDocumentExtender{}
}
func (n NoopExtender) GetQueryExtender(query DashboardQuery) QueryExtender {
return &NoopQueryExtender{}
}
type NoopDocumentExtender struct{}
func (n NoopDocumentExtender) GetDashboardExtender(_ int64, _ ...string) ExtendDashboardFunc {
return func(uid string, doc *bluge.Document) error {
return nil
}
}
type NoopQueryExtender struct{}
func (n NoopQueryExtender) GetFramer(_ *data.Frame) FramerFunc {
return func(field string, value []byte) {
// really noop
}
}