Documentation
¶
Index ¶
- type Engine
- func (e *Engine) CreateCustomTemplate(name, content string) error
- func (e *Engine) ExportTemplate(templateName, outputPath string) error
- func (e *Engine) GeneratePatch(request PatchRequest) PatchResult
- func (e *Engine) GeneratePullRequest(findings []types.Finding, repoPath string) error
- func (e *Engine) GetAvailableTemplates() []string
- func (e *Engine) GetTemplateInfo(templateName string) (map[string]interface{}, error)
- func (e *Engine) LoadTemplates() error
- func (e *Engine) ValidateTemplate(templateName string) error
- type PatchRequest
- type PatchResult
- type PatchTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine handles patch generation using templates
func (*Engine) CreateCustomTemplate ¶
CreateCustomTemplate creates a custom template
func (*Engine) ExportTemplate ¶
ExportTemplate exports a template to a file
func (*Engine) GeneratePatch ¶
func (e *Engine) GeneratePatch(request PatchRequest) PatchResult
GeneratePatch generates a patch for the given finding
func (*Engine) GeneratePullRequest ¶
GeneratePullRequest generates a pull request with patches for multiple findings
func (*Engine) GetAvailableTemplates ¶
GetAvailableTemplates returns a list of available templates
func (*Engine) GetTemplateInfo ¶
GetTemplateInfo returns information about a template
func (*Engine) LoadTemplates ¶
LoadTemplates loads patch templates from the templates directory
func (*Engine) ValidateTemplate ¶
ValidateTemplate validates a template
type PatchRequest ¶
type PatchRequest struct {
Finding types.Finding `json:"finding"`
TargetFile string `json:"target_file"`
Language string `json:"language"`
PatchType string `json:"patch_type"`
Variables map[string]interface{} `json:"variables"`
}
PatchRequest represents a request to generate a patch
type PatchResult ¶
type PatchResult struct {
Success bool `json:"success"`
PatchData string `json:"patch_data"`
Description string `json:"description"`
Error string `json:"error,omitempty"`
}
PatchResult represents the result of patch generation
type PatchTemplate ¶
type PatchTemplate struct {
Name string `json:"name"`
Language string `json:"language"`
CryptoType string `json:"crypto_type"`
Algorithm string `json:"algorithm"`
Template string `json:"template"`
Variables map[string]string `json:"variables"`
Description string `json:"description"`
}
PatchTemplate represents a patch template