configuration

package
v0.0.0-...-5b6bd79 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Package configuration is in charge of the validation and extraction of all the configuration details from a configuration file.

Index

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

func GetData() (*Data, error)

GetData is a wrapper over NewData which reads configuration file path from the environment variable.

func NewData

func NewData() (*Data, error)

NewData creates a configuration reader object using a configurable configuration file path

func (*Data) GetAuthServiceURL

func (c *Data) GetAuthServiceURL() string

GetAuthServiceURL return the base Auth API URL

func (*Data) GetDevModePrivateKey

func (c *Data) GetDevModePrivateKey() []byte

GetDevModePrivateKey returns the private key and its ID used in tests

func (*Data) GetHTTPAddress

func (c *Data) GetHTTPAddress() string

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

func (c *Data) GetLogLevel() string

GetLogLevel returns the loggging level (as set via config file or environment variable)

func (*Data) GetMadrillAPIKey

func (c *Data) GetMadrillAPIKey() string

GetMadrillAPIKey returns the API key used by the email sender

func (*Data) GetMetricsHTTPAddress

func (c *Data) GetMetricsHTTPAddress() string

GetMetricsHTTPAddress returns the address the /metrics endpoing will be mounted. By default GetMetricsHTTPAddress is the same as GetHTTPAddress

func (*Data) GetServiceAccountID

func (c *Data) GetServiceAccountID() string

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

func (c *Data) GetServiceAccountSecret() string

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) GetWITURL

func (c *Data) GetWITURL() string

GetWITURL return the base WorkItemTracker API URL

func (*Data) GetWebURL

func (c *Data) GetWebURL() string

GetWebURL returns the base URL for the Web v

func (*Data) IsDeveloperModeEnabled

func (c *Data) IsDeveloperModeEnabled() bool

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

func (c *Data) IsLogJSON() bool

IsLogJSON returns if we should log json format (as set via config file or environment variable)

func (*Data) String

func (c *Data) String() string

String returns the current configuration as a string

func (*Data) Validate

func (c *Data) Validate() error

Jump to

Keyboard shortcuts

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