plugincontext

package
v11.1.4-modfix Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasePluginContextProvider

type BasePluginContextProvider interface {
	// GetBasePluginContext returns a plugin context for the given plugin and user.
	// It does not add DatasourceInstaceSettings or AppInstanceSettings
	GetBasePluginContext(ctx context.Context, plugin pluginstore.Plugin, user identity.Requester) backend.PluginContext
}

type BaseProvider

type BaseProvider struct {
	// contains filtered or unexported fields
}

func ProvideBaseService

func ProvideBaseService(cfg *setting.Cfg, pluginRequestConfigProvider pluginconfig.PluginRequestConfigProvider) *BaseProvider

func (*BaseProvider) GetBasePluginContext

func (p *BaseProvider) GetBasePluginContext(ctx context.Context, plugin pluginstore.Plugin, user identity.Requester) backend.PluginContext

type Provider

type Provider struct {
	*BaseProvider
	// contains filtered or unexported fields
}

func ProvideService

func ProvideService(cfg *setting.Cfg, cacheService *localcache.CacheService, pluginStore pluginstore.Store,
	dataSourceCache datasources.CacheService, dataSourceService datasources.DataSourceService,
	pluginSettingsService pluginsettings.Service, pluginRequestConfigProvider pluginconfig.PluginRequestConfigProvider) *Provider

func (*Provider) Get

func (p *Provider) Get(ctx context.Context, pluginID string, user identity.Requester, orgID int64) (backend.PluginContext, error)

Get will retrieve plugin context by the provided pluginID and orgID. This is intended to be used for app plugin requests. PluginContext.AppInstanceSettings will be resolved and appended to the returned context. Note: identity.Requester can be nil.

func (*Provider) GetDataSourceInstanceSettings

func (p *Provider) GetDataSourceInstanceSettings(ctx context.Context, uid string) (*backend.DataSourceInstanceSettings, error)

func (*Provider) GetWithDataSource

func (p *Provider) GetWithDataSource(ctx context.Context, pluginID string, user identity.Requester, ds *datasources.DataSource) (backend.PluginContext, error)

GetWithDataSource will retrieve plugin context by the provided pluginID and datasource. This is intended to be used for datasource plugin requests. PluginContext.DataSourceInstanceSettings will be resolved and appended to the returned context. Note: identity.Requester can be nil.

func (*Provider) InvalidateSettingsCache

func (p *Provider) InvalidateSettingsCache(_ context.Context, pluginID string)

func (*Provider) PluginContextForDataSource

func (p *Provider) PluginContextForDataSource(ctx context.Context, datasourceSettings *backend.DataSourceInstanceSettings) (backend.PluginContext, error)

PluginContextForDataSource will retrieve plugin context by the provided pluginID and datasource UID / K8s name. This is intended to be used for datasource API server plugin requests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL