use yaml tag instead of ocisConfig
This commit is contained in:
@@ -8,40 +8,40 @@ 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"`
|
||||
|
||||
GRPC GRPC `ocisConfig:"grpc"`
|
||||
HTTP HTTP `ocisConfig:"http"`
|
||||
GRPC GRPC `yaml:"grpc"`
|
||||
HTTP HTTP `yaml:"http"`
|
||||
|
||||
Thumbnail Thumbnail `ocisConfig:"thumbnail"`
|
||||
Thumbnail Thumbnail `yaml:"thumbnail"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// FileSystemStorage defines the available filesystem storage configuration.
|
||||
type FileSystemStorage struct {
|
||||
RootDirectory string `ocisConfig:"root_directory" env:"THUMBNAILS_FILESYSTEMSTORAGE_ROOT"`
|
||||
RootDirectory string `yaml:"root_directory" env:"THUMBNAILS_FILESYSTEMSTORAGE_ROOT"`
|
||||
}
|
||||
|
||||
// FileSystemSource defines the available filesystem source configuration.
|
||||
type FileSystemSource struct {
|
||||
BasePath string `ocisConfig:"base_path"`
|
||||
BasePath string `yaml:"base_path"`
|
||||
}
|
||||
|
||||
// Thumbnail defines the available thumbnail related configuration.
|
||||
type Thumbnail struct {
|
||||
Resolutions []string `ocisConfig:"resolutions"`
|
||||
FileSystemStorage FileSystemStorage `ocisConfig:"filesystem_storage"`
|
||||
WebdavAllowInsecure bool `ocisConfig:"webdav_allow_insecure" env:"OCIS_INSECURE;THUMBNAILS_WEBDAVSOURCE_INSECURE"`
|
||||
CS3AllowInsecure bool `ocisConfig:"cs3_allow_insecure" env:"OCIS_INSECURE;THUMBNAILS_CS3SOURCE_INSECURE"`
|
||||
RevaGateway string `ocisConfig:"reva_gateway" env:"REVA_GATEWAY"` //TODO: use REVA config
|
||||
FontMapFile string `ocisConfig:"font_map_file" env:"THUMBNAILS_TXT_FONTMAP_FILE"`
|
||||
TransferTokenSecret string `ocisConfig:"transfer_token" env:"THUMBNAILS_TRANSFER_TOKEN"`
|
||||
DataEndpoint string `ocisConfig:"data_endpoint" env:"THUMBNAILS_DATA_ENDPOINT"`
|
||||
Resolutions []string `yaml:"resolutions"`
|
||||
FileSystemStorage FileSystemStorage `yaml:"filesystem_storage"`
|
||||
WebdavAllowInsecure bool `yaml:"webdav_allow_insecure" env:"OCIS_INSECURE;THUMBNAILS_WEBDAVSOURCE_INSECURE"`
|
||||
CS3AllowInsecure bool `yaml:"cs3_allow_insecure" env:"OCIS_INSECURE;THUMBNAILS_CS3SOURCE_INSECURE"`
|
||||
RevaGateway string `yaml:"reva_gateway" env:"REVA_GATEWAY"` //TODO: use REVA config
|
||||
FontMapFile string `yaml:"font_map_file" env:"THUMBNAILS_TXT_FONTMAP_FILE"`
|
||||
TransferTokenSecret string `yaml:"transfer_token" env:"THUMBNAILS_TRANSFER_TOKEN"`
|
||||
DataEndpoint string `yaml:"data_endpoint" env:"THUMBNAILS_DATA_ENDPOINT"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"THUMBNAILS_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"THUMBNAILS_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"THUMBNAILS_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"THUMBNAILS_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"THUMBNAILS_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"THUMBNAILS_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"THUMBNAILS_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"THUMBNAILS_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ package config
|
||||
|
||||
// GRPC defines the available grpc configuration.
|
||||
type GRPC struct {
|
||||
Addr string `ocisConfig:"addr" env:"THUMBNAILS_GRPC_ADDR"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Addr string `yaml:"addr" env:"THUMBNAILS_GRPC_ADDR"`
|
||||
Namespace string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package config
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"THUMBNAILS_HTTP_ADDR"`
|
||||
Root string `ocisConfig:"root" env:"THUMBNAILS_HTTP_ROOT"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Addr string `yaml:"addr" env:"THUMBNAILS_HTTP_ADDR"`
|
||||
Root string `yaml:"root" env:"THUMBNAILS_HTTP_ROOT"`
|
||||
Namespace string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;THUMBNAILS_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;THUMBNAILS_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;THUMBNAILS_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;THUMBNAILS_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;THUMBNAILS_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;THUMBNAILS_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;THUMBNAILS_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;THUMBNAILS_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user