diff --git a/context_cache.go b/context_cache.go index cfe4f17f..1bc22884 100644 --- a/context_cache.go +++ b/context_cache.go @@ -6,7 +6,7 @@ package xorm // ContextCache is the interface that operates the cache data. type ContextCache interface { - // Put puts value into cache with key and expire time. + // Put puts value into cache with key. Put(key string, val interface{}) // Get gets cached value by given key. Get(key string) interface{} @@ -14,14 +14,17 @@ type ContextCache interface { type memoryContextCache map[string]interface{} +// NewMemoryContextCache return memoryContextCache func NewMemoryContextCache() memoryContextCache { return make(map[string]interface{}) } +// Put puts value into cache with key. func (m memoryContextCache) Put(key string, val interface{}) { m[key] = val } +// Get gets cached value by given key. func (m memoryContextCache) Get(key string) interface{} { return m[key] }