Documentation
¶
Index ¶
- func GenerateProject(templateName, projectPath, projectName, router string) error
- func ListTemplates() ([]string, error)
- type BackendConfig
- type FrontendOptions
- type FrontendTemplateInfo
- type Manager
- func (m *Manager) GenerateFrontend(templateName, frontendName, frontendPath string, data TemplateData) error
- func (m *Manager) GenerateProject(templateName, projectPath, projectName, router string, ...) error
- func (m *Manager) GetTemplate(name string) (*TemplateManifest, bool)
- func (m *Manager) GetTemplateNames() map[string]string
- func (m *Manager) ListTemplates() []string
- func (m *Manager) LoadTemplates() error
- type TemplateData
- type TemplateManifest
- type TemplateOption
- type TemplateVar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateProject ¶
GenerateProject creates a new project from templates using the new unified system
func ListTemplates ¶
ListTemplates returns all available template files (legacy function for compatibility)
Types ¶
type BackendConfig ¶
type BackendConfig struct {
SupportedRouters []string `yaml:"supported_routers"`
Features []string `yaml:"features"`
}
BackendConfig defines the backend configuration for a template
type FrontendOptions ¶
type FrontendOptions struct {
EnableScriptFrontends bool `yaml:"enable_script_frontends"`
Options []FrontendTemplateInfo `yaml:"options"`
}
FrontendOptions defines the frontend configuration options
type FrontendTemplateInfo ¶
type FrontendTemplateInfo struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Framework string `yaml:"framework"`
DevCmd string `yaml:"dev_cmd"`
BuildCmd string `yaml:"build_cmd"`
TypesDir string `yaml:"types_dir"`
LibDir string `yaml:"lib_dir"`
StaticGen config.StaticGenConfig `yaml:"static_gen"`
}
FrontendTemplateInfo contains metadata about a frontend template option
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles unified template operations
func GetTemplateManager ¶
GetTemplateManager creates and loads a template manager
func (*Manager) GenerateFrontend ¶
func (m *Manager) GenerateFrontend(templateName, frontendName, frontendPath string, data TemplateData) error
GenerateFrontend creates a frontend from template's frontend options
func (*Manager) GenerateProject ¶
func (m *Manager) GenerateProject(templateName, projectPath, projectName, router string, customVars map[string]interface{}) error
GenerateProject creates a new project from a template
func (*Manager) GetTemplate ¶
func (m *Manager) GetTemplate(name string) (*TemplateManifest, bool)
GetTemplate returns a template by name
func (*Manager) GetTemplateNames ¶
GetTemplateNames returns all available template names with descriptions
func (*Manager) ListTemplates ¶
ListTemplates returns all available template names
func (*Manager) LoadTemplates ¶
LoadTemplates loads all available templates from embedded filesystem
type TemplateData ¶
type TemplateData struct {
ProjectName string
ModuleName string
GoVersion string
Port string
Router string
SPARouting bool
ProjectDescription string
CustomVars map[string]interface{}
}
TemplateData contains the data passed to templates
type TemplateManifest ¶
type TemplateManifest struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
URL string `yaml:"url,omitempty"`
Version string `yaml:"version"`
Backend BackendConfig `yaml:"backend"`
Frontend FrontendOptions `yaml:"frontend"`
Variables []TemplateVar `yaml:"template_variables,omitempty"`
}
TemplateManifest represents the main template.yaml configuration
func LoadTemplateFromData ¶
func LoadTemplateFromData(data []byte) (*TemplateManifest, error)
LoadTemplateFromData loads a template from raw data
type TemplateOption ¶
TemplateOption represents an option for select-type template variables
type TemplateVar ¶
type TemplateVar struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Description string `yaml:"description"`
Default interface{} `yaml:"default,omitempty"`
Options []TemplateOption `yaml:"options,omitempty"`
}
TemplateVar represents a template variable definition