MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / Validate

Method Validate

config/auditlog.go:89–106  ·  view source on GitHub ↗

Validate checks the configuration to enable global configuration check.

()

Source from the content-addressed store, hash-verified

87
88// Validate checks the configuration to enable global configuration check.
89func (config *AuditLogConfig) Validate() error {
90 if !config.Enable {
91 return nil
92 }
93 if err := config.Format.Validate(); err != nil {
94 return wrap(err, "format")
95 }
96 if err := config.Storage.Validate(); err != nil {
97 return wrap(err, "storage")
98 }
99 switch config.Storage {
100 case AuditLogStorageFile:
101 return wrap(config.File.Validate(), "file")
102 case AuditLogStorageS3:
103 return wrap(config.S3.Validate(), "s3")
104 }
105 return nil
106}
107
108// AuditLogFileConfig is the configuration for the file storage.
109type AuditLogFileConfig struct {

Callers

nothing calls this directly

Calls 2

wrapFunction · 0.85
ValidateMethod · 0.65

Tested by

no test coverage detected