Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultBaseDir = ".tempo-files" DefaultGoPackage = "components" DefaultAssetsDir = "assets" DefaultSummaryFormat = "compact" DefaultGuardMarkText = "tempo" )
Default values for the configuration.
Variables ¶
View Source
var ( DefaultNumWorkers = runtime.NumCPU() * 2 TempoConfigFiles = []string{"tempo.yaml", "tempo.yml"} DefaultTemplateExtensions = []string{".gotxt", ".gotmpl", ".tpl"} )
Functions ¶
func DerivedFolderPaths ¶
DerivedFolderPaths returns the derived folder paths based on the base folder.
Types ¶
type App ¶
type App struct {
GoModule string `yaml:"go_module,omitempty"`
GoPackage string `yaml:"go_package,omitempty"`
WithJs bool `yaml:"with_js,omitempty"`
CssLayer string `yaml:"css_layer,omitempty"`
AssetsDir string `yaml:"assets_dir,omitempty"`
}
App contains application-specific settings.
type Config ¶
type Config struct {
TempoRoot string `yaml:"tempo_root"`
App App `yaml:"app,omitempty"`
Paths Paths `yaml:"-"`
Processor Processor `yaml:"processor,omitempty"`
Templates Templates `yaml:"templates,omitempty"`
}
Config represents the configuration settings for the application.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig generates a default configuration with the paths dynamically updated based on DefaultBaseFolder.
func LoadConfig ¶
LoadConfig loads the application configuration from a file or uses default values.
type TemplateFuncProvider ¶
type TemplateFuncProvider struct {
Name string `yaml:"name,omitempty"`
Type string `yaml:"type,omitempty"` // "path" or "url"
Value string `yaml:"value,omitempty"`
}
TemplateFuncProvider represents a function provider that can be loaded from a local path or a remote URL.
type Templates ¶
type Templates struct {
Extensions []string `yaml:"extensions,omitempty"`
GuardMarker string `yaml:"guard_marker,omitempty"`
UserData map[string]any `yaml:"user_data,omitempty"`
FunctionProviders []TemplateFuncProvider `yaml:"function_providers,omitempty"`
}
Templates defines settings related to template files and processing.
Click to show internal directories.
Click to hide internal directories.