chore: better config
/ publish (push) Successful in 3m1s

This commit is contained in:
2026-03-07 20:55:04 +01:00
parent fca1030e1a
commit eab7eb3879
5 changed files with 24 additions and 4 deletions
+10
View File
@@ -0,0 +1,10 @@
package config
func Default() Cfg {
return Cfg{
Image: &ImageConfig{
Concurency: 10,
Quality: 80,
},
}
}
+7
View File
@@ -9,6 +9,7 @@ import (
type Cfg struct {
FileSystem *WebdavConfig `env:", prefix=FILESYSTEM_"`
Cache *ValkeyConfig `env:", prefix=CACHE_"`
Image *ImageConfig `env:", prefix=IMAGE_"`
}
type WebdavConfig struct {
@@ -30,7 +31,13 @@ type ValkeyConfig struct {
InitAddress []string `env:"ADDRESS"`
}
type ImageConfig struct {
Concurency int64 `env:"CONCURENCY"`
Quality int `env:"QUALITY"`
}
func Read(ctx context.Context) (cfg Cfg, err error) {
cfg = Default()
err = envconfig.ProcessWith(ctx, &envconfig.Config{
Target: &cfg,