Added extra configs for TLS
package config
-import "github.com/kelseyhightower/envconfig"
+import (
+ "time"
+
+ "github.com/kelseyhightower/envconfig"
+)
// Specification for basic configurations
type Specification struct {
@@ -11,12 +15,29 @@ type Specification struct {
MaxIdleConnsPerHost int `envconfig:"MAX_IDLE_CONNS_PER_HOST"`
InsecureSkipVerify bool `envconfig:"INSECURE_SKIP_VERIFY"`
StorageDSN string `envconfig:"REDIS_DSN"`
+
+ // Path of certificate when using TLS
+ CertPathTLS string `envconfig:"CERT_PATH"`
+ // Path of key when using TLS
+ KeyPathTLS string `envconfig:"KEY_PATH"`
+
+ // Flush interval for upgraded Proxy connections
+ BackendFlushInterval time.Duration
+
+ // Defines the time period of how often the idle connections maintained
+ // by the proxy are closed.
+ CloseIdleConnsPeriod time.Duration
+
Database Database
Statsd Statsd
Credentials Credentials
Application Application
}
+func (s *Specification) IsHTTPS() bool {
+ return s.CertPathTLS != "" && s.KeyPathTLS != ""
+}
+
// Database holds the configuration for a database
type Database struct {
DSN string `envconfig:"DATABASE_DSN"`
