refactor: remove usless options (#5671)

refactor: remove useless options
This commit is contained in:
hongming
2023-05-10 14:01:46 +08:00
committed by GitHub
parent e140fb387c
commit fafe98b4f0
13 changed files with 208 additions and 106 deletions

View File

@@ -32,9 +32,7 @@ import (
var ErrNoSuchKey = errors.New("no such key")
const (
typeInMemoryCache = "InMemoryCache"
DefaultCacheType = typeInMemoryCache
TypeInMemoryCache = "InMemoryCache"
defaultCleanupPeriod = 2 * time.Hour
)
@@ -176,12 +174,11 @@ type inMemoryCacheFactory struct {
}
func (sf *inMemoryCacheFactory) Type() string {
return typeInMemoryCache
return TypeInMemoryCache
}
func (sf *inMemoryCacheFactory) Create(options options.DynamicOptions, stopCh <-chan struct{}) (Interface, error) {
var sOptions InMemoryCacheOptions
decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{
DecodeHook: mapstructure.StringToTimeDurationHookFunc(),
WeaklyTypedInput: true,