config

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	AppName     string
	FlagName    string           // Name of config flag (defaults to "config")
	ConfigName  string           // Config file name without extension (defaults to "config")
	EnvVar      string           // Environment variable (defaults to {APP}_CONFIG)
	SearchPaths []SearchPathType // Search path strategies (defaults to common paths)
	CustomPaths []string         // Custom search paths (when SearchPaths contains SearchPathCustom)
}

Options defines configuration file behavior and search paths.

type SearchPathType

type SearchPathType int

SearchPathType represents different strategies for locating configuration files.

const (
	// SearchPathEtc searches in /etc/{app} directory.
	SearchPathEtc SearchPathType = iota
	// SearchPathHomeHidden searches in $HOME/.{app} directory.
	SearchPathHomeHidden
	// SearchPathWorkingDirHidden searches in $PWD/.{app} directory.
	SearchPathWorkingDirHidden
	// SearchPathExecutableDirHidden searches in {executable_dir}/.{app} directory.
	SearchPathExecutableDirHidden
	// SearchPathCustom uses custom paths provided in CustomPaths field.
	SearchPathCustom
)

Jump to

Keyboard shortcuts

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