use yaml tag instead of ocisConfig

This commit is contained in:
Willy Kloucek
2022-03-29 15:06:58 +02:00
parent 58b3bdf570
commit e224ce03cf
84 changed files with 851 additions and 851 deletions
+10 -10
View File
@@ -8,19 +8,19 @@ import (
// Config combines all available configuration parts.
type Config struct {
*shared.Commons `ocisConfig:"-" yaml:"-"`
*shared.Commons `yaml:"-"`
Service Service `ocisConfig:"-" yaml:"-"`
Service Service `yaml:"-"`
Tracing *Tracing `ocisConfig:"tracing"`
Log *Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
Tracing *Tracing `yaml:"tracing"`
Log *Log `yaml:"log"`
Debug Debug `yaml:"debug"`
HTTP HTTP `ocisConfig:"http"`
HTTP HTTP `yaml:"http"`
OcisPublicURL string `ocisConfig:"ocis_public_url" env:"OCIS_URL;OCIS_PUBLIC_URL"`
WebdavNamespace string `ocisConfig:"webdav_namespace" env:"STORAGE_WEBDAV_NAMESPACE"` //TODO: prevent this cross config
RevaGateway string `ocisConfig:"reva_gateway" env:"REVA_GATEWAY"`
OcisPublicURL string `yaml:"ocis_public_url" env:"OCIS_URL;OCIS_PUBLIC_URL"`
WebdavNamespace string `yaml:"webdav_namespace" env:"STORAGE_WEBDAV_NAMESPACE"` //TODO: prevent this cross config
RevaGateway string `yaml:"reva_gateway" env:"REVA_GATEWAY"`
Context context.Context `ocisConfig:"-" yaml:"-"`
Context context.Context `yaml:"-"`
}
+4 -4
View File
@@ -2,8 +2,8 @@ package config
// Debug defines the available debug configuration.
type Debug struct {
Addr string `ocisConfig:"addr" env:"WEBDAV_DEBUG_ADDR"`
Token string `ocisConfig:"token" env:"WEBDAV_DEBUG_TOKEN"`
Pprof bool `ocisConfig:"pprof" env:"WEBDAV_DEBUG_PPROF"`
Zpages bool `ocisConfig:"zpages" env:"WEBDAV_DEBUG_ZPAGES"`
Addr string `yaml:"addr" env:"WEBDAV_DEBUG_ADDR"`
Token string `yaml:"token" env:"WEBDAV_DEBUG_TOKEN"`
Pprof bool `yaml:"pprof" env:"WEBDAV_DEBUG_PPROF"`
Zpages bool `yaml:"zpages" env:"WEBDAV_DEBUG_ZPAGES"`
}
+8 -8
View File
@@ -2,16 +2,16 @@ package config
// CORS defines the available cors configuration.
type CORS struct {
AllowedOrigins []string `ocisConfig:"allowed_origins"`
AllowedMethods []string `ocisConfig:"allowed_methods"`
AllowedHeaders []string `ocisConfig:"allowed_headers"`
AllowCredentials bool `ocisConfig:"allow_credentials"`
AllowedOrigins []string `yaml:"allowed_origins"`
AllowedMethods []string `yaml:"allowed_methods"`
AllowedHeaders []string `yaml:"allowed_headers"`
AllowCredentials bool `yaml:"allow_credentials"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `ocisConfig:"addr" env:"WEBDAV_HTTP_ADDR"`
Namespace string `ocisConfig:"-" yaml:"-"`
Root string `ocisConfig:"root" env:"WEBDAV_HTTP_ROOT"`
CORS CORS `ocisConfig:"cors"`
Addr string `yaml:"addr" env:"WEBDAV_HTTP_ADDR"`
Namespace string `yaml:"-"`
Root string `yaml:"root" env:"WEBDAV_HTTP_ROOT"`
CORS CORS `yaml:"cors"`
}
+1 -1
View File
@@ -2,5 +2,5 @@ package config
// Service defines the available service configuration.
type Service struct {
Name string `ocisConfig:"-" yaml:"-"`
Name string `yaml:"-"`
}
+4 -4
View File
@@ -2,8 +2,8 @@ package config
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;WEBDAV_TRACING_ENABLED"`
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;WEBDAV_TRACING_TYPE"`
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;WEBDAV_TRACING_ENDPOINT"`
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;WEBDAV_TRACING_COLLECTOR"`
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;WEBDAV_TRACING_ENABLED"`
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;WEBDAV_TRACING_TYPE"`
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;WEBDAV_TRACING_ENDPOINT"`
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;WEBDAV_TRACING_COLLECTOR"`
}