Documentation
¶
Index ¶
- Variables
- func KillProviderPluginClient(path string)
- func NewLogger(verbose bool, options ...zap.Option) (*zap.Logger, error)
- func ServePlugin(provider CQProvider)
- type CQPlugin
- type CQProvider
- type GRPCClient
- type GRPCServer
- func (m *GRPCServer) Fetch(ctx context.Context, req *proto.FetchRequest) (*proto.FetchResponse, error)
- func (m *GRPCServer) GenConfig(ctx context.Context, req *proto.GenConfigRequest) (*proto.GenConfigResponse, error)
- func (m *GRPCServer) Init(ctx context.Context, req *proto.InitRequest) (*proto.InitResponse, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Handshake = plugin.HandshakeConfig{
MagicCookieKey: "CQ_PLUGIN_COOKIE",
MagicCookieValue: "6753812e-79c2-4af5-ad01-e6083c374e1f",
}
View Source
var PluginMap = map[string]plugin.Plugin{ "provider": &CQPlugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
func KillProviderPluginClient ¶ added in v0.9.0
func KillProviderPluginClient(path string)
func ServePlugin ¶
func ServePlugin(provider CQProvider)
Types ¶
type CQPlugin ¶
type CQPlugin struct {
// GRPCPlugin must still implement the Plugin interface
plugin.Plugin
// Concrete implementation, written in Go. This is only used for plugins
// that are written in Go.
Impl CQProvider
}
This is the implementation of plugin.GRPCPlugin so we can serve/consume this.
func (*CQPlugin) GRPCClient ¶
func (p *CQPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*CQPlugin) GRPCServer ¶
type CQProvider ¶
type CQProvider interface {
Init(driver string, dsn string, verbose bool) error
Fetch(data []byte) error
GenConfig() (string, error)
}
func GetProviderPluginClient ¶
func GetProviderPluginClient(path string) (CQProvider, error)
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
func (*GRPCClient) Fetch ¶
func (m *GRPCClient) Fetch(data []byte) error
func (*GRPCClient) GenConfig ¶
func (m *GRPCClient) GenConfig() (string, error)
type GRPCServer ¶
type GRPCServer struct {
// This is the real implementation
Impl CQProvider
proto.UnimplementedProviderServer
}
Here is the gRPC server that GRPCClient talks to.
func (*GRPCServer) Fetch ¶
func (m *GRPCServer) Fetch(ctx context.Context, req *proto.FetchRequest) (*proto.FetchResponse, error)
func (*GRPCServer) GenConfig ¶
func (m *GRPCServer) GenConfig(ctx context.Context, req *proto.GenConfigRequest) (*proto.GenConfigResponse, error)
func (*GRPCServer) Init ¶
func (m *GRPCServer) Init(ctx context.Context, req *proto.InitRequest) (*proto.InitResponse, error)
Click to show internal directories.
Click to hide internal directories.