26 lines
695 B
Go
26 lines
695 B
Go
package config
|
|
|
|
import "github.com/spf13/viper"
|
|
|
|
type HttpConfig struct {
|
|
MaxIdleConnectionPool int
|
|
MaxConnection int
|
|
MaxTimeoutInSeconds int
|
|
}
|
|
|
|
func NewIngesterHttpConfig() *HttpConfig {
|
|
return &HttpConfig{
|
|
MaxIdleConnectionPool: viper.GetInt("http.max.idle.connection.pool"),
|
|
MaxConnection: viper.GetInt("http.max.connection"),
|
|
MaxTimeoutInSeconds: viper.GetInt("http.max.timeout.seconds"),
|
|
}
|
|
}
|
|
|
|
func NewCoreHttpConfig() *HttpConfig {
|
|
return &HttpConfig{
|
|
MaxIdleConnectionPool: viper.GetInt("http.max.idle.connection.pool"),
|
|
MaxConnection: viper.GetInt("http.max.connection"),
|
|
MaxTimeoutInSeconds: viper.GetInt("http.max.timeout.seconds"),
|
|
}
|
|
}
|