config

package
v0.6.10 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ProjectConfigFile = "taufinity.yaml"

ProjectConfigFile is the filename for per-project configuration.

Variables

This section is empty.

Functions

func Dir

func Dir() string

Dir returns the path to the taufinity config directory.

func FindProjectRoot

func FindProjectRoot(startDir string) (string, error)

FindProjectRoot walks up the directory tree to find taufinity.yaml.

func Get

func Get(key string) (string, error)

Get returns a config property value.

func List

func List() (map[string]string, error)

List returns all config properties as a map.

func Reset

func Reset() error

Reset removes the config file, resetting all settings to defaults.

func Set

func Set(key, value string) error

Set sets a config property and saves.

func Unset

func Unset(key string) error

Unset removes a specific config property.

Types

type ProjectConfig

type ProjectConfig struct {
	Site        string   `yaml:"site,omitempty"`
	Template    string   `yaml:"template,omitempty"`
	PreviewData string   `yaml:"preview_data,omitempty"`
	Ignore      []string `yaml:"ignore,omitempty"`
	Warnings    []string `yaml:"-"` // Populated during loading (e.g. unknown keys)
}

ProjectConfig holds per-project configuration from taufinity.yaml.

func LoadProject

func LoadProject(dir string) (*ProjectConfig, error)

LoadProject reads the project config from the given directory.

func LoadProjectFromCwd

func LoadProjectFromCwd() (*ProjectConfig, string, error)

LoadProjectFromCwd finds and loads project config from current directory or parents.

type UserConfig

type UserConfig struct {
	Site   string `yaml:"site,omitempty"`
	APIURL string `yaml:"api_url,omitempty"`
	Org    string `yaml:"org,omitempty"`

	// UpdateCheck controls the background staleness check. Empty = enabled,
	// "false" = disabled. Kept as a string to stay consistent with the other
	// string-valued config keys handled by Set/Get/List.
	UpdateCheck string `yaml:"update_check,omitempty"`

	// AutoUpdate, when "true", automatically runs `taufinity update` at exit
	// whenever a newer version is detected. The update uses the same backup +
	// smoke-test + auto-rollback logic as the manual `taufinity update` command,
	// so a bad build is reverted automatically and users are never locked out.
	// Opt in: taufinity config set auto_update true
	AutoUpdate string `yaml:"auto_update,omitempty"`
}

UserConfig holds user-level configuration stored in ~/.config/taufinity/config.yaml.

func Load

func Load() (*UserConfig, error)

Load reads the user config from disk.

func (*UserConfig) Save

func (c *UserConfig) Save() error

Save writes the user config to disk.

Jump to

Keyboard shortcuts

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