(table string, duration time.Duration)
| 17 | } |
| 18 | |
| 19 | func (td *TableDurations) Set(table string, duration time.Duration) { |
| 20 | d, ok := td.data.Get(table) |
| 21 | if !ok || duration > d { |
| 22 | // if not ok, add the duration |
| 23 | // if duration is greater than existing, update it |
| 24 | // else do nothing (keep the existing duration) |
| 25 | |
| 26 | td.data.Add(table, duration) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | func (td *TableDurations) GetAll() map[string]time.Duration { |
| 31 | return td.data.GetAll() |