forked from gsn/predictor
feat: predictions
This commit is contained in:
parent
42e7924be9
commit
11be8f351f
42 changed files with 2221 additions and 516 deletions
|
|
@ -2,21 +2,27 @@ package service
|
|||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"git.intra.yksa.space/gsn/predictor/internal/pkg/grib"
|
||||
"git.intra.yksa.space/gsn/predictor/pkg/redis"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
// GRIB Configuration
|
||||
Grib grib.Config `envPrefix:"GRIB_"`
|
||||
// --- GRIB Configuration ---
|
||||
GribDir string `env:"GSN_PREDICTOR_GRIB_DIR" envDefault:"/tmp/grib"`
|
||||
GribTTL time.Duration `env:"GSN_PREDICTOR_GRIB_TTL" envDefault:"24h"`
|
||||
GribCacheTTL time.Duration `env:"GSN_PREDICTOR_GRIB_CACHE_TTL" envDefault:"1h"`
|
||||
GribParallel int `env:"GSN_PREDICTOR_GRIB_PARALLEL" envDefault:"4"`
|
||||
GribTimeout time.Duration `env:"GSN_PREDICTOR_GRIB_TIMEOUT" envDefault:"30s"`
|
||||
GribDatasetURL string `env:"GSN_PREDICTOR_GRIB_DATASET_URL" envDefault:"https://nomads.ncep.noaa.gov/pub/data/nccf/com/gfs/prod"`
|
||||
|
||||
// Redis Configuration
|
||||
Redis redis.Config `envPrefix:"REDIS_"`
|
||||
// --- Redis Configuration ---
|
||||
RedisHost string `env:"GSN_PREDICTOR_REDIS_HOST"`
|
||||
RedisPort int `env:"GSN_PREDICTOR_REDIS_PORT"`
|
||||
RedisPassword string `env:"GSN_PREDICTOR_REDIS_PASSWORD"`
|
||||
RedisDB int `env:"GSN_PREDICTOR_REDIS_DB"`
|
||||
}
|
||||
|
||||
func (c *Config) CreateHTTPClient() *http.Client {
|
||||
return &http.Client{
|
||||
Timeout: c.Grib.Timeout,
|
||||
Timeout: c.GribTimeout,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue