Documentation
¶
Index ¶
Constants ¶
const SecretDefaultRE = "(key)|(secret)|(pass)|(password)|(cert)|(certificate)"
SecretDefaultRE is the default regular expression used to identify secret values automatically.
Variables ¶
var SecretRE = regexp.MustCompile(SecretDefaultRE)
SecretRE is the regular expression used to identify secret values automatically. In case there are different properties to identify secrets, extend it.
Functions ¶
func HideSecrets ¶ added in v0.4.0
HideSecrets hides secrets in the given YAML node structure. Secrets are identified using the SecretRE. Depending on the parameter `hideStructure` the structure of the secret is hidden too (`true`) or visible (`false`).
Types ¶
type Config ¶
type Config[T any] struct { // contains filtered or unexported fields }
Config is the generic structure holding the configuration information for the specified type.
func FromFiles ¶ added in v0.3.0
FromFiles loads a series of configuration files. The first file is considered the base, all others are loaded on top of that one using the MergeYAMLNodes functionality.
func (*Config[T]) Get ¶
func (c *Config[T]) Get() *T
Get gives a pointer to the deserialized configuration.
func (*Config[T]) ToFile ¶
ToFile saves a configuration to a file with the given name, replacing it in case.
func (*Config[T]) ToSecretsHidden ¶
ToSecretsHidden writes the configuration to the given io.Writer and hides secret values using the SecretRE. Strings are replaced with the number of * corresponding to their length. Substructures containing secrets, are replaced with a single '*'. The following example
id: id0 secrets: - secret0 - secret1
thus will be replaced by
id: id0 secrets: *
func (*Config[T]) ToSecretsHiddenStructured ¶ added in v0.4.0
ToSecretsHiddenStructured writes the configuration to the given io.Writer and hides secret values using the SecretRE. Strings are replaced with the number of * corresponding to their length. Substructures containing secrets, are replaced with a corresponding structure of '*'. The following example
id: id0 secrets: - secret0 - secret1
thus will be replaced by
id: id0 secrets: - ******* - *******
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
overlay
command
|
|
|
simple
command
|
|
|
templating/arg
command
|
|
|
templating/env
command
|
|
|
templating/hasArg
command
|
|
|
templating/read
command
|
|
|
validate
command
|