appconfig

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package appconfig defines application configuration defaults and schema.

Package appconfig defines application configuration defaults and schema.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RootPath         string          `yaml:"root_path"`
	ProjectDirPrefix string          `yaml:"project_dir_prefix"`
	GitLocation      string          `yaml:"git_location"`
	LogLevel         zerolog.Level   `yaml:"log_level"`
	PostSteps        PostStepsConfig `yaml:"post_steps"`
}

Config contains app-wide settings loaded from defaults, YAML, and CLI overrides.

func Default

func Default() *Config

Default returns a config initialized with built-in defaults.

func (*Config) ApplyCreateOverrides added in v0.2.4

func (c *Config) ApplyCreateOverrides(overrides CreateOverrides)

ApplyCreateOverrides applies create command flag overrides to the config.

func (*Config) ApplyRootOverrides added in v0.2.4

func (c *Config) ApplyRootOverrides(overrides RootOverrides)

ApplyRootOverrides applies root command flag overrides to the config.

func (*Config) LoadYAML

func (c *Config) LoadYAML(path string) error

LoadYAML merges YAML configuration from path into the config.

func (*Config) Normalize

func (c *Config) Normalize()

Normalize expands config values that should be resolved before command execution.

type CreateOverrides added in v0.2.4

type CreateOverrides struct {
	RootPath         *string
	ProjectDirPrefix *string
	GitLocation      *string
	NoGoGetUpdate    bool
	NoGoModTidy      bool
	NoGitInit        bool
	NoGitCommit      bool
}

CreateOverrides contains create command flag values that can override config.

type PostStepsConfig

type PostStepsConfig struct {
	GoGetUpdate bool `yaml:"go_get_update"`
	GoModTidy   bool `yaml:"go_mod_tidy"`
	GitInit     bool `yaml:"git_init"`
	GitCommit   bool `yaml:"git_commit"`
}

PostStepsConfig contains configurable post-generation step toggles.

type RootOverrides added in v0.2.4

type RootOverrides struct {
	LogLevel *zerolog.Level
}

RootOverrides contains root command flag values that can override config.

Jump to

Keyboard shortcuts

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