Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshallConfig ¶
UnmarshallConfig is a generic function that unmarshals configuration data from a file into a target object. Parameters: - configFile string: The path to the configuration file. - target *T: A pointer to the target object that will hold the unmarshaled data. Return value: - *T: A pointer to the target object populated with the unmarshaled data. - error: If an error occurs during the unmarshaling process, the corresponding error message is returned.
func UnmarshallConfigFromString ¶
func UnmarshallConfigFromString[T any](configContent string, configType string, target *T) (*T, error)
UnmarshallConfigFromString is a generic function that unmarshals configuration data from a string into a target object. Parameters: - configContent string: The configuration content as a string. - configType string: The type of configuration (e.g., "yaml", "json", "toml"). If empty, the function will try to auto-detect the format. - target *T: A pointer to the target object that will hold the unmarshaled data. Return value: - *T: A pointer to the target object populated with the unmarshaled data. - error: If an error occurs during the unmarshaling process, the corresponding error message is returned.
Types ¶
This section is empty.