Documentation
¶
Index ¶
- func GetDefaultFuncs() template.FuncMap
- type Manager
- func (m *Manager) Get(name string) (*Template, error)
- func (m *Manager) List() []*Template
- func (m *Manager) ListByLanguage(lang string) []*Template
- func (m *Manager) Register(tmpl *Template) error
- func (m *Manager) Render(ctx context.Context, templateName string, data interface{}, outputPath string) error
- type Template
- type TemplateConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultFuncs ¶
GetDefaultFuncs returns default template functions
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages code generation templates
func NewManager ¶
NewManager creates a new template manager
func (*Manager) ListByLanguage ¶
ListByLanguage returns templates for a specific language
type Template ¶
type Template struct {
Name string // Template name
Language string // Target language
Path string // Template files path
Patterns []string // File patterns to match (*.tmpl)
Vars map[string]string // Template variables
Funcs template.FuncMap // Custom template functions
}
Template represents a code generation template
type TemplateConfig ¶
type TemplateConfig struct {
Templates []Template `yaml:"templates" mapstructure:"templates"`
}
TemplateConfig holds template configuration
Click to show internal directories.
Click to hide internal directories.