Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
LoadConfig populates the fields of interface i with the values from json configuration files in the paths provided and from environment variables that match the interface field names.
paths is an array of directories to look for configuration files. fileName is the name of the configuration file. The extension must be a type supported by the viper package (JSON, TOML, YAML, HCL, envfile and Java properties config). i is an instance of an interface to be populated from the files and environment variables identified.
The method converts camel case field names to environment variables inserting an underscore before upper case characters and outputting all characters as uppercase. For example; the camel case field name ServicePath would become SERVICE_PATH. The interface that is being used for the configuration needs to be consulted because viper passes an upper case version of the field name into the method.
Types ¶
type Base ¶ added in v0.1.5
type Base struct { AzureStorageAccount string `mapstructure:"azureStorageAccount"` AzureStorageAccessKey string `mapstructure:"azureStorageAccessKey"` GcpProject string `mapstructure:"gcpProject"` AwsEnabled bool `mapstructure:"awsEnabled"` Scheme string `mapstructure:"scheme"` // Either https or http Debug bool `mapstructure:"debug"` // True for debug logging HttpPlatformPort int `mapstructure:"httpPlatformPort"` HttpsPlatformPort int `mapstructure:"httpsPlatformPort"` Port int `mapstructure:"port"` }
Configuration details from appsettings.json for access to the AWS, GCP, Azure or local file storage.