internalconfig

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Description

func Description(appName string, opts config.Options) string

Description creates a description based on the search paths

func KeyRemappingHook

func KeyRemappingHook(aliasToPathMap map[string]string, defaultsMap map[string]string) mapstructure.DecodeHookFunc

KeyRemappingHook allows config keys to match either a field's name or its `flag` tag.

It correctly handles flattened keys that point to nested struct fields.

func Merge

func Merge(globalSettings map[string]any, c *cobra.Command) map[string]any

Merge creates a configuration map for a specific command.

It merges the top-level settings with command-specific settings (which can be nested) from the global configuration.

func SetupConfig

func SetupConfig(configFile string, appName string, opts config.Options)

SetupConfig handles the viper initialization

func SyncMandatoryFlags

func SyncMandatoryFlags(c *cobra.Command, T reflect.Type, vip *viper.Viper, structPath string)

SyncMandatoryFlags tells cobra that a required flag is present when its value is provided by a source other than the command line (e.g., config file).

Types

This section is empty.

Jump to

Keyboard shortcuts

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