feat: refactor the dynamic json configs for api_keys and external_backends (#2055)

* feat: refactor the dynamic json configs for api_keys and external_backends

Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com>

* fix: remove commented code

Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com>

---------

Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com>
Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
This commit is contained in:
cryptk 2024-04-17 22:21:55 -05:00 committed by GitHub
parent e9f090257c
commit 502c1eedaa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 117 additions and 62 deletions

View file

@ -22,6 +22,7 @@ type ApplicationConfig struct {
AudioDir string
UploadDir string
ConfigsDir string
DynamicConfigsDir string
CORS bool
PreloadJSONModels string
PreloadModelsFromPath string
@ -264,6 +265,12 @@ func WithConfigsDir(configsDir string) AppOption {
}
}
func WithDynamicConfigDir(dynamicConfigsDir string) AppOption {
return func(o *ApplicationConfig) {
o.DynamicConfigsDir = dynamicConfigsDir
}
}
func WithApiKeys(apiKeys []string) AppOption {
return func(o *ApplicationConfig) {
o.ApiKeys = apiKeys