Documentation
¶
Index ¶
- func AddProjectFlag(cmd *cobra.Command)
- func ConfigPath(toProject bool, name string) (string, error)
- func ConfigWriteTarget(toProject bool) (*viper.Viper, string, error)
- func FileExists(path string) bool
- func ParseDelimitedList(value string) []string
- func ProjectFlag(cmd *cobra.Command) bool
- func SidecarFile(key string) (string, bool)
- func UserConfigPath(name string) (string, error)
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddProjectFlag ¶ added in v0.239.0
AddProjectFlag registers the --project flag that flips a write command from the userspace baseline (~/.infer/) to the project .infer/ override layer.
func ConfigPath ¶ added in v0.239.0
ConfigPath resolves name under the project .infer/ override when toProject is set, and under the userspace baseline (~/.infer/) otherwise.
func ConfigWriteTarget ¶
ConfigWriteTarget returns a fresh Viper instance for a userspace baseline or sparse project override without writing the fully merged runtime config.
func FileExists ¶
func ParseDelimitedList ¶ added in v0.239.0
ParseDelimitedList parses a comma/newline-separated value into a string slice, dropping empty items - the split rule shared by the INFER_* list environment overrides and `config set` list values.
func ProjectFlag ¶
ProjectFlag checks for the --project flag on the current command or any parent command. Userspace-first model: config writes target the home ~/.infer/ baseline by default; --project opts into a project override.
func SidecarFile ¶ added in v0.236.2
SidecarFile returns the split file a dotted config key lives in, and false for a key that belongs to config.yaml.
func UserConfigPath ¶ added in v0.239.0
UserConfigPath resolves name under the userspace baseline (~/.infer/).
Types ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
State owns configuration and logging initialized for one Cobra command tree. Cobra executes initialization before RunE, so no synchronization is needed.
func (*State) ConfigureDaemonLogging ¶
func (s *State) ConfigureDaemonLogging()
func (*State) DisableStdoutLogging ¶
func (s *State) DisableStdoutLogging()
func (*State) LoadConfig ¶ added in v0.223.0
LoadConfig re-runs the startup load (defaults, config.yaml layers, sidecar files, INFER_* env) and returns a fresh validated config. It leaves the running config and logging alone, so the caller decides what to apply.