()
| 333 | } |
| 334 | |
| 335 | func (f *BucketFactory) initDataFiles() { |
| 336 | for _, data := range f.Spec.Data { |
| 337 | if data.DestPath == "" { |
| 338 | f.logger.Errorf("no dest_file provided for '%s'", f.Spec.Name) |
| 339 | continue |
| 340 | } |
| 341 | |
| 342 | if err := exprhelpers.FileInit(f.DataDir, data.DestPath, data.Type); err != nil { |
| 343 | f.logger.Errorf("unable to init data for file '%s': %s", data.DestPath, err) |
| 344 | } |
| 345 | |
| 346 | if data.Type == "regexp" { // cache only makes sense for regexp |
| 347 | if err := exprhelpers.RegexpCacheInit(data.DestPath, *data); err != nil { |
| 348 | f.logger.Error(err.Error()) |
| 349 | } |
| 350 | } |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | // LoadBucket validates and prepares a BucketFactory for runtime use (compile expressions, init processors, init data). |
| 355 | func (f *BucketFactory) LoadBucket() error { |
no test coverage detected