Versioned cache adds a version prefix to the keys. This allows cache keys to be changed in a newer version of the code (after a bugfix or a cached data format change).
| 15 | // Versioned cache adds a version prefix to the keys. |
| 16 | // This allows cache keys to be changed in a newer version of the code (after a bugfix or a cached data format change). |
| 17 | type Versioned struct { |
| 18 | cache Cache |
| 19 | logger log.Logger |
| 20 | versionPrefix string |
| 21 | } |
| 22 | |
| 23 | // NewVersioned creates a new Versioned cache. |
| 24 | func NewVersioned(c Cache, version uint, logger log.Logger) *Versioned { |
nothing calls this directly
no outgoing calls
no test coverage detected