Files
alfred-be/alfred/config/http_config.go
2026-03-08 16:14:42 +05:30

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"),
}
}