Documentation
¶
Overview ¶
Package repository contains the plugin discovery and connection pooling feature of CNPG
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrPluginAlreadyRegistered ¶
type ErrPluginAlreadyRegistered struct {
Name string
}
ErrPluginAlreadyRegistered is raised when a plugin is being registered but its configuration is already attached to the pool
func (*ErrPluginAlreadyRegistered) Error ¶
func (e *ErrPluginAlreadyRegistered) Error() string
Error implements the error interface
type ErrUnknownPlugin ¶
type ErrUnknownPlugin struct {
Name string
}
ErrUnknownPlugin is raised when requesting a connection to a plugin that is not known
func (*ErrUnknownPlugin) Error ¶
func (e *ErrUnknownPlugin) Error() string
Error implements the error interface
type Interface ¶
type Interface interface {
// ForgetPlugin closes every connection to the plugin with the passed name
// and forgets its discovery info.
// If the plug in was not available in the repository, this is a no-op
ForgetPlugin(name string)
// RegisterRemotePlugin registers a plugin available on a remote
// TCP entrypoint
RegisterRemotePlugin(name string, address string, tlsConfig *tls.Config) error
// RegisterUnixSocketPluginsInPath scans the passed directory
// for plugins that are deployed with unix sockets
RegisterUnixSocketPluginsInPath(pluginsPath string) error
// GetConnection gets a connection to the plugin with specified name
GetConnection(ctx context.Context, name string) (connection.Interface, error)
// Close closes all the connections to the plugins
Close()
}
Interface is the interface to use a plugin repository
Click to show internal directories.
Click to hide internal directories.