Documentation ¶
Index ¶
- Variables
- func Consume(logger hclog.Logger, queue <-chan common.Pair[[]*proto.CoverageItem, error]) ([]*proto.CoverageItem, error)
- func Publish(wg *sync.WaitGroup, logger hclog.Logger, p Pluggable, filenames []string, ...)
- type CommentcovPlugin
- type GRPCClient
- type GRPCServer
- type Pluggable
- type PluginConfig
Constants ¶
This section is empty.
Variables ¶
var (
// PluginHandshakeConfig holds configuration for plugin.GRPCPlugin.
PluginHandshakeConfig = plugin.HandshakeConfig{
MagicCookieKey: "BASIC_PLUGIN",
MagicCookieValue: "Hello",
}
)
Functions ¶
func Consume ¶
func Consume(logger hclog.Logger, queue <-chan common.Pair[[]*proto.CoverageItem, error]) ([]*proto.CoverageItem, error)
Consume aggregates CoverageItems from multi publishers.
Types ¶
type CommentcovPlugin ¶
type CommentcovPlugin struct { plugin.Plugin Impl Pluggable }
CommentcovPlugin implements plugin.GRPCPlugin.
func (*CommentcovPlugin) GRPCClient ¶
func (p *CommentcovPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, conn *grpc.ClientConn) (interface{}, error)
GRPCClient is a part of plugin.GRPCPlugin interface.
func (*CommentcovPlugin) GRPCServer ¶
func (p *CommentcovPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
GRPCServer is a part of plugin.GRPCPlugin interface.
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient is the interface to be called from the host.
func (*GRPCClient) MeasureCoverage ¶
func (c *GRPCClient) MeasureCoverage(files []string) ([]*proto.CoverageItem, error)
MeasureCoverage implements Pluggable.
type GRPCServer ¶
type GRPCServer struct { proto.UnimplementedCommentcovPluginServer Impl Pluggable }
GRPCServer Dependency(Plugin Implementation) Injected Object.
func (*GRPCServer) MeasureCoverage ¶
func (s *GRPCServer) MeasureCoverage(ctx context.Context, in *proto.MeasureCoverageIn) (*proto.MeasureCoverageOut, error)
MeasureCoverage calls the Pluggable implementation via gRPC.
type Pluggable ¶
type Pluggable interface {
MeasureCoverage(files []string) ([]*proto.CoverageItem, error)
}
Pluggable is the interface. Each plugin implements Pluggable interface via gRPC.
func GetPluginFromClient ¶
GetPluginFromClient returns Pluggable object.
type PluginConfig ¶
type PluginConfig struct { Extension string InstallCommand string `mapstructure:"install_command"` ExecuteCommand string `mapstructure:"execute_command"` }
PluginConfig represents commentcov plugin info.
func FindPluginConfig ¶
func FindPluginConfig(pcs []PluginConfig, ext string) *PluginConfig
FindPluginConfig returns the first matched plugin's PluginConfig by the extension.
func (*PluginConfig) GetExecuteCommand ¶
func (pc *PluginConfig) GetExecuteCommand() *exec.Cmd
GetExecuteCommand returns *exec.Cmd to execute the plugin.
func (*PluginConfig) GetInstallCommand ¶
func (pc *PluginConfig) GetInstallCommand() *exec.Cmd
GetInstallCommand returns *exec.Cmd to install the plugin.
func (*PluginConfig) Install ¶
func (pc *PluginConfig) Install() error
Install installs the plugin for setup.