config

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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"`
}

Config represents the Buffalo configuration

func Load

func Load() (*Config, error)

Load loads configuration from viper

func LoadFromFile

func LoadFromFile(path string) (*Config, error)

LoadFromFile loads configuration from a specific file

func (*Config) GetEnabledLanguages

func (c *Config) GetEnabledLanguages() []string

GetEnabledLanguages returns a list of enabled languages

func (*Config) GetOutputDir

func (c *Config) GetOutputDir(language string) string

GetOutputDir returns the output directory for a specific language

func (*Config) IsLanguageEnabled

func (c *Config) IsLanguageEnabled(language string) bool

IsLanguageEnabled returns whether a language is enabled

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration

type CppConfig

type CppConfig struct {
	Enabled   bool   `mapstructure:"enabled"`
	Namespace string `mapstructure:"namespace"`
}

CppConfig contains C++-specific settings

type GoConfig

type GoConfig struct {
	Enabled   bool   `mapstructure:"enabled"`
	Module    string `mapstructure:"module"`
	Generator string `mapstructure:"generator"`
}

GoConfig contains Go-specific settings

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 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 ProjectConfig

type ProjectConfig struct {
	Name    string `mapstructure:"name"`
	Version string `mapstructure:"version"`
}

ProjectConfig contains project-level settings

type ProtoConfig

type ProtoConfig struct {
	Paths       []string `mapstructure:"paths"`
	Exclude     []string `mapstructure:"exclude"`
	ImportPaths []string `mapstructure:"import_paths"`
}

ProtoConfig contains proto file settings

type PythonConfig

type PythonConfig struct {
	Enabled   bool   `mapstructure:"enabled"`
	Package   string `mapstructure:"package"`
	Generator string `mapstructure:"generator"`
}

PythonConfig contains Python-specific settings

type RustConfig

type RustConfig struct {
	Enabled   bool   `mapstructure:"enabled"`
	Generator string `mapstructure:"generator"`
}

RustConfig contains Rust-specific settings

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL