review suggestions I

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2022-03-09 10:50:19 +01:00
parent 7c85fafb54
commit cb5e38f4cb
4 changed files with 15 additions and 17 deletions

View File

@@ -23,15 +23,15 @@ type Config struct {
// Events combines the configuration options for the event bus.
type Events struct {
Endpoint string `ocisConfig:"events_endpoint" env:"AUDIT_EVENTS_ENDPOINT"`
Cluster string `ocisConfig:"events_cluster" env:"AUDIT_EVENTS_CLUSTER"`
ConsumerGroup string `ocisConfig:"events_group" env:"AUDIT_EVENTS_GROUP"`
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"`
}
// Auditlog holds audit log information
type Auditlog struct {
LogToConsole bool `ocisConfig:"log_to_console" env:"AUDIT_LOG_TO_CONSOLE"`
LogToFile bool `ocisConfig:"log_to_file" env:"AUDIT_LOG_TO_FILE"`
FilePath string `ocisConfig:"filepath" env:"AUDIT_FILEPATH"`
Format string `ocisConfig:"format" env:"AUDIT_FORMAT"`
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"`
}

View File

@@ -2,8 +2,8 @@ package config
// Debug defines the available debug configuration.
type Debug struct {
Addr string `ocisConfig:"addr" env:"NOTIFICATIONS_DEBUG_ADDR"`
Token string `ocisConfig:"token" env:"NOTIFICATIONS_DEBUG_TOKEN"`
Pprof bool `ocisConfig:"pprof" env:"NOTIFICATIONS_DEBUG_PPROF"`
Zpages bool `ocisConfig:"zpages" env:"NOTIFICATIONS_DEBUG_ZPAGES"`
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"`
}

View File

@@ -2,8 +2,8 @@ package config
// Log defines the available log configuration.
type Log struct {
Level string `mapstructure:"level" env:"OCIS_LOG_LEVEL;NOTIFICATIONS_LOG_LEVEL"`
Pretty bool `mapstructure:"pretty" env:"OCIS_LOG_PRETTY;NOTIFICATIONS_LOG_PRETTY"`
Color bool `mapstructure:"color" env:"OCIS_LOG_COLOR;NOTIFICATIONS_LOG_COLOR"`
File string `mapstructure:"file" env:"OCIS_LOG_FILE;NOTIFICATIONS_LOG_FILE"`
Level string `mapstructure:"level" env:"OCIS_LOG_LEVEL;AUDIT_LOG_LEVEL"`
Pretty bool `mapstructure:"pretty" env:"OCIS_LOG_PRETTY;AUDIT_LOG_PRETTY"`
Color bool `mapstructure:"color" env:"OCIS_LOG_COLOR;AUDIT_LOG_COLOR"`
File string `mapstructure:"file" env:"OCIS_LOG_FILE;AUDIT_LOG_FILE"`
}

View File

@@ -20,7 +20,6 @@ import (
"github.com/olekukonko/tablewriter"
accounts "github.com/owncloud/ocis/accounts/pkg/command"
audit "github.com/owncloud/ocis/audit/pkg/command"
glauth "github.com/owncloud/ocis/glauth/pkg/command"
graphExplorer "github.com/owncloud/ocis/graph-explorer/pkg/command"
graph "github.com/owncloud/ocis/graph/pkg/command"
@@ -95,7 +94,6 @@ func NewService(options ...Option) (*Service, error) {
cfg: opts.Config,
}
s.ServicesRegistry["audit"] = audit.NewSutureService
s.ServicesRegistry["settings"] = settings.NewSutureService
s.ServicesRegistry["nats"] = nats.NewSutureService
s.ServicesRegistry["storage-metadata"] = storage.NewStorageMetadata