This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
package config
|
||||
|
||||
import "time"
|
||||
|
||||
func Default() Cfg {
|
||||
return Cfg{
|
||||
Image: &ImageConfig{
|
||||
Concurency: 10,
|
||||
Quality: 80,
|
||||
Concurency: 10,
|
||||
Quality: 80,
|
||||
CacheLifetime: time.Hour * 24 * 31,
|
||||
},
|
||||
Tracking: &UmamiConfig{
|
||||
ScriptSrc: "https://umami.schreifuchs.ch/script.js",
|
||||
|
||||
@@ -3,6 +3,7 @@ package config
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
"time"
|
||||
|
||||
"github.com/sethvargo/go-envconfig"
|
||||
)
|
||||
@@ -36,8 +37,9 @@ type ValkeyConfig struct {
|
||||
}
|
||||
|
||||
type ImageConfig struct {
|
||||
Concurency int64 `env:"CONCURENCY"`
|
||||
Quality int `env:"QUALITY"`
|
||||
Concurency int64 `env:"CONCURENCY"`
|
||||
Quality int `env:"QUALITY"`
|
||||
CacheLifetime time.Duration `env:"CACHE_LIFETIME"`
|
||||
}
|
||||
|
||||
type UmamiConfig struct {
|
||||
@@ -54,6 +56,7 @@ func Read(ctx context.Context) (cfg Cfg, err error) {
|
||||
// overridden.
|
||||
DefaultDelimiter: ";",
|
||||
DefaultSeparator: "@",
|
||||
DefaultOverwrite: true,
|
||||
|
||||
Lookuper: envconfig.MultiLookuper(secretLookuper(), envconfig.OsLookuper()),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user