connectors

package
v0.0.0-...-d0f0867 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package connectors defines "Connectors" flavor, which is a combination of all plugins that allow connectivity to external database/messaging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectKVDBSync

func InjectKVDBSync(dbsync *kvdbsync.Plugin,
	db keyval.KvProtoPlugin, dbPlugName core.PluginName, local *local.FlavorLocal, resync resync.Subscriber)

InjectKVDBSync sets kvdbsync.Plugin dependencies. The intent of this method is just extract code that would be copy&pasted otherwise.

func NewAgent

func NewAgent(opts ...core.Option) *core.Agent

NewAgent returns a new instance of the Agent with plugins. It is an alias for core.NewAgent() to implicit use of the FlavorLocal.

func WithPlugins

func WithPlugins(listPlugins func(local *AllConnectorsFlavor) []*core.NamedPlugin) core.WithPluginsOpt

WithPlugins for adding custom plugins to SFC Controller <listPlugins> is a callback that uses flavor input to inject dependencies for custom plugins that are in output

Example:

   NewAgent(connectors.WithPlugins(func(flavor) {
	       return []*core.NamedPlugin{{"my-plugin", &MyPlugin{DependencyXY: &flavor.ETCD}}}
   }))

Types

type AllConnectorsFlavor

type AllConnectorsFlavor struct {
	*local.FlavorLocal

	ETCD         etcdv3.Plugin
	ETCDDataSync kvdbsync.Plugin

	Kafka kafka.Plugin

	Redis         redis.Plugin
	RedisDataSync kvdbsync.Plugin

	Cassandra cassandra.Plugin

	ResyncOrch resync.Plugin // the order is important because of AfterInit()
	// contains filtered or unexported fields
}

AllConnectorsFlavor is a combination of all plugins that allow connectivity to external database/messaging... Effectively it is combination of ETCD, Kafka, Redis, Cassandra plugins.

User/admin can enable those plugins/connectors by providing configs (at least endpoints) for them.

func (*AllConnectorsFlavor) Inject

func (f *AllConnectorsFlavor) Inject() bool

Inject initializes flavor references/dependencies.

func (*AllConnectorsFlavor) Plugins

func (f *AllConnectorsFlavor) Plugins() []*core.NamedPlugin

Plugins combines all Plugins in flavor to the list

Jump to

Keyboard shortcuts

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