Documentation ¶
Index ¶
- Variables
- func AllHTTPPlugins() map[string]http.Plugin
- func AllTCPPlugins() map[string]tcp.Plugin
- func ExternalPlugins() plugin.AvailablePlugins
- func GetExternalPlugins(pluginDir string, checksumfile string, logger log_api.Logger) (plugin.AvailablePlugins, error)
- func GetInternalPlugins() (plugin.AvailablePlugins, error)
- func HTTPExternalPluginsByID() map[string]http.Plugin
- func HTTPInternalPluginsByID() map[string]http.Plugin
- func InternalPlugins() plugin.AvailablePlugins
- func NewLogger() log_api.Logger
- func TCPExternalPluginsByID() map[string]tcp.Plugin
- func TCPInternalPluginsByID() map[string]tcp.Plugin
- type HTTPPlugin
- type Plugins
- type RawPlugin
- type TCPPlugin
Constants ¶
This section is empty.
Variables ¶
var RawPlugins = map[string]RawPlugin{ "http1": RawPlugin{ PluginAPIVersion: pluginAPIVersion, PluginType: "connector.http", PluginID: "extHTTP1", }, "http2": RawPlugin{ PluginAPIVersion: pluginAPIVersion, PluginType: "connector.http", PluginID: "extHTTP2", }, "tcp1": RawPlugin{ PluginAPIVersion: pluginAPIVersion, PluginType: "connector.tcp", PluginID: "extTCP1", }, "tcp2": RawPlugin{ PluginAPIVersion: pluginAPIVersion, PluginType: "connector.tcp", PluginID: "extTCP2", }, "tcp3": RawPlugin{ PluginAPIVersion: pluginAPIVersion, PluginType: "connector.tcp", PluginID: "extTCP3", }, }
RawPlugins instantiates a map of RawPlugins for testing. Values of entries in this map should reflect values returned by HTTPExternalPluginsByID() and TCPExternalPluginsByID() above.
Functions ¶
func AllHTTPPlugins ¶
AllHTTPPlugins returns map combining the HTTP internal and external mock plugins.
func AllTCPPlugins ¶
AllTCPPlugins returns map combining the TCP internal and external mock plugins.
func ExternalPlugins ¶
func ExternalPlugins() plugin.AvailablePlugins
ExternalPlugins creates a mock AvailablePlugins for external plugins.
func GetExternalPlugins ¶
func GetExternalPlugins( pluginDir string, checksumfile string, logger log_api.Logger, ) (plugin.AvailablePlugins, error)
GetExternalPlugins is function that returns the mock external plugins. It's needed to satisfy arguments of type ExternalPluginLookupFunc.
func GetInternalPlugins ¶
func GetInternalPlugins() (plugin.AvailablePlugins, error)
GetInternalPlugins is function that returns the mock internal plugins. It's needed to satisfy arguments of type InternalPluginLookupFunc.
func HTTPExternalPluginsByID ¶
HTTPExternalPluginsByID returns mock HTTP plugins with external ids.
func HTTPInternalPluginsByID ¶
HTTPInternalPluginsByID returns mock HTTP plugins with internal ids.
func InternalPlugins ¶
func InternalPlugins() plugin.AvailablePlugins
InternalPlugins creates a mock AvailablePlugins for internal plugins.
func TCPExternalPluginsByID ¶
TCPExternalPluginsByID returns mock TCP plugins with external ids.
func TCPInternalPluginsByID ¶
TCPInternalPluginsByID returns mock TCP plugins with internal ids.
Types ¶
type HTTPPlugin ¶
HTTPPlugin is a mock struct that implements http.Plugin interface
func NewHTTPPlugin ¶
func NewHTTPPlugin(id string) HTTPPlugin
NewHTTPPlugin creates a new HTTPPlugin mock with an id, so that it may be distinguished from other mocks by DeepEqual.
type Plugins ¶
Plugins may appear on first glance to be duplication, but it's not. We can't use the actual implementation sharedobj.Plugin without creating a literal Go circular dependency. It would be circular logically too: to use the thing we're testing to create a mock to test it. Also, note it's purely coincidental that this implementation is the same as the actual implementation in sharedobj. Either one could change. We only care about fulfilling the interface.
func (*Plugins) HTTPPlugins ¶
HTTPPlugins returns the mock HTTP plugins.
type RawPlugin ¶ added in v1.5.0
RawPlugin implements the rawPlugin interface
type TCPPlugin ¶
TCPPlugin is a mock struct that implements tcp.Plugin interface
func NewTCPPlugin ¶
NewTCPPlugin creates a new TCPPlugin mock with an id, so that it may be distinguished from other mocks by DeepEqual.