fakes

package
v0.0.1-test Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeBackendProcessProvider

type FakeBackendProcessProvider struct {
	Requested map[string]int
	Invoked   map[string]int
}

func NewFakeBackendProcessProvider

func NewFakeBackendProcessProvider() *FakeBackendProcessProvider

func (*FakeBackendProcessProvider) BackendFactory

type FakeLicensingService

type FakeLicensingService struct {
	TokenRaw string
}

func NewFakeLicensingService

func NewFakeLicensingService() *FakeLicensingService

func (*FakeLicensingService) ContentDeliveryPrefix

func (t *FakeLicensingService) ContentDeliveryPrefix() string

func (*FakeLicensingService) Edition

func (t *FakeLicensingService) Edition() string

func (*FakeLicensingService) EnabledFeatures

func (*FakeLicensingService) EnabledFeatures() map[string]bool

func (*FakeLicensingService) Environment

func (t *FakeLicensingService) Environment() map[string]string

func (*FakeLicensingService) Expiry

func (t *FakeLicensingService) Expiry() int64

func (*FakeLicensingService) FeatureEnabled

func (*FakeLicensingService) FeatureEnabled(_ string) bool

func (*FakeLicensingService) LicenseURL

func (t *FakeLicensingService) LicenseURL(_ bool) string

func (*FakeLicensingService) StateInfo

func (t *FakeLicensingService) StateInfo() string

type FakeLoader

type FakeLoader struct {
	LoadFunc   func(_ context.Context, _ plugins.Class, paths []string) ([]*plugins.Plugin, error)
	UnloadFunc func(_ context.Context, _ string) error
}

func (*FakeLoader) Load

func (l *FakeLoader) Load(ctx context.Context, class plugins.Class, paths []string) ([]*plugins.Plugin, error)

func (*FakeLoader) Unload

func (l *FakeLoader) Unload(ctx context.Context, pluginID string) error

type FakePluginClient

type FakePluginClient struct {
	ID      string
	Managed bool
	Log     log.Logger

	backend.CollectMetricsHandlerFunc
	backend.CheckHealthHandlerFunc
	backend.QueryDataHandlerFunc
	backend.CallResourceHandlerFunc

	backendplugin.Plugin
	// contains filtered or unexported fields
}

func (*FakePluginClient) CallResource

func (*FakePluginClient) CheckHealth

func (*FakePluginClient) CollectMetrics

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) PluginID

func (pc *FakePluginClient) PluginID() string

func (*FakePluginClient) PublishStream

func (*FakePluginClient) QueryData

func (*FakePluginClient) RunStream

func (*FakePluginClient) Start

func (pc *FakePluginClient) Start(_ context.Context) error

func (*FakePluginClient) Stop

func (pc *FakePluginClient) Stop(_ context.Context) error

func (*FakePluginClient) SubscribeStream

type FakePluginInstaller

type FakePluginInstaller struct {
	AddFunc func(ctx context.Context, pluginID, version string, opts plugins.CompatOpts) error
	// Remove removes a plugin from the store.
	RemoveFunc func(ctx context.Context, pluginID string) error
}

func (*FakePluginInstaller) Add

func (i *FakePluginInstaller) Add(ctx context.Context, pluginID, version string, opts plugins.CompatOpts) error

func (*FakePluginInstaller) Remove

func (i *FakePluginInstaller) Remove(ctx context.Context, pluginID string) error

type FakePluginRegistry

type FakePluginRegistry struct {
	Store map[string]*plugins.Plugin
}

func NewFakePluginRegistry

func NewFakePluginRegistry() *FakePluginRegistry

func (*FakePluginRegistry) Add

func (*FakePluginRegistry) Plugin

func (*FakePluginRegistry) Plugins

func (f *FakePluginRegistry) Plugins(_ context.Context) []*plugins.Plugin

func (*FakePluginRegistry) Remove

func (f *FakePluginRegistry) Remove(_ context.Context, id string) error

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)
	GetPluginDownloadOptionsFunc func(_ context.Context, pluginID, version string, _ repo.CompatOpts) (*repo.PluginDownloadOptions, 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) GetPluginDownloadOptions

func (r *FakePluginRepo) GetPluginDownloadOptions(ctx context.Context, pluginID, version string, opts repo.CompatOpts) (*repo.PluginDownloadOptions, error)

GetPluginDownloadOptions fetches information for downloading the requested plugin.

type FakePluginStorage

type FakePluginStorage struct {
	Store        map[string]struct{}
	AddFunc      func(_ context.Context, pluginID string, z *zip.ReadCloser) (*storage.ExtractedPluginArchive, error)
	RegisterFunc func(_ context.Context, pluginID, pluginDir string) error
	RemoveFunc   func(_ context.Context, pluginID string) error
}

func NewFakePluginStorage

func NewFakePluginStorage() *FakePluginStorage

func (*FakePluginStorage) Add

func (*FakePluginStorage) Register

func (s *FakePluginStorage) Register(ctx context.Context, pluginID, pluginDir string) error

func (*FakePluginStorage) Remove

func (s *FakePluginStorage) Remove(ctx context.Context, pluginID string) error

type FakeProcessManager

type FakeProcessManager struct {
	StartFunc func(_ context.Context, pluginID string) error
	StopFunc  func(_ context.Context, pluginID string) error
	Started   map[string]int
	Stopped   map[string]int
}

func NewFakeProcessManager

func NewFakeProcessManager() *FakeProcessManager

func (*FakeProcessManager) Start

func (m *FakeProcessManager) Start(ctx context.Context, pluginID string) error

func (*FakeProcessManager) Stop

func (m *FakeProcessManager) Stop(ctx context.Context, pluginID string) error

Jump to

Keyboard shortcuts

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