Documentation
¶
Index ¶
- func GetBuiltinTemplates() map[string]*TemplateConfig
- type TemplateConfig
- type TemplateEngine
- func (te *TemplateEngine) CreateBuiltinTemplates() error
- func (te *TemplateEngine) DeleteTemplate(name string) error
- func (te *TemplateEngine) GenerateConfig(templateName string, variables map[string]interface{}) (map[string]interface{}, error)
- func (te *TemplateEngine) GetTemplateInfo(name string) (*TemplateConfig, error)
- func (te *TemplateEngine) InterpolateString(s string, variables map[string]interface{}) (string, error)
- func (te *TemplateEngine) ListTemplates() ([]string, error)
- func (te *TemplateEngine) LoadTemplate(name string) (*TemplateConfig, error)
- func (te *TemplateEngine) SaveTemplate(name string, config *TemplateConfig) error
- func (te *TemplateEngine) ValidateTemplate(config *TemplateConfig) error
- type TemplateVariable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBuiltinTemplates ¶
func GetBuiltinTemplates() map[string]*TemplateConfig
GetBuiltinTemplates returns a map of built-in template configurations.
Types ¶
type TemplateConfig ¶
type TemplateConfig struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Template map[string]interface{} `yaml:"template"`
Variables []TemplateVariable `yaml:"variables"`
}
TemplateConfig represents a template configuration.
type TemplateEngine ¶
TemplateEngine handles configuration template processing.
func NewTemplateEngine ¶
func NewTemplateEngine(templateDir string) *TemplateEngine
NewTemplateEngine creates a new template engine.
func (*TemplateEngine) CreateBuiltinTemplates ¶
func (te *TemplateEngine) CreateBuiltinTemplates() error
CreateBuiltinTemplates creates built-in template files.
func (*TemplateEngine) DeleteTemplate ¶
func (te *TemplateEngine) DeleteTemplate(name string) error
DeleteTemplate deletes a template.
func (*TemplateEngine) GenerateConfig ¶
func (te *TemplateEngine) GenerateConfig(templateName string, variables map[string]interface{}) (map[string]interface{}, error)
GenerateConfig generates a configuration from a template.
func (*TemplateEngine) GetTemplateInfo ¶
func (te *TemplateEngine) GetTemplateInfo(name string) (*TemplateConfig, error)
GetTemplateInfo returns information about a template.
func (*TemplateEngine) InterpolateString ¶
func (te *TemplateEngine) InterpolateString(s string, variables map[string]interface{}) (string, error)
InterpolateString interpolates template variables in a string.
func (*TemplateEngine) ListTemplates ¶
func (te *TemplateEngine) ListTemplates() ([]string, error)
ListTemplates returns available template names.
func (*TemplateEngine) LoadTemplate ¶
func (te *TemplateEngine) LoadTemplate(name string) (*TemplateConfig, error)
LoadTemplate loads a template configuration by name.
func (*TemplateEngine) SaveTemplate ¶
func (te *TemplateEngine) SaveTemplate(name string, config *TemplateConfig) error
SaveTemplate saves a template configuration.
func (*TemplateEngine) ValidateTemplate ¶
func (te *TemplateEngine) ValidateTemplate(config *TemplateConfig) error
ValidateTemplate validates a template configuration.
type TemplateVariable ¶
type TemplateVariable struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Required bool `yaml:"required"`
Type string `yaml:"type"`
DefaultValue interface{} `yaml:"default,omitempty"`
Options []string `yaml:"options,omitempty"`
}
TemplateVariable represents a template variable definition.