(s string)
| 52 | } |
| 53 | |
| 54 | func parsebytes(s string) (uint64, error) { |
| 55 | if len(s) == 0 { |
| 56 | return 0, nil |
| 57 | } |
| 58 | bytes, err := humanize.ParseBytes(s) |
| 59 | if err != nil { |
| 60 | return 0, errors.Wrap(err, "invalid FifoCache config") |
| 61 | } |
| 62 | return bytes, nil |
| 63 | } |
| 64 | |
| 65 | // FifoCache is a simple string -> interface{} cache which uses a fifo slide to |
| 66 | // manage evictions. O(1) inserts and updates, O(1) gets. |