Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyDir = errors.New("empty directory")
Functions ¶
func ContextWithLogger ¶ added in v1.0.0
set logger as context value
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func New ¶
Creates new config instance. Provide Options object to set config path and etc. If configuration directory is empty the ErrEmptyDir sentinel error will be returned.
func (*Config) Get ¶
Get method takes dot delimited configuration path and returns value if any. The last parameter specifies which files to allow for searching both with or without extension. If omitted, all files will be search through. The sequence of transmitted files does not change the original order for searching. Second returned value states if it was found and follows comma ok idiom at all.
func (*Config) GetVaultClient ¶ added in v1.0.0
Return created or directly passed vault client
type Options ¶
type Options struct {
Directory string
FileSystem fs.ReadDirFS
Instance string
Deployment string
Hostname string
Logger *slog.Logger
VaultClient *vault.Client
VaultAuth vault.AuthMethod
}
Config options:
Directory: path to config files. May be multiple directories delimited by os specific path separator
FileSystem: an interface that provides access to some point in the file system. The directory path will be considered relative if it is non nil. It can be useful when the configuration is embedded
Instance: is concrete instance number in multi instance deployments
Deployment: is concrete deployment. For example "production" or "development"
Hostname: mean current machine hostname
Logger: produce output to supplied logger. Module will be silent if nil was received.
VaultClient: vault client if you don't want to create a new one
VaultAuth: is AuthMethod interface from vault api module that provides Login method
type VaultConfigAuthType ¶ added in v1.0.0
type VaultConfigAuthType int