drivers

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDirectoryDriverStoreIn

func NewDirectoryDriverStoreIn(driversDirectory string) domain.DriverStore

Types

type DirectoryPluginStore

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

DirectoryPluginStore is a PluginStore that search for plugins in a directory

func NewDirectoryPluginStore

func NewDirectoryPluginStore(directory string) *DirectoryPluginStore

NewDirectoryPluginStore creates new DirectoryPluginStore that reads plugins from requested directory

func (DirectoryPluginStore) GetAll

func (plugDir DirectoryPluginStore) GetAll() []GoPlugin

GetAll loaded plugins

func (*DirectoryPluginStore) Load

func (plugDir *DirectoryPluginStore) Load() error

Load all plugins from directory

type GoPlugin

type GoPlugin interface {
	Lookup(symbol string) (plugin.Symbol, error)
}

GoPlugin is a wrapper of build-in plugin for testing purposes

type PluginDriverStore

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

PluginDriverStore is a DriverStore implementation that search for drivers in a PluginStore Its putpose is to pass plain plugins from PluginStore to Driver structs

func NewPluginDriverStore

func NewPluginDriverStore() *PluginDriverStore

NewPluginDriverStore creates new PluginDriverStore

func (PluginDriverStore) GetAllDrivers

func (driverStore PluginDriverStore) GetAllDrivers() []domain.Driver

func (PluginDriverStore) GetDriverByName

func (driverStore PluginDriverStore) GetDriverByName(name string) (domain.Driver, error)

GetDriverByName of the known drivers. If no one matches, returns error

func (*PluginDriverStore) LoadUsing

func (driverStore *PluginDriverStore) LoadUsing(pluginStore PluginStore) error

type PluginStore

type PluginStore interface {
	Load() error
	GetAll() []GoPlugin
}

PluginStore represents a plugin storage, where you can load and get plugins.

Jump to

Keyboard shortcuts

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