docker匿名Token缓存

This commit is contained in:
user123456
2025-06-11 14:18:49 +08:00
parent 08415b4034
commit a2550bc80e
4 changed files with 166 additions and 1 deletions

View File

@@ -47,6 +47,12 @@ type AppConfig struct {
// 新增Registry映射配置
Registries map[string]RegistryMapping `toml:"registries"`
// Token缓存配置
TokenCache struct {
Enabled bool `toml:"enabled"` // 是否启用token缓存
DefaultTTL string `toml:"defaultTTL"` // 默认缓存时间
} `toml:"tokenCache"`
}
var (
@@ -118,6 +124,13 @@ func DefaultConfig() *AppConfig {
Enabled: true,
},
},
TokenCache: struct {
Enabled bool `toml:"enabled"`
DefaultTTL string `toml:"defaultTTL"`
}{
Enabled: true, // docker认证的匿名Token缓存配置用于提升性能
DefaultTTL: "20m",
},
}
}