config

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadString

func LoadString[T any](configString string, envPrefix ...string) (*T, error)

LoadString loads configuration from a string with optional environment variable support. Parameters: - configString: The configuration string in YAML format - envPrefix: Optional environment variable prefix (default: "ENV") - configFn: Optional function to customize viper configuration before unmarshaling

func LoadStringWithConfig

func LoadStringWithConfig[T any](configString string, configFn func(*viper.Viper), envPrefix ...string) (*T, error)

LoadStringWithConfig loads configuration from a string with optional environment variable support and allows custom configuration of viper. Parameters: - configString: The configuration string in YAML format - configFn: Optional function to customize viper configuration before unmarshaling - envPrefix: Optional environment variable prefix (default: "ENV")

func NestedEnvVars

func NestedEnvVars(prefix string, keyDepth int, configPath string, viperConfig *viper.Viper)

NestedEnvVars processes environment variables with a specific prefix and sets them in the viper configuration. This function is useful for handling nested configuration structures from environment variables. Parameters: - prefix: The prefix for environment variables to process - keyDepth: The depth at which entity names are found in the key parts - configPath: The base path in the configuration where values should be set - viperConfig: The viper configuration instance to modify

Types

This section is empty.

Jump to

Keyboard shortcuts

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