utils

package
v0.0.0-...-65173de Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshallConfig

func UnmarshallConfig[T any](configFile string, target *T) (*T, error)

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.

Jump to

Keyboard shortcuts

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