cache

package
v0.6.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearCommonCache

func ClearCommonCache(subjectType string)

清理通用缓存

func ClearPageCache added in v0.6.0

func ClearPageCache(subjectType string)

清理新增/更新/删除操作时该分类首页缓存

func DeleteCache

func DeleteCache(key string)

删除缓存项

func GetCache

func GetCache(key string) (interface{}, bool)

获取缓存项

func SetCache

func SetCache(key string, value interface{}, duration ...time.Duration)

设置缓存项

Types

type CacheItem

type CacheItem struct {
	Value      interface{}
	Expiration time.Time
}

首页缓存: home:{subject_type} 首页总结缓存: home_summary:{subject_type} 分类首页缓存: page:{subject_type}:{status}:{sort_by} 分类总数缓存: count:{subject_type} 条目缓存: subject:{uuid} 搜索缓存: search:{query_key}:{page} 搜索总数缓存: count:search:{query_key}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL