cachestorectl package #11
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
introducing new
cachestorectl
package andcachestore.Backend
type which lets us specify a backend cachestore, and where we can defer the opening of the store in some later part of the code. We also also override options at opening, or set the defaults on the backend.This is useful for situations where in your program you want to init the cachestore.Backend, depending on the config it might be memlru or redis (or other), and then later in your program you want to pass the cachestore.Backend without specifying the actually
Store[V]
type, and instantiating the store later. The main benefit is for generics / type-safety, so you can open the backend with any kind of type depending on which type the part of your code wants to cache.