Validate validates the
()
| 139 | |
| 140 | // Validate validates the |
| 141 | func (config AuditLogS3Config) Validate() error { |
| 142 | if config.Local == "" { |
| 143 | return newError("local", "empty local storage directory provided") |
| 144 | } |
| 145 | stat, err := os.Stat(config.Local) |
| 146 | if err != nil { |
| 147 | return wrapWithMessage(err, "local", "invalid local directory: %s", config.Local) |
| 148 | } |
| 149 | if !stat.IsDir() { |
| 150 | return newError("local", "invalid local directory: %s (not a directory)", config.Local) |
| 151 | } |
| 152 | if config.AccessKey == "" { |
| 153 | return newError("accessKey", "no access key provided") |
| 154 | } |
| 155 | if config.SecretKey == "" { |
| 156 | return newError("secretKey", "no secret key provided") |
| 157 | } |
| 158 | if config.Bucket == "" { |
| 159 | return newError("bucket", "no bucket name provided") |
| 160 | } |
| 161 | if config.UploadPartSize < 5242880 { |
| 162 | return newError("uploadPartSize", "upload part size too low %d (minimum 5 MB)", config.UploadPartSize) |
| 163 | } |
| 164 | if config.ParallelUploads < 1 { |
| 165 | return newError("parallelUploads", "parallel uploads invalid: %d (must be positive)", config.ParallelUploads) |
| 166 | } |
| 167 | return nil |
| 168 | } |
| 169 | |
| 170 | // AuditLogS3Metadata AuditLogS3Metadata configuration for the S3 storage |
| 171 | type AuditLogS3Metadata struct { |
nothing calls this directly
no test coverage detected