Documentation
¶
Index ¶
- type AppConfig
- type Config
- func (c *Config) DetectAppFromTag(tag string) (string, error)
- func (c *Config) GetAllAppConfigs() []*AppConfig
- func (c *Config) GetAllApps() map[string]AppConfig
- func (c *Config) GetAppConfig(app string) (*AppConfig, error)
- func (c *Config) GetFirst() (*AppConfig, error)
- func (c *Config) IsMultiApp() bool
- func (c *Config) ValidateAppTag(appName, tag string) error
- type HotfixConfig
- type NodeJSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct {
Scheme string `yaml:"scheme"` // "semver" or "calver"
Prefix string `yaml:"prefix"` // Tag prefix, e.g., "v", "api/v"
DefaultBranch string `yaml:"default_branch"` // e.g., "main"
CalVerFormat string `yaml:"calver_format,omitempty"` // e.g., "2006.01.02", "2006.WW"
Pre string `yaml:"pre,omitempty"` // [ALPHA] prerelease identifier
Meta string `yaml:"meta,omitempty"` // [ALPHA] build metadata
Hotfix *HotfixConfig `yaml:"hotfix,omitempty"` // Hotfix workflow settings
NodeJS NodeJSConfig `yaml:"nodejs,omitempty"` // Node.js package.json sync
}
AppConfig represents the forge.yaml configuration file structure.
func Default ¶
func Default() *AppConfig
Default returns a default AppConfig for single app configuration.
func (*AppConfig) GetHotfixConfig ¶ added in v1.3.0
func (ac *AppConfig) GetHotfixConfig() HotfixConfig
GetHotfixConfig returns hotfix config with defaults applied.
type Config ¶
type Config struct {
DefaultApp string `yaml:"defaultApp"`
Apps map[string]AppConfig `yaml:",inline"`
}
func DefaultMulti ¶
func DefaultMulti() *Config
DefaultMulti returns a default Config for multi app configuration.
func Load ¶
Load reads the configuration from the specified path. If the file doesn't exist, returns the default configuration.
func LoadFromDir ¶
LoadFromDir loads the forge.yaml configuration from the specified directory. It looks for forge.yaml or .forge.yaml in that directory.
func (*Config) DetectAppFromTag ¶ added in v1.3.0
DetectAppFromTag determines which app config to use based on tag prefix. Returns empty string for single-app configs.
func (*Config) GetAllAppConfigs ¶ added in v1.3.0
GetAllAppConfigs returns all app configurations as pointers
func (*Config) GetAllApps ¶
GetAllApps returns all app configurations with their names
func (*Config) IsMultiApp ¶
IsMultiApp returns true if this is a multi-app configuration
func (*Config) ValidateAppTag ¶ added in v1.3.0
ValidateAppTag ensures app name matches tag prefix.
type HotfixConfig ¶ added in v1.3.0
type HotfixConfig struct {
// Branch naming prefix. The full branch name is prefix + tag.
// Examples: "release/" creates "release/v1.0.0"
BranchPrefix string `yaml:"branch_prefix"` // Default: "release/"
// Version suffix for hotfix tags
// Examples: "hotfix", "patch", "fix"
Suffix string `yaml:"suffix"` // Default: "hotfix"
}
HotfixConfig holds hotfix workflow configuration.
type NodeJSConfig ¶
type NodeJSConfig struct {
Enabled bool `yaml:"enabled"` // Enable package.json version updates
PackagePath string `yaml:"package_path"` // Path to package.json (relative to repo root, defaults to "./package.json")
}
NodeJSConfig holds Node.js/npm package.json version sync settings.