Documentation
¶
Index ¶
- func DetectLanguageFromADL(adl *schema.ADL) string
- func GetGeneratedFileHeader(fileType string, cliVersion string, generatedAt time.Time) string
- type Context
- type Engine
- func (e *Engine) Execute(templateContent string, ctx Context) (string, error)
- func (e *Engine) ExecuteTemplate(templateKey string, ctx Context) (string, error)
- func (e *Engine) ExecuteToolTemplate(templateKey string, skillData any) (string, error)
- func (e *Engine) ExecuteToolTemplateWithContext(templateKey string, skillData any, ctx Context) (string, error)
- func (e *Engine) ExecuteWithHeader(templateContent string, ctx Context, fileName string) (string, error)
- func (e *Engine) GetFiles(adl *schema.ADL) map[string]string
- func (e *Engine) GetTemplate() string
- type Registry
- type RegistryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectLanguageFromADL ¶ added in v0.7.0
DetectLanguageFromADL detects the programming language from ADL
Types ¶
type Context ¶
type Context struct {
ADL *schema.ADL
Metadata schema.GeneratedMetadata
Language string
GenerateCI bool
GenerateCD bool
EnableAI bool
GenerateCommand string
// contains filtered or unexported fields
}
Context provides data for template execution
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine handles template execution
func NewWithRegistry ¶ added in v0.7.0
NewWithRegistry creates a new template engine with a registry
func (*Engine) ExecuteTemplate ¶ added in v0.7.0
ExecuteTemplate executes a template from the registry with the given context
func (*Engine) ExecuteToolTemplate ¶ added in v0.7.3
ExecuteToolTemplate executes a skill template with skill-specific data
func (*Engine) ExecuteToolTemplateWithContext ¶ added in v0.19.0
func (e *Engine) ExecuteToolTemplateWithContext(templateKey string, skillData any, ctx Context) (string, error)
ExecuteToolTemplateWithContext executes a skill template with ADL context for custom acronyms
func (*Engine) ExecuteWithHeader ¶
func (e *Engine) ExecuteWithHeader(templateContent string, ctx Context, fileName string) (string, error)
ExecuteWithHeader executes a template with the given context and adds a header if needed
func (*Engine) GetFiles ¶
GetFiles returns the template files for the current template with ADL context
func (*Engine) GetTemplate ¶
GetTemplate returns the template name
type Registry ¶ added in v0.7.0
type Registry struct {
// contains filtered or unexported fields
}
Registry manages template loading and lookup
func NewRegistry ¶ added in v0.7.0
NewRegistry creates a new template registry for the specified language
func NewRegistryWithOptions ¶ added in v0.16.0
func NewRegistryWithOptions(opts RegistryOptions) (*Registry, error)
NewRegistryWithOptions creates a new template registry with options
func (*Registry) GetFiles ¶ added in v0.7.0
GetFiles returns all files that should be generated for the current language
func (*Registry) GetTemplate ¶ added in v0.7.0
GetTemplate retrieves a template by key
func (*Registry) ListTemplates ¶ added in v0.7.0
ListTemplates returns a list of all loaded template keys
type RegistryOptions ¶ added in v0.16.0
RegistryOptions holds options for creating a new registry