Documentation ¶
Index ¶
- type DataSourceAPIBuilder
- func (b *DataSourceAPIBuilder) GetAPIGroupInfo(scheme *runtime.Scheme, codecs serializer.CodecFactory, ...) (*genericapiserver.APIGroupInfo, error)
- func (b *DataSourceAPIBuilder) GetAPIRoutes() *builder.APIRoutes
- func (b *DataSourceAPIBuilder) GetAuthorizer() authorizer.Authorizer
- func (b *DataSourceAPIBuilder) GetDesiredDualWriterMode(dualWrite bool, modeMap map[string]grafanarest.DualWriterMode) grafanarest.DualWriterMode
- func (b *DataSourceAPIBuilder) GetGroupVersion() schema.GroupVersion
- func (b *DataSourceAPIBuilder) GetOpenAPIDefinitions() openapi.GetOpenAPIDefinitions
- func (b *DataSourceAPIBuilder) InstallSchema(scheme *runtime.Scheme) error
- func (b *DataSourceAPIBuilder) PostProcessOpenAPI(oas *spec3.OpenAPI) (*spec3.OpenAPI, error)
- type DefaultQuerier
- func (q *DefaultQuerier) Datasource(ctx context.Context, name string) (*v0alpha1.DataSourceConnection, error)
- func (q *DefaultQuerier) Datasources(ctx context.Context) (*v0alpha1.DataSourceConnectionList, error)
- func (q *DefaultQuerier) Health(ctx context.Context, query *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (q *DefaultQuerier) Query(ctx context.Context, query *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (q *DefaultQuerier) Resource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- type DefaultQuerierProvider
- type PluginClient
- type PluginContextWrapper
- type PluginDatasourceProvider
- type Querier
- type QuerierFactoryFunc
- type QuerierProvider
- type ScopedPluginDatasourceProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSourceAPIBuilder ¶
type DataSourceAPIBuilder struct {
// contains filtered or unexported fields
}
DataSourceAPIBuilder is used just so wire has something unique to return
func NewDataSourceAPIBuilder ¶
func NewDataSourceAPIBuilder( plugin plugins.JSONData, client PluginClient, datasources PluginDatasourceProvider, contextProvider PluginContextWrapper, accessControl accesscontrol.AccessControl, loadQueryTypes bool, ) (*DataSourceAPIBuilder, error)
func RegisterAPIService ¶
func RegisterAPIService( features featuremgmt.FeatureToggles, apiRegistrar builder.APIRegistrar, pluginClient plugins.Client, datasources ScopedPluginDatasourceProvider, contextProvider PluginContextWrapper, pluginStore pluginstore.Store, accessControl accesscontrol.AccessControl, ) (*DataSourceAPIBuilder, error)
func (*DataSourceAPIBuilder) GetAPIGroupInfo ¶
func (b *DataSourceAPIBuilder) GetAPIGroupInfo( scheme *runtime.Scheme, codecs serializer.CodecFactory, _ generic.RESTOptionsGetter, _ grafanarest.DualWriterMode, ) (*genericapiserver.APIGroupInfo, error)
func (*DataSourceAPIBuilder) GetAPIRoutes ¶
func (b *DataSourceAPIBuilder) GetAPIRoutes() *builder.APIRoutes
Register additional routes with the server
func (*DataSourceAPIBuilder) GetAuthorizer ¶
func (b *DataSourceAPIBuilder) GetAuthorizer() authorizer.Authorizer
func (*DataSourceAPIBuilder) GetDesiredDualWriterMode ¶
func (b *DataSourceAPIBuilder) GetDesiredDualWriterMode(dualWrite bool, modeMap map[string]grafanarest.DualWriterMode) grafanarest.DualWriterMode
func (*DataSourceAPIBuilder) GetGroupVersion ¶
func (b *DataSourceAPIBuilder) GetGroupVersion() schema.GroupVersion
func (*DataSourceAPIBuilder) GetOpenAPIDefinitions ¶
func (b *DataSourceAPIBuilder) GetOpenAPIDefinitions() openapi.GetOpenAPIDefinitions
func (*DataSourceAPIBuilder) InstallSchema ¶
func (b *DataSourceAPIBuilder) InstallSchema(scheme *runtime.Scheme) error
func (*DataSourceAPIBuilder) PostProcessOpenAPI ¶
type DefaultQuerier ¶
type DefaultQuerier struct {
// contains filtered or unexported fields
}
func NewDefaultQuerier ¶
func NewDefaultQuerier( connectionResourceInfo common.ResourceInfo, pluginJSON plugins.JSONData, pluginClient plugins.Client, dsService datasources.DataSourceService, dsCache datasources.CacheService, ) *DefaultQuerier
func (*DefaultQuerier) Datasource ¶
func (q *DefaultQuerier) Datasource(ctx context.Context, name string) (*v0alpha1.DataSourceConnection, error)
func (*DefaultQuerier) Datasources ¶
func (q *DefaultQuerier) Datasources(ctx context.Context) (*v0alpha1.DataSourceConnectionList, error)
func (*DefaultQuerier) Health ¶
func (q *DefaultQuerier) Health(ctx context.Context, query *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*DefaultQuerier) Query ¶
func (q *DefaultQuerier) Query(ctx context.Context, query *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*DefaultQuerier) Resource ¶
func (q *DefaultQuerier) Resource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
type DefaultQuerierProvider ¶
type DefaultQuerierProvider struct {
// contains filtered or unexported fields
}
func NewQuerierProvider ¶
func NewQuerierProvider(factory QuerierFactoryFunc) *DefaultQuerierProvider
func ProvideDefaultQuerierProvider ¶
func ProvideDefaultQuerierProvider(pluginClient plugins.Client, dsService datasources.DataSourceService, dsCache datasources.CacheService) *DefaultQuerierProvider
type PluginClient ¶
type PluginClient interface { backend.QueryDataHandler backend.CheckHealthHandler backend.CallResourceHandler }
PluginClient is a subset of the plugins.Client interface with only the functions supported (yet) by the datasource API
type PluginContextWrapper ¶
type PluginContextWrapper interface {
PluginContextForDataSource(ctx context.Context, datasourceSettings *backend.DataSourceInstanceSettings) (backend.PluginContext, error)
}
PluginContext requires adding system settings (feature flags, etc) to the datasource config
type PluginDatasourceProvider ¶
type PluginDatasourceProvider interface { // Get gets a specific datasource (that the user in context can see) Get(ctx context.Context, uid string) (*v0alpha1.DataSourceConnection, error) // List lists all data sources the user in context can see List(ctx context.Context) (*v0alpha1.DataSourceConnectionList, error) // Return settings (decrypted!) for a specific plugin // This will require "query" permission for the user in context GetInstanceSettings(ctx context.Context, uid string) (*backend.DataSourceInstanceSettings, error) }
This provides access to settings saved in the database. Authorization checks will happen within each function, and the user in ctx will limit which namespace/tenant/org we are talking to
type Querier ¶
type Querier interface { // Query runs the query on behalf of the user in context. Query(ctx context.Context, query *backend.QueryDataRequest) (*backend.QueryDataResponse, error) // Health checks the health of the plugin. Health(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error) // Resource gets a resource plugin. Resource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error // Datasource gets all data source plugins (with elevated permissions). Datasource(ctx context.Context, name string) (*v0alpha1.DataSourceConnection, error) // Datasources lists all data sources (with elevated permissions). Datasources(ctx context.Context) (*v0alpha1.DataSourceConnectionList, error) }
Querier is the interface that wraps the Query method.
type QuerierFactoryFunc ¶
type QuerierProvider ¶
type ScopedPluginDatasourceProvider ¶
type ScopedPluginDatasourceProvider interface {
GetDatasourceProvider(pluginJson plugins.JSONData) PluginDatasourceProvider
}
func ProvideDefaultPluginConfigs ¶
func ProvideDefaultPluginConfigs( dsService datasources.DataSourceService, dsCache datasources.CacheService, contextProvider *plugincontext.Provider) ScopedPluginDatasourceProvider
Click to show internal directories.
Click to hide internal directories.