evaluateURLs evaluates urls using the current configuration..
()
| 95 | |
| 96 | // evaluateURLs evaluates urls using the current configuration.. |
| 97 | func (cfg *ExternalMatchConfig) evaluateURLs() []string { |
| 98 | var args []interface{} |
| 99 | if cfg.DateTimeLayout != "" { |
| 100 | now := time.Now().Add(-time.Duration(cfg.TimeSubtract)) |
| 101 | args = append(args, now.Format(cfg.DateTimeLayout)) |
| 102 | } |
| 103 | |
| 104 | ret := make([]string, 0, len(cfg.Files)) |
| 105 | for _, u := range cfg.Files { |
| 106 | ret = append(ret, fmt.Sprintf(u, args...)) |
| 107 | } |
| 108 | return ret |
| 109 | } |
| 110 | |
| 111 | func NewExternalMatch(cfg baker.FilterParams) (baker.Filter, error) { |
| 112 | dcfg := cfg.DecodedConfig.(*ExternalMatchConfig) |