Documentation ¶
Overview ¶
Package configuration is in charge of the validation and extraction of all the configuration details from a configuration file.
Index ¶
- type Data
- func (c *Data) GetAuthServiceURL() string
- func (c *Data) GetDevModePrivateKey() []byte
- func (c *Data) GetHTTPAddress() string
- func (c *Data) GetLogLevel() string
- func (c *Data) GetMadrillAPIKey() string
- func (c *Data) GetMetricsHTTPAddress() string
- func (c *Data) GetServiceAccountID() string
- func (c *Data) GetServiceAccountSecret() string
- func (c *Data) GetWITURL() string
- func (c *Data) GetWebURL() string
- func (c *Data) IsDeveloperModeEnabled() bool
- func (c *Data) IsLogJSON() bool
- func (c *Data) String() string
- func (c *Data) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data encapsulates the Viper configuration object which stores the configuration data in-memory.
func GetData ¶
GetData is a wrapper over NewData which reads configuration file path from the environment variable.
func NewData ¶
NewData creates a configuration reader object using a configurable configuration file path
func (*Data) GetAuthServiceURL ¶
GetAuthServiceURL return the base Auth API URL
func (*Data) GetDevModePrivateKey ¶
GetDevModePrivateKey returns the private key and its ID used in tests
func (*Data) GetHTTPAddress ¶
GetHTTPAddress returns the HTTP address (as set via default, config file, or environment variable) that the notification server binds to (e.g. "0.0.0.0:8080")
func (*Data) GetLogLevel ¶
GetLogLevel returns the loggging level (as set via config file or environment variable)
func (*Data) GetMadrillAPIKey ¶
GetMadrillAPIKey returns the API key used by the email sender
func (*Data) GetMetricsHTTPAddress ¶
GetMetricsHTTPAddress returns the address the /metrics endpoing will be mounted. By default GetMetricsHTTPAddress is the same as GetHTTPAddress
func (*Data) GetServiceAccountID ¶
GetServiceAccountID returns service account ID for the notification service. This will be used by the notification service to request for a service account token from the Auth service.
func (*Data) GetServiceAccountSecret ¶
GetServiceAccountSecret returns service account secret for the notification service. This will be used by the notification service to request for a service account token from the Auth service.
func (*Data) IsDeveloperModeEnabled ¶
IsDeveloperModeEnabled returns if development related features (as set via default, config file, or environment variable), e.g. token generation endpoint are enabled
func (*Data) IsLogJSON ¶
IsLogJSON returns if we should log json format (as set via config file or environment variable)