Feature: TLS and HTTP/2 (#39)

This commit is contained in:
yas-nyan
2022-03-27 03:47:16 +09:00
committed by GitHub
parent 22f21a270b
commit 86763bd3aa
4 changed files with 45 additions and 2 deletions

View File

@ -25,6 +25,11 @@ type Config struct {
DatabasePassword string `mapstructure:"database_password"`
DatabaseFile string `mapstructure:"database_file"`
EnableHTTP2 bool `mapstructure:"enable_http2"`
EnableTLS bool `mapstructure:"enable_tls"`
TLSCertFile string `mapstructure:"tls_cert_file"`
TLSKeyFile string `mapstructure:"tls_key_file"`
}
var (
@ -44,6 +49,8 @@ func init() {
viper.SetDefault("database_hostname", "localhost")
viper.SetDefault("database_name", "speedtest")
viper.SetDefault("database_username", "postgres")
viper.SetDefault("enable_tls", false)
viper.SetDefault("enable_http2", false)
viper.SetConfigName("settings")
viper.AddConfigPath(".")