Documentation ¶
Index ¶
- type CSVExporter
- func (x *CSVExporter) BuildDataPoints(ctx context.Context, src []byte) ([]*DataPoint, error)
- func (x *CSVExporter) EnhanceDataPoint(ctx context.Context, d *DataPoint) error
- func (x *CSVExporter) RunGemini(ctx context.Context, input *DataPoint, out io.Writer) error
- func (x *CSVExporter) VisitCodeDir(ctx context.Context, srcDir string) error
- func (x *CSVExporter) WriteCSVForAllTools(ctx context.Context, outputDir string) error
- type DataPoint
- type EnhanceWithProtoDefinition
- type Enhancer
- type ExtractToolMarkers
- type Extractor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSVExporter ¶
type CSVExporter struct {
// contains filtered or unexported fields
}
CSVExporter is an exporter that writes CSV files for each tool.
func NewCSVExporter ¶
func NewCSVExporter(extractor Extractor, enhancers ...Enhancer) (*CSVExporter, error)
NewCSVExporter creates a new CSVExporter.
func (*CSVExporter) BuildDataPoints ¶
BuildDataPoints extracts data points from a byte slice representing a Go file.
func (*CSVExporter) EnhanceDataPoint ¶
func (x *CSVExporter) EnhanceDataPoint(ctx context.Context, d *DataPoint) error
EnhanceDataPoint enhances a data point by running all the registered enhancers.
func (*CSVExporter) RunGemini ¶
RunGemini runs a prompt against Gemini, generating context based on the source code.
func (*CSVExporter) VisitCodeDir ¶
func (x *CSVExporter) VisitCodeDir(ctx context.Context, srcDir string) error
VisitCodeDir visits a directory and extracts data points from all Go files in the directory tree.
func (*CSVExporter) WriteCSVForAllTools ¶
func (x *CSVExporter) WriteCSVForAllTools(ctx context.Context, outputDir string) error
WriteCSVForAllTools writes CSV files for all tools.
type DataPoint ¶
DataPoint holds the input and output for a tool.
func (*DataPoint) AddCSVColumns ¶
AddCSVColumns adds the columns for the data point to the columnSet.
func (*DataPoint) ToGenAIParts ¶
ToGenAIParts converts the data point to the input format for Gemini.
type EnhanceWithProtoDefinition ¶
type EnhanceWithProtoDefinition struct {
// contains filtered or unexported fields
}
EnhanceWithProtoDefinition is an enhancer that adds the definition of a proto message or service to the data point.
func NewEnhanceWithProtoDefinition ¶
func NewEnhanceWithProtoDefinition(protoDirectory string) (*EnhanceWithProtoDefinition, error)
NewEnhanceWithProtoDefinition creates a new EnhanceWithProtoDefinition.
func (*EnhanceWithProtoDefinition) EnhanceDataPoint ¶
func (x *EnhanceWithProtoDefinition) EnhanceDataPoint(ctx context.Context, p *DataPoint) error
EnhanceDataPoint enhances the data point by adding the definition of the proto message or service.
type Enhancer ¶
Enhancer is an interface for enhancing a data point. For example, it might add a computed field to the data point, such as the definition of a proto message, given the name of the proto message.
type ExtractToolMarkers ¶
type ExtractToolMarkers struct { }
ExtractToolMarkers extracts tool markers from source code.