refactor config cache

This commit is contained in:
Darien Raymond committed 2016-09-21 13:52:16 +02:00
1 parent d38e62932d
commit 8f6a972970
6 files changed
+63 -38

No files matched your search

+6 -6
View File
@@ -10,21 +10,21 @@ import (
)
type JSONConfigLoader struct {
*BaseConfigLoader
cache ConfigCreatorCache
idKey string
configKey string
}
func NewJSONConfigLoader(idKey string, configKey string) *JSONConfigLoader {
func NewJSONConfigLoader(cache ConfigCreatorCache, idKey string, configKey string) *JSONConfigLoader {
return &JSONConfigLoader{
idKey: idKey,
configKey: configKey,
BaseConfigLoader: NewBaseConfigLoader(),
idKey: idKey,
configKey: configKey,
cache: cache,
}
}
func (this *JSONConfigLoader) LoadWithID(raw []byte, id string) (interface{}, error) {
config, err := this.CreateConfig(id)
config, err := this.cache.CreateConfig(id)
if err != nil {
return nil, err
}