hub

package
v0.0.0-...-5b6cbe3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrHub is the root of errors caused by Hub
	ErrHub = errors.NewClass("Hub Error")

	// ErrInvalid indicates an invalid argument
	ErrInvalid = ErrHub.New("Invalid argument")

	// ErrNotFound is returned when the plugin is not found
	ErrNotFound = ErrHub.New("Plugin not found")
)
View Source
var (
	Service = ":7777"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// Path is the location where hub will store the plugins. Validator
	// automatically ensures that the path is present. If it is not, it fails
	Path string `validate:"required,dir"`
}

Config includes the execution parameters of the HUB

type Hub

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

Hub is a insitu hub, or repository, of modules and schemas

func New

func New(config Config) (*Hub, error)

NewHub creates a New hub on the $Root/plugin directory and keep an exlusive lock for as long as the process is running

func (*Hub) Close

func (hub *Hub) Close() error

Close releases the lock on the Hub directory

func (*Hub) DownloadPlugins

func (hub *Hub) DownloadPlugins(list ...string) error

DownloadPlugins install the list of plugins.

func (*Hub) GetPluginFromDistributionService

func (hub *Hub) GetPluginFromDistributionService(name string) error

func (*Hub) GetPluginSource

func (hub *Hub) GetPluginSource(name string) error

GetPluginSource uses the go get command to download and compiles the plugin

func (*Hub) OpenCoordinatorPlugin

func (hub *Hub) OpenCoordinatorPlugin(name string) (coordinator.Plugin, error)

OpenCoordinatorPlugin opens a Coordinator plugin

func (*Hub) OpenDevicePlugin

func (hub *Hub) OpenDevicePlugin(name string) (device.Plugin, error)

OpenDevicePlugin opens a Device plugin

func (*Hub) OpenPlugin

func (hub *Hub) OpenPlugin(name string) (interface{}, error)

OpenPlugin opens a plugin.

func (*Hub) OpenProcessorPlugin

func (hub *Hub) OpenProcessorPlugin(name string) (processor.Plugin, error)

OpenCoordinatorPlugin opens a Coordinator plugin

func (*Hub) OpenSelectorPlugin

func (hub *Hub) OpenSelectorPlugin(name string) (selector.Plugin, error)

OpenSelectorPlugin opens a Selector plugin

func (*Hub) RunDistributionService

func (hub *Hub) RunDistributionService()

RunDistributionService runs a sever in the default hub for distributing binary plugins to the daemons.

type WebServiceOperations

type WebServiceOperations struct {
	GetPlugin func(name string) ([]byte, error)
}

Jump to

Keyboard shortcuts

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