mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-25 05:28:20 -05:00
use yaml tag instead of ocisConfig
This commit is contained in:
+14
-14
@@ -8,30 +8,30 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
Events Events `ocisConfig:"events"`
|
||||
Auditlog Auditlog `ocisConfig:"auditlog"`
|
||||
Events Events `yaml:"events"`
|
||||
Auditlog Auditlog `yaml:"auditlog"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// Events combines the configuration options for the event bus.
|
||||
type Events struct {
|
||||
Endpoint string `ocisConfig:"events_endpoint" env:"AUDIT_EVENTS_ENDPOINT" desc:"the address of the streaming service"`
|
||||
Cluster string `ocisConfig:"events_cluster" env:"AUDIT_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"`
|
||||
ConsumerGroup string `ocisConfig:"events_group" env:"AUDIT_EVENTS_GROUP" desc:"the customergroup of the service. One group will only get one vopy of an event"`
|
||||
Endpoint string `yaml:"events_endpoint" env:"AUDIT_EVENTS_ENDPOINT" desc:"the address of the streaming service"`
|
||||
Cluster string `yaml:"events_cluster" env:"AUDIT_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"`
|
||||
ConsumerGroup string `yaml:"events_group" env:"AUDIT_EVENTS_GROUP" desc:"the customergroup of the service. One group will only get one vopy of an event"`
|
||||
}
|
||||
|
||||
// Auditlog holds audit log information
|
||||
type Auditlog struct {
|
||||
LogToConsole bool `ocisConfig:"log_to_console" env:"AUDIT_LOG_TO_CONSOLE" desc:"logs to Stdout if true"`
|
||||
LogToFile bool `ocisConfig:"log_to_file" env:"AUDIT_LOG_TO_FILE" desc:"logs to file if true"`
|
||||
FilePath string `ocisConfig:"filepath" env:"AUDIT_FILEPATH" desc:"filepath to the logfile. Mandatory if LogToFile is true"`
|
||||
Format string `ocisConfig:"format" env:"AUDIT_FORMAT" desc:"log format. using json is advised"`
|
||||
LogToConsole bool `yaml:"log_to_console" env:"AUDIT_LOG_TO_CONSOLE" desc:"logs to Stdout if true"`
|
||||
LogToFile bool `yaml:"log_to_file" env:"AUDIT_LOG_TO_FILE" desc:"logs to file if true"`
|
||||
FilePath string `yaml:"filepath" env:"AUDIT_FILEPATH" desc:"filepath to the logfile. Mandatory if LogToFile is true"`
|
||||
Format string `yaml:"format" env:"AUDIT_FORMAT" desc:"log format. using json is advised"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"AUDIT_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"AUDIT_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"AUDIT_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"AUDIT_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"AUDIT_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"AUDIT_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"AUDIT_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"AUDIT_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user