1 Star 0 Fork 0

countpoison / xorm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
context_cache.go 841 Bytes
一键复制 编辑 原始数据 按行查看 历史
Unknown 提交于 2020-03-30 14:24 . Move some codes to statement sub package
// Copyright 2018 The Xorm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package contexts
// ContextCache is the interface that operates the cache data.
type ContextCache interface {
// Put puts value into cache with key.
Put(key string, val interface{})
// Get gets cached value by given key.
Get(key string) 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]
}
Go
1
https://gitee.com/countpoison_admin/xorm.git
git@gitee.com:countpoison_admin/xorm.git
countpoison_admin
xorm
xorm
57e9f1759726

搜索帮助