Documentation
¶
Overview ¶
Package generator provides output file generation for ai_rules.
Index ¶
- func ComputeContentHashPooled(content string) string
- type Generator
- func (g *Generator) GenerateAll(cfg *config.Config) error
- func (g *Generator) GenerateAllConcurrent(cfg *config.Config) error
- func (g *Generator) GenerateOutput(cfg *config.Config, outputFile string) error
- func (g *Generator) GetSupportedTemplates() []string
- func (g *Generator) PreviewAll(cfg *config.Config) (map[string]string, error)
- func (g *Generator) PreviewOutput(cfg *config.Config, outputFile string) (string, error)
- func (g *Generator) RegisterTemplate(name, templateStr string) error
- func (*Generator) ValidateTemplate(templateStr string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeContentHashPooled ¶
ComputeContentHashPooled computes SHA256 hash using a pooled hasher.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator handles the generation of output files from configuration.
func NewWithBaseDir ¶
NewWithBaseDir creates a new generator with a specific base directory.
func NewWithConfigFile ¶ added in v1.1.3
NewWithConfigFile creates a new generator with a specific config file.
func NewWithRenderer ¶
NewWithRenderer creates a generator with a custom renderer.
func (*Generator) GenerateAll ¶
GenerateAll generates all output files defined in the configuration.
func (*Generator) GenerateAllConcurrent ¶
GenerateAllConcurrent generates all output files concurrently.
func (*Generator) GenerateOutput ¶
GenerateOutput generates a single output file.
func (*Generator) GetSupportedTemplates ¶
GetSupportedTemplates returns all available template names.
func (*Generator) PreviewAll ¶
PreviewAll generates all output content without writing files. Returns a map of file paths to their generated content.
func (*Generator) PreviewOutput ¶
PreviewOutput generates output content without writing to file.
func (*Generator) RegisterTemplate ¶
RegisterTemplate adds a custom template to the generator's renderer.
func (*Generator) ValidateTemplate ¶
ValidateTemplate checks if a template string is valid.