Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient( logger zerolog.Logger, path string, opts ...ClientOption, ) (*plugin.Client, error)
NewClient creates a new plugin client. The provided context is used to kill the process (by calling os.Process.Kill) if the context becomes done before the plugin completes on its own. Path should point to the plugin executable.
Types ¶
type ClientOption ¶
type ClientOption interface {
ApplyClientOption(*plugin.ClientConfig) error
}
ClientOption is an interface for defining options that can be passed to the NewClient function. Each implementation modifies the ClientConfig being generated. A slice of ClientOptions then, cumulatively applied, render a full ClientConfig.
func WithDelve ¶
func WithDelve(port int) ClientOption
WithDelve runs the plugin with Delve listening on the supplied port. If the port is 0 it finds a random free port. For more information on how to use Delve refer to the official repository: https://github.com/go-delve/delve
func WithReattachConfig ¶
func WithReattachConfig(config *plugin.ReattachConfig) ClientOption
WithReattachConfig returns a ClientOption that will set the client into debug mode, using the passed options to populate the go-plugin ReattachConfig.
type Dispenser ¶
type Dispenser struct {
// contains filtered or unexported fields
}
func NewDispenser ¶
func (*Dispenser) DispenseDestination ¶
func (d *Dispenser) DispenseDestination() (connector.DestinationPlugin, error)
func (*Dispenser) DispenseSource ¶
func (d *Dispenser) DispenseSource() (connector.SourcePlugin, error)
func (*Dispenser) DispenseSpecifier ¶
func (d *Dispenser) DispenseSpecifier() (connector.SpecifierPlugin, error)
type GRPCDestinationPlugin ¶
type GRPCDestinationPlugin struct {
goplugin.NetRPCUnsupportedPlugin
}
func (*GRPCDestinationPlugin) GRPCClient ¶
func (p *GRPCDestinationPlugin) GRPCClient(_ context.Context, _ *goplugin.GRPCBroker, cc *grpc.ClientConn) (interface{}, error)
func (*GRPCDestinationPlugin) GRPCServer ¶
func (p *GRPCDestinationPlugin) GRPCServer(*goplugin.GRPCBroker, *grpc.Server) error
GRPCServer always returns an error; we're only implementing the client half of the interface.
type GRPCSourcePlugin ¶
type GRPCSourcePlugin struct {
goplugin.NetRPCUnsupportedPlugin
}
func (*GRPCSourcePlugin) GRPCClient ¶
func (p *GRPCSourcePlugin) GRPCClient(_ context.Context, _ *goplugin.GRPCBroker, cc *grpc.ClientConn) (interface{}, error)
func (*GRPCSourcePlugin) GRPCServer ¶
func (p *GRPCSourcePlugin) GRPCServer(*goplugin.GRPCBroker, *grpc.Server) error
GRPCServer always returns an error; we're only implementing the client half of the interface.
type GRPCSpecifierPlugin ¶
type GRPCSpecifierPlugin struct {
goplugin.NetRPCUnsupportedPlugin
}
func (*GRPCSpecifierPlugin) GRPCClient ¶
func (p *GRPCSpecifierPlugin) GRPCClient(_ context.Context, _ *goplugin.GRPCBroker, cc *grpc.ClientConn) (interface{}, error)
func (*GRPCSpecifierPlugin) GRPCServer ¶
func (p *GRPCSpecifierPlugin) GRPCServer(*goplugin.GRPCBroker, *grpc.Server) error
GRPCServer always returns an error; we're only implementing the client half of the interface.