Documentation
¶
Index ¶
- func InitializeNoopTracerForTest() trace.Tracer
- type AssetProvider
- type FakeActionSetRegistry
- type FakeAuthService
- func (f *FakeAuthService) HasExternalService(ctx context.Context, pluginID string) (bool, error)
- func (f *FakeAuthService) RegisterExternalService(ctx context.Context, pluginID string, pType string, svc *auth.IAM) (*auth.ExternalService, error)
- func (f *FakeAuthService) RemoveExternalService(ctx context.Context, pluginID string) error
- type FakeBackendPlugin
- func (p *FakeBackendPlugin) Decommission() error
- func (p *FakeBackendPlugin) Exited() bool
- func (p *FakeBackendPlugin) IsDecommissioned() bool
- func (p *FakeBackendPlugin) IsManaged() bool
- func (p *FakeBackendPlugin) Kill()
- func (p *FakeBackendPlugin) Logger() log.Logger
- func (p *FakeBackendPlugin) Start(_ context.Context) error
- func (p *FakeBackendPlugin) Stop(_ context.Context) error
- func (p *FakeBackendPlugin) Target() backendplugin.Target
- type FakeBackendProcessProvider
- type FakeBootstrapper
- type FakeDiscoverer
- type FakeInitializer
- type FakeLicensingService
- type FakeLoader
- type FakePluginClient
- func (pc *FakePluginClient) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (pc *FakePluginClient) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (pc *FakePluginClient) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (pc *FakePluginClient) ConvertObjects(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (pc *FakePluginClient) Decommission() error
- func (pc *FakePluginClient) Exited() bool
- func (pc *FakePluginClient) IsDecommissioned() bool
- func (pc *FakePluginClient) IsManaged() bool
- func (pc *FakePluginClient) Logger() log.Logger
- func (pc *FakePluginClient) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (pc *FakePluginClient) PluginID() string
- func (pc *FakePluginClient) PublishStream(_ context.Context, _ *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (pc *FakePluginClient) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (pc *FakePluginClient) RunStream(_ context.Context, _ *backend.RunStreamRequest, _ *backend.StreamSender) error
- func (pc *FakePluginClient) Start(_ context.Context) error
- func (pc *FakePluginClient) Stop(_ context.Context) error
- func (pc *FakePluginClient) SubscribeStream(_ context.Context, _ *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (pc *FakePluginClient) Target() backendplugin.Target
- func (pc *FakePluginClient) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type FakePluginEnvProvider
- type FakePluginFS
- type FakePluginFileStore
- type FakePluginInstaller
- type FakePluginRegistry
- func (f *FakePluginRegistry) Add(_ context.Context, p *plugins.Plugin) error
- func (f *FakePluginRegistry) Plugin(_ context.Context, id, _ string) (*plugins.Plugin, bool)
- func (f *FakePluginRegistry) Plugins(_ context.Context) []*plugins.Plugin
- func (f *FakePluginRegistry) Remove(_ context.Context, id, _ string) error
- type FakePluginRepo
- func (r *FakePluginRepo) GetPluginArchive(ctx context.Context, pluginID, version string, opts repo.CompatOpts) (*repo.PluginArchive, error)
- func (r *FakePluginRepo) GetPluginArchiveByURL(ctx context.Context, archiveURL string, opts repo.CompatOpts) (*repo.PluginArchive, error)
- func (r *FakePluginRepo) GetPluginArchiveInfo(ctx context.Context, pluginID, version string, opts repo.CompatOpts) (*repo.PluginArchiveInfo, error)
- func (r *FakePluginRepo) GetPluginsInfo(ctx context.Context, options repo.GetPluginsInfoOptions, ...) ([]repo.PluginInfo, error)
- func (r *FakePluginRepo) PluginInfo(ctx context.Context, pluginID string, compatOpts repo.CompatOpts) (*repo.PluginInfo, error)
- func (r *FakePluginRepo) PluginVersion(ctx context.Context, pluginID, version string, compatOpts repo.CompatOpts) (repo.VersionData, error)
- type FakePluginSource
- type FakePluginStorage
- type FakeProcessManager
- type FakeRoleRegistry
- type FakeSourceRegistry
- type FakeTerminator
- type FakeValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssetProvider ¶
type AssetProvider struct {
ModuleFunc func(plugin pluginassets.PluginInfo) (string, error)
AssetPathFunc func(plugin pluginassets.PluginInfo, assetPath ...string) (string, error)
}
func NewFakeAssetProvider ¶
func NewFakeAssetProvider() *AssetProvider
func (*AssetProvider) AssetPath ¶
func (p *AssetProvider) AssetPath(plugin pluginassets.PluginInfo, assetPath ...string) (string, error)
func (*AssetProvider) Module ¶
func (p *AssetProvider) Module(plugin pluginassets.PluginInfo) (string, error)
type FakeActionSetRegistry ¶
type FakeActionSetRegistry struct {
ExpectedErr error
}
func NewFakeActionSetRegistry ¶
func NewFakeActionSetRegistry() *FakeActionSetRegistry
func (*FakeActionSetRegistry) RegisterActionSets ¶
type FakeAuthService ¶
type FakeAuthService struct {
Result *auth.ExternalService
}
func (*FakeAuthService) HasExternalService ¶
func (*FakeAuthService) RegisterExternalService ¶
func (f *FakeAuthService) RegisterExternalService(ctx context.Context, pluginID string, pType string, svc *auth.IAM) (*auth.ExternalService, error)
func (*FakeAuthService) RemoveExternalService ¶
func (f *FakeAuthService) RemoveExternalService(ctx context.Context, pluginID string) error
type FakeBackendPlugin ¶
type FakeBackendPlugin struct {
Managed bool
StartCount int
StopCount int
Decommissioned bool
Running bool
// ExitedCheckDoneOrStopped is used to signal that the Exited() or Stop() method has been called.
ExitedCheckDoneOrStopped chan struct{}
backendplugin.Plugin
// contains filtered or unexported fields
}
func NewFakeBackendPlugin ¶
func NewFakeBackendPlugin(managed bool) *FakeBackendPlugin
func (*FakeBackendPlugin) Decommission ¶
func (p *FakeBackendPlugin) Decommission() error
func (*FakeBackendPlugin) Exited ¶
func (p *FakeBackendPlugin) Exited() bool
func (*FakeBackendPlugin) IsDecommissioned ¶
func (p *FakeBackendPlugin) IsDecommissioned() bool
func (*FakeBackendPlugin) IsManaged ¶
func (p *FakeBackendPlugin) IsManaged() bool
func (*FakeBackendPlugin) Kill ¶
func (p *FakeBackendPlugin) Kill()
func (*FakeBackendPlugin) Logger ¶
func (p *FakeBackendPlugin) Logger() log.Logger
func (*FakeBackendPlugin) Target ¶
func (p *FakeBackendPlugin) Target() backendplugin.Target
type FakeBackendProcessProvider ¶
type FakeBackendProcessProvider struct {
Requested map[string]int
Invoked map[string]int
BackendFactoryFunc func(context.Context, *plugins.Plugin) backendplugin.PluginFactoryFunc
}
func NewFakeBackendProcessProvider ¶
func NewFakeBackendProcessProvider() *FakeBackendProcessProvider
func (*FakeBackendProcessProvider) BackendFactory ¶
func (pr *FakeBackendProcessProvider) BackendFactory(ctx context.Context, p *plugins.Plugin) backendplugin.PluginFactoryFunc
type FakeBootstrapper ¶
type FakeBootstrapper struct {
BootstrapFunc func(ctx context.Context, src plugins.PluginSource, bundle *plugins.FoundBundle) ([]*plugins.Plugin, error)
}
func (*FakeBootstrapper) Bootstrap ¶
func (f *FakeBootstrapper) Bootstrap(ctx context.Context, src plugins.PluginSource, bundle *plugins.FoundBundle) ([]*plugins.Plugin, error)
type FakeDiscoverer ¶
type FakeDiscoverer struct {
DiscoverFunc func(ctx context.Context, src plugins.PluginSource) ([]*plugins.FoundBundle, error)
}
func (*FakeDiscoverer) Discover ¶
func (f *FakeDiscoverer) Discover(ctx context.Context, src plugins.PluginSource) ([]*plugins.FoundBundle, error)
type FakeInitializer ¶
type FakeInitializer struct {
IntializeFunc func(ctx context.Context, ps *plugins.Plugin) (*plugins.Plugin, error)
}
func (*FakeInitializer) Initialize ¶
type FakeLicensingService ¶
type FakeLicensingService struct {
LicenseEdition string
TokenRaw string
LicensePath string
LicenseAppURL string
CDNPrefix string
}
func NewFakeLicensingService ¶
func NewFakeLicensingService() *FakeLicensingService
func (*FakeLicensingService) AppURL ¶
func (s *FakeLicensingService) AppURL() string
func (*FakeLicensingService) ContentDeliveryPrefix ¶
func (s *FakeLicensingService) ContentDeliveryPrefix() string
func (*FakeLicensingService) Edition ¶
func (s *FakeLicensingService) Edition() string
func (*FakeLicensingService) Environment ¶
func (s *FakeLicensingService) Environment() []string
func (*FakeLicensingService) Path ¶
func (s *FakeLicensingService) Path() string
type FakeLoader ¶
type FakeLoader struct {
LoadFunc func(_ context.Context, _ plugins.PluginSource) ([]*plugins.Plugin, error)
UnloadFunc func(_ context.Context, _ *plugins.Plugin) (*plugins.Plugin, error)
}
func (*FakeLoader) Load ¶
func (l *FakeLoader) Load(ctx context.Context, src plugins.PluginSource) ([]*plugins.Plugin, error)
type FakePluginClient ¶
type FakePluginClient struct {
ID string
Managed bool
Log log.Logger
backend.CollectMetricsHandlerFunc
backend.CheckHealthHandlerFunc
backend.QueryDataHandlerFunc
backend.CallResourceHandlerFunc
backend.MutateAdmissionFunc
backend.ValidateAdmissionFunc
backend.ConvertObjectsFunc
backendplugin.Plugin
// contains filtered or unexported fields
}
func (*FakePluginClient) CallResource ¶
func (pc *FakePluginClient) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*FakePluginClient) CheckHealth ¶
func (pc *FakePluginClient) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*FakePluginClient) CollectMetrics ¶
func (pc *FakePluginClient) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (*FakePluginClient) ConvertObjects ¶
func (pc *FakePluginClient) ConvertObjects(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
func (*FakePluginClient) Decommission ¶
func (pc *FakePluginClient) Decommission() error
func (*FakePluginClient) Exited ¶
func (pc *FakePluginClient) Exited() bool
func (*FakePluginClient) IsDecommissioned ¶
func (pc *FakePluginClient) IsDecommissioned() bool
func (*FakePluginClient) IsManaged ¶
func (pc *FakePluginClient) IsManaged() bool
func (*FakePluginClient) Logger ¶
func (pc *FakePluginClient) Logger() log.Logger
func (*FakePluginClient) MutateAdmission ¶
func (pc *FakePluginClient) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
func (*FakePluginClient) PluginID ¶
func (pc *FakePluginClient) PluginID() string
func (*FakePluginClient) PublishStream ¶
func (pc *FakePluginClient) PublishStream(_ context.Context, _ *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (*FakePluginClient) QueryData ¶
func (pc *FakePluginClient) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*FakePluginClient) RunStream ¶
func (pc *FakePluginClient) RunStream(_ context.Context, _ *backend.RunStreamRequest, _ *backend.StreamSender) error
func (*FakePluginClient) SubscribeStream ¶
func (pc *FakePluginClient) SubscribeStream(_ context.Context, _ *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (*FakePluginClient) Target ¶
func (pc *FakePluginClient) Target() backendplugin.Target
func (*FakePluginClient) ValidateAdmission ¶
func (pc *FakePluginClient) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
type FakePluginEnvProvider ¶
type FakePluginEnvProvider struct {
PluginEnvVarsFunc func(ctx context.Context, plugin *plugins.Plugin) []string
}
func NewFakePluginEnvProvider ¶
func NewFakePluginEnvProvider() *FakePluginEnvProvider
func (*FakePluginEnvProvider) PluginEnvVars ¶
type FakePluginFS ¶
type FakePluginFS struct {
OpenFunc func(name string) (fs.File, error)
RemoveFunc func() error
RelFunc func(string) (string, error)
// contains filtered or unexported fields
}
func NewFakePluginFS ¶
func NewFakePluginFS(base string) *FakePluginFS
func (*FakePluginFS) Base ¶
func (f *FakePluginFS) Base() string
func (*FakePluginFS) Files ¶
func (f *FakePluginFS) Files() ([]string, error)
func (*FakePluginFS) Remove ¶
func (f *FakePluginFS) Remove() error
type FakePluginFileStore ¶
type FakePluginInstaller ¶
type FakePluginInstaller struct {
AddFunc func(ctx context.Context, pluginID, version string, opts plugins.AddOpts) error
// Remove removes a plugin from the store.
RemoveFunc func(ctx context.Context, pluginID, version string) error
}
type FakePluginRegistry ¶
func NewFakePluginRegistry ¶
func NewFakePluginRegistry() *FakePluginRegistry
type FakePluginRepo ¶
type FakePluginRepo struct {
GetPluginArchiveFunc func(_ context.Context, pluginID, version string, _ repo.CompatOpts) (*repo.PluginArchive, error)
GetPluginArchiveByURLFunc func(_ context.Context, archiveURL string, _ repo.CompatOpts) (*repo.PluginArchive, error)
GetPluginArchiveInfoFunc func(_ context.Context, pluginID, version string, _ repo.CompatOpts) (*repo.PluginArchiveInfo, error)
PluginVersionFunc func(_ context.Context, pluginID, version string, compatOpts repo.CompatOpts) (repo.VersionData, error)
}
func (*FakePluginRepo) GetPluginArchive ¶
func (r *FakePluginRepo) GetPluginArchive(ctx context.Context, pluginID, version string, opts repo.CompatOpts) (*repo.PluginArchive, error)
GetPluginArchive fetches the requested plugin archive.
func (*FakePluginRepo) GetPluginArchiveByURL ¶
func (r *FakePluginRepo) GetPluginArchiveByURL(ctx context.Context, archiveURL string, opts repo.CompatOpts) (*repo.PluginArchive, error)
GetPluginArchiveByURL fetches the requested plugin from the specified URL.
func (*FakePluginRepo) GetPluginArchiveInfo ¶
func (r *FakePluginRepo) GetPluginArchiveInfo(ctx context.Context, pluginID, version string, opts repo.CompatOpts) (*repo.PluginArchiveInfo, error)
GetPluginArchiveInfo fetches information for downloading the requested plugin.
func (*FakePluginRepo) GetPluginsInfo ¶
func (r *FakePluginRepo) GetPluginsInfo(ctx context.Context, options repo.GetPluginsInfoOptions, compatOpts repo.CompatOpts) ([]repo.PluginInfo, error)
func (*FakePluginRepo) PluginInfo ¶
func (r *FakePluginRepo) PluginInfo(ctx context.Context, pluginID string, compatOpts repo.CompatOpts) (*repo.PluginInfo, error)
func (*FakePluginRepo) PluginVersion ¶
func (r *FakePluginRepo) PluginVersion(ctx context.Context, pluginID, version string, compatOpts repo.CompatOpts) (repo.VersionData, error)
type FakePluginSource ¶
type FakePluginSource struct {
PluginClassFunc func(ctx context.Context) plugins.Class
DiscoverFunc func(ctx context.Context) ([]*plugins.FoundBundle, error)
DefaultSignatureFunc func(ctx context.Context) (plugins.Signature, bool)
}
func (*FakePluginSource) DefaultSignature ¶
func (*FakePluginSource) Discover ¶
func (s *FakePluginSource) Discover(ctx context.Context) ([]*plugins.FoundBundle, error)
func (*FakePluginSource) PluginClass ¶
func (s *FakePluginSource) PluginClass(ctx context.Context) plugins.Class
type FakePluginStorage ¶
type FakePluginStorage struct {
ExtractFunc func(_ context.Context, pluginID string, dirNameFunc storage.DirNameGeneratorFunc, z *zip.ReadCloser) (*storage.ExtractedPluginArchive, error)
}
func NewFakePluginStorage ¶
func NewFakePluginStorage() *FakePluginStorage
func (*FakePluginStorage) Extract ¶
func (s *FakePluginStorage) Extract(ctx context.Context, pluginID string, dirNameFunc storage.DirNameGeneratorFunc, z *zip.ReadCloser) (*storage.ExtractedPluginArchive, error)
type FakeProcessManager ¶
type FakeProcessManager struct {
StartFunc func(_ context.Context, p *plugins.Plugin) error
StopFunc func(_ context.Context, p *plugins.Plugin) error
Started map[string]int
Stopped map[string]int
}
func NewFakeProcessManager ¶
func NewFakeProcessManager() *FakeProcessManager
type FakeRoleRegistry ¶
type FakeRoleRegistry struct {
ExpectedErr error
}
func NewFakeRoleRegistry ¶
func NewFakeRoleRegistry() *FakeRoleRegistry
func (*FakeRoleRegistry) DeclarePluginRoles ¶
func (f *FakeRoleRegistry) DeclarePluginRoles(_ context.Context, _ string, _ string, _ []plugins.RoleRegistration) error
type FakeSourceRegistry ¶
type FakeSourceRegistry struct {
ListFunc func(_ context.Context) []plugins.PluginSource
}
func (*FakeSourceRegistry) List ¶
func (s *FakeSourceRegistry) List(ctx context.Context) []plugins.PluginSource
Click to show internal directories.
Click to hide internal directories.