Documentation
¶
Overview ¶
Package config provides configuration management for Buffalo.
Index ¶
- func DefaultExternalPrefixes() []string
- type BuildConfig
- type CacheConfig
- type Config
- type CppConfig
- type CppLock
- type DependencyLock
- type GoConfig
- type GoLock
- type LanguagesConfig
- type LanguagesLock
- type LockFile
- type LockFileManager
- func (m *LockFileManager) Generate(cfg *Config, protoFiles []string) (*LockFile, error)
- func (m *LockFileManager) GetLockPath() string
- func (m *LockFileManager) Load() (*LockFile, error)
- func (m *LockFileManager) NeedsRegeneration() (bool, string, error)
- func (m *LockFileManager) Save(lock *LockFile) error
- type LoggingConfig
- type OutputConfig
- type PluginConfig
- type ProjectConfig
- type ProjectLock
- type ProtoConfig
- type ProtoFileLock
- type ProtoLock
- type PythonConfig
- type PythonLock
- type RustConfig
- type RustLock
- type TemplateConfig
- type ToolsLock
- type VersioningConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultExternalPrefixes ¶ added in v1.2.0
func DefaultExternalPrefixes() []string
DefaultExternalPrefixes returns the default list of external import prefixes that should not be modified during import fixing
Types ¶
type BuildConfig ¶
type BuildConfig struct {
Workers int `mapstructure:"workers"`
Incremental bool `mapstructure:"incremental"`
Cache CacheConfig `mapstructure:"cache"`
}
BuildConfig contains build settings
type CacheConfig ¶
type CacheConfig struct {
Enabled bool `mapstructure:"enabled"`
Directory string `mapstructure:"directory"`
}
CacheConfig contains cache settings
type Config ¶
type Config struct {
Project ProjectConfig `mapstructure:"project"`
Proto ProtoConfig `mapstructure:"proto"`
Output OutputConfig `mapstructure:"output"`
Languages LanguagesConfig `mapstructure:"languages"`
Build BuildConfig `mapstructure:"build"`
Versioning VersioningConfig `mapstructure:"versioning"`
Logging LoggingConfig `mapstructure:"logging"`
Dependencies []dependency.Dependency `mapstructure:"dependencies"`
Plugins []PluginConfig `mapstructure:"plugins"`
Templates []TemplateConfig `mapstructure:"templates"`
}
Config represents the Buffalo configuration
func LoadFromFile ¶
LoadFromFile loads configuration from a specific file
func (*Config) GetEnabledLanguages ¶
GetEnabledLanguages returns a list of enabled languages
func (*Config) GetOutputDir ¶
GetOutputDir returns the output directory for a specific language
func (*Config) IsLanguageEnabled ¶
IsLanguageEnabled returns whether a language is enabled
type CppConfig ¶
type CppConfig struct {
Enabled bool `mapstructure:"enabled"`
Namespace string `mapstructure:"namespace"`
}
CppConfig contains C++-specific settings
type CppLock ¶ added in v1.2.0
type CppLock struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty"`
OutputDir string `yaml:"output_dir" json:"output_dir"`
}
CppLock contains locked C++ configuration
type DependencyLock ¶ added in v1.2.0
type DependencyLock struct {
Name string `yaml:"name" json:"name"`
Type string `yaml:"type" json:"type"` // git, http, local
URL string `yaml:"url,omitempty" json:"url,omitempty"`
Version string `yaml:"version,omitempty" json:"version,omitempty"`
Path string `yaml:"path,omitempty" json:"path,omitempty"`
Hash string `yaml:"hash" json:"hash"`
// ExternalPrefixes are the detected external import prefixes from this dependency
ExternalPrefixes []string `yaml:"external_prefixes,omitempty" json:"external_prefixes,omitempty"`
}
DependencyLock contains locked dependency information
type GoConfig ¶
type GoConfig struct {
Enabled bool `mapstructure:"enabled"`
Module string `mapstructure:"module"`
Generator string `mapstructure:"generator"`
}
GoConfig contains Go-specific settings
type GoLock ¶ added in v1.2.0
type GoLock struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Module string `yaml:"module,omitempty" json:"module,omitempty"`
OutputDir string `yaml:"output_dir" json:"output_dir"`
}
GoLock contains locked Go configuration
type LanguagesConfig ¶
type LanguagesConfig struct {
Python PythonConfig `mapstructure:"python"`
Go GoConfig `mapstructure:"go"`
Rust RustConfig `mapstructure:"rust"`
Cpp CppConfig `mapstructure:"cpp"`
}
LanguagesConfig contains language-specific settings
type LanguagesLock ¶ added in v1.2.0
type LanguagesLock struct {
Python *PythonLock `yaml:"python,omitempty" json:"python,omitempty"`
Go *GoLock `yaml:"go,omitempty" json:"go,omitempty"`
Rust *RustLock `yaml:"rust,omitempty" json:"rust,omitempty"`
Cpp *CppLock `yaml:"cpp,omitempty" json:"cpp,omitempty"`
}
LanguagesLock contains locked language configurations
type LockFile ¶ added in v1.2.0
type LockFile struct {
// Version of the lock file format
Version string `yaml:"version" json:"version"`
// GeneratedAt is when the lock file was generated
GeneratedAt time.Time `yaml:"generated_at" json:"generated_at"`
// ConfigHash is the SHA256 hash of the buffalo.yaml file
ConfigHash string `yaml:"config_hash" json:"config_hash"`
// Project information
Project ProjectLock `yaml:"project" json:"project"`
// Proto files information
Proto ProtoLock `yaml:"proto" json:"proto"`
// Languages configuration with resolved values
Languages LanguagesLock `yaml:"languages" json:"languages"`
// Dependencies with resolved versions and hashes
Dependencies []DependencyLock `yaml:"dependencies" json:"dependencies"`
// Tools information
Tools ToolsLock `yaml:"tools" json:"tools"`
}
LockFile represents the buffalo.lock file structure
func (*LockFile) GetExcludeImports ¶ added in v1.2.0
GetExcludeImports returns the resolved exclude imports for Python
func (*LockFile) HasProtoFileChanged ¶ added in v1.2.0
HasProtoFileChanged checks if a specific proto file has changed
type LockFileManager ¶ added in v1.2.0
type LockFileManager struct {
// contains filtered or unexported fields
}
LockFileManager manages buffalo.lock file operations
func NewLockFileManager ¶ added in v1.2.0
func NewLockFileManager(configPath string) *LockFileManager
NewLockFileManager creates a new lock file manager
func (*LockFileManager) Generate ¶ added in v1.2.0
func (m *LockFileManager) Generate(cfg *Config, protoFiles []string) (*LockFile, error)
Generate generates a new lock file from the config
func (*LockFileManager) GetLockPath ¶ added in v1.2.0
func (m *LockFileManager) GetLockPath() string
GetLockPath returns the path to the lock file
func (*LockFileManager) Load ¶ added in v1.2.0
func (m *LockFileManager) Load() (*LockFile, error)
Load loads the lock file from disk
func (*LockFileManager) NeedsRegeneration ¶ added in v1.2.0
func (m *LockFileManager) NeedsRegeneration() (bool, string, error)
NeedsRegeneration checks if the lock file needs to be regenerated
func (*LockFileManager) Save ¶ added in v1.2.0
func (m *LockFileManager) Save(lock *LockFile) error
Save saves the lock file to disk
type LoggingConfig ¶
type LoggingConfig struct {
Level string `mapstructure:"level"`
Format string `mapstructure:"format"`
Output string `mapstructure:"output"`
File string `mapstructure:"file"`
}
LoggingConfig contains logging settings
type OutputConfig ¶
type OutputConfig struct {
BaseDir string `mapstructure:"base_dir"`
Directories map[string]string `mapstructure:"directories"`
PreserveProtoStructure bool `mapstructure:"preserve_proto_structure"`
}
OutputConfig contains output settings
type PluginConfig ¶ added in v1.0.0
type PluginConfig struct {
Name string `mapstructure:"name"`
Enabled bool `mapstructure:"enabled"`
HookPoints []string `mapstructure:"hooks"`
Priority int `mapstructure:"priority"`
Options map[string]interface{} `mapstructure:"config"`
}
PluginConfig contains plugin configuration
type ProjectConfig ¶
type ProjectConfig struct {
Name string `mapstructure:"name"`
Version string `mapstructure:"version"`
}
ProjectConfig contains project-level settings
type ProjectLock ¶ added in v1.2.0
type ProjectLock struct {
Name string `yaml:"name" json:"name"`
Version string `yaml:"version" json:"version"`
}
ProjectLock contains locked project information
type ProtoConfig ¶
type ProtoConfig struct {
Paths []string `mapstructure:"paths"`
Exclude []string `mapstructure:"exclude"`
ImportPaths []string `mapstructure:"import_paths"`
}
ProtoConfig contains proto file settings
type ProtoFileLock ¶ added in v1.2.0
type ProtoFileLock struct {
Hash string `yaml:"hash" json:"hash"`
Size int64 `yaml:"size" json:"size"`
ModifiedAt time.Time `yaml:"modified_at" json:"modified_at"`
Package string `yaml:"package,omitempty" json:"package,omitempty"`
Dependencies []string `yaml:"dependencies,omitempty" json:"dependencies,omitempty"`
}
ProtoFileLock contains locked information for a single proto file
type ProtoLock ¶ added in v1.2.0
type ProtoLock struct {
// Files is a map of proto file path to its hash
Files map[string]ProtoFileLock `yaml:"files" json:"files"`
// ImportPaths are the resolved import paths
ImportPaths []string `yaml:"import_paths" json:"import_paths"`
// TotalFiles count
TotalFiles int `yaml:"total_files" json:"total_files"`
}
ProtoLock contains locked proto files information
type PythonConfig ¶
type PythonConfig struct {
Enabled bool `mapstructure:"enabled"`
Package string `mapstructure:"package"`
Generator string `mapstructure:"generator"`
WorkDir string `mapstructure:"workdir"`
ExcludeImports []string `mapstructure:"exclude_imports"`
}
PythonConfig contains Python-specific settings
type PythonLock ¶ added in v1.2.0
type PythonLock struct {
Enabled bool `yaml:"enabled" json:"enabled"`
// WorkDir is the working directory prefix for imports
WorkDir string `yaml:"workdir,omitempty" json:"workdir,omitempty"`
// ExcludeImports are prefixes to exclude from import fixing (auto-detected + user-defined)
ExcludeImports []string `yaml:"exclude_imports" json:"exclude_imports"`
// OutputDir is the resolved output directory
OutputDir string `yaml:"output_dir" json:"output_dir"`
}
PythonLock contains locked Python configuration
type RustConfig ¶
type RustConfig struct {
Enabled bool `mapstructure:"enabled"`
Generator string `mapstructure:"generator"`
}
RustConfig contains Rust-specific settings
type RustLock ¶ added in v1.2.0
type RustLock struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Generator string `yaml:"generator,omitempty" json:"generator,omitempty"`
OutputDir string `yaml:"output_dir" json:"output_dir"`
}
RustLock contains locked Rust configuration
type TemplateConfig ¶ added in v1.0.0
type TemplateConfig struct {
Name string `mapstructure:"name"`
Language string `mapstructure:"language"`
Path string `mapstructure:"path"`
Patterns []string `mapstructure:"patterns"`
Vars map[string]string `mapstructure:"vars"`
}
TemplateConfig contains template configuration
type ToolsLock ¶ added in v1.2.0
type ToolsLock struct {
Protoc string `yaml:"protoc,omitempty" json:"protoc,omitempty"`
ProtocVersion string `yaml:"protoc_version,omitempty" json:"protoc_version,omitempty"`
}
ToolsLock contains locked tools information
type VersioningConfig ¶
type VersioningConfig struct {
Enabled bool `mapstructure:"enabled"`
Strategy string `mapstructure:"strategy"` // hash, timestamp, semantic, git
OutputFormat string `mapstructure:"output_format"` // directory, suffix
KeepVersions int `mapstructure:"keep_versions"` // 0 = keep all, >0 = keep N latest
}
VersioningConfig contains versioning settings