Documentation
¶
Index ¶
Constants ¶
View Source
const ( CurrentDir = "." ConfigDir = "./config" CmdDir = "../../config/" ConfigName = "config" FileExtension = "yaml" )
Default values and dirs
View Source
const ( TracingFlag = "tracing" MetricsFlag = "metrics" )
View Source
const ( EtcdAddress = "etcd.address" EtcdPrefix = "etcd.prefix" // Database DatabaseType = "database.type" DatabaseAddress = "database.host" DatabasePort = "database.port" DatabaseUsername = "database.username" DatabasePassword = "database.password" DatabaseName = "database.database" DatabaseReplicaSet = "database.replicaSet" DatabaseTLSEnabled = "database.tls.enabled" DatabaseTLSKeyPath = "database.tls.keyPath" DatabaseTLSCertPath = "database.tls.certPath" // HTTP server ServerAddress = "http.address" ServerPathPrefix = "http.pathPrefix" ServerTLSEnabled = "http.tls.enabled" ServerTLSKeyPath = "http.tls.keyPath" ServerTLSCertPath = "http.tls.certPath" // Metrics MetricsServerAddress = "observability.metrics.address" MetricsEnable = "observability.metrics.enable" MetricsEndpoint = "observability.metrics.endpoint" // Tracing TracingEnable = "observability.tracing.enable" TracingAddress = "observability.tracing.address" TracingAuth = "observability.tracing.auth" TracingTLSEnabled = "observability.tracing.tls.enabled" TracingTLSKeyPath = "observability.tracing.tls.keyPath" TracingTLSCertPath = "observability.tracing.tls.certPath" )
Variables ¶
This section is empty.
Functions ¶
func GetConfiguration ¶
GetConfiguration loads the configuration from Viper and validates it.
func InitConfig ¶
InitConfig initializes the configuration for the service, either from file or from ETCD (if ETCD was set).
func SetDefaults ¶
func SetDefaults(serviceName string)
SetDefaults sets the default values for the app configuration.
Types ¶
type Database ¶
type Database struct {
Type string `json:"type" yaml:"type" mapstructure:"type" required:""`
URI string `json:"uri,omitempty" yaml:"uri" mapstructure:"uri"`
Host string `json:"host,omitempty" yaml:"host" mapstructure:"host"`
Username string `json:"username,omitempty" yaml:"username" mapstructure:"username"`
Password string `json:"password,omitempty" yaml:"password" mapstructure:"password"`
Port int `json:"port,omitempty" yaml:"port" mapstructure:"port"`
Database string `json:"database,omitempty" yaml:"database" mapstructure:"database"`
ReplicaSet string `json:"replicaSet,omitempty" yaml:"replicaSet" mapstructure:"replicaSet"`
TLS tls.TLS `json:"tls" yaml:"tls" mapstructure:"tls"`
}
Primary Database configuration
type InfluxDB ¶
type InfluxDB struct {
URL string `yaml:"url" json:"url" mapstructure:"url"`
Organization string `yaml:"organization" json:"organization" mapstructure:"organization"`
Bucket string `yaml:"bucket" json:"bucket" mapstructure:"bucket"`
AccessToken string `yaml:"accessToken" json:"accessToken" mapstructure:"accessToken"`
TLS tls.TLS `mapstructure:"tls" yaml:"tls" json:"tls"`
}
InfluxDB database configuration with TLS
Click to show internal directories.
Click to hide internal directories.