Documentation
¶
Overview ¶
Package cache 开始全系统增加缓存功能 @since 0.0.4
Index ¶
- Variables
- func Get(preKey CacheKeyPrefix, key string) (interface{}, bool)
- func GetNavMenu(termID uint64) (*model.NavMenu, error)
- func GetOption(k string) string
- func GetPost(id uint64) (*model.DBPost, error)
- func GetPostmetas(postID uint64) (map[string]model.DBPostmeta, error)
- func GetTerm(termID uint64) (*model.DBTerm, error)
- func GetTermTaxonomy(termID uint64) (*model.DBTermTaxonomy, error)
- func Register()
- func Set(preKey CacheKeyPrefix, key string, value interface{})
- type CacheKeyPrefix
Constants ¶
This section is empty.
Variables ¶
View Source
var Cache *cache.Cache
Cache 缓存的全局变量 @since 0.0.4
View Source
var (
CacheOpen bool
)
CacheOpen debug 模式不开启缓存 @since 0.0.4
Functions ¶
func Get ¶
func Get(preKey CacheKeyPrefix, key string) (interface{}, bool)
Get 获取缓存的二次封装方法 @since 0.0.4
func GetNavMenu ¶ added in v0.0.6
GetNavMenu termID 通过缓存的形式获取菜单组信息 @since0.0.6
func GetPostmetas ¶
func GetPostmetas(postID uint64) (map[string]model.DBPostmeta, error)
GetPostmetas post_id @since 0.0.4
func GetTermTaxonomy ¶
func GetTermTaxonomy(termID uint64) (*model.DBTermTaxonomy, error)
GetTermTaxonomy term_id @since 0.0.4
func Set ¶
func Set(preKey CacheKeyPrefix, key string, value interface{})
Set 方便操作的设置缓存 @since 0.0.4
Types ¶
type CacheKeyPrefix ¶
type CacheKeyPrefix string
CacheKeyPrefix 缓存 Key 前缀 @since 0.0.4
const ( // DBOptions options DBOptions CacheKeyPrefix = "options_" DBTermTaxonomy CacheKeyPrefix = "term_taxonomy_" DBPost CacheKeyPrefix = "posts_" DBTerm CacheKeyPrefix = "terms_" DBPostmeta CacheKeyPrefix = "postmeta_" )
@since 0.0.4
Click to show internal directories.
Click to hide internal directories.