Documentation
¶
Index ¶
- func SequenceGet() string
- type CacheInfo
- type CachePool
- func (cp CachePool) Add(cacheInfo *CacheInfo) (bool, string, interface{})
- func (cp CachePool) AddData(Id string, data interface{}) (bool, string, interface{})
- func (cp CachePool) Clear() (bool, string, interface{})
- func (cp CachePool) Contains(Id string) bool
- func (cp CachePool) Find(Id string) *CacheInfo
- func (cp CachePool) FindData(Id string) interface{}
- func (cp CachePool) Free(Id string) (bool, string, interface{})
- func (cp CachePool) FreeByData(data interface{}) (bool, string, interface{})
- func (cp CachePool) FreeById(Id string) (bool, string, interface{})
- func (cp CachePool) FreeByTime(iMinute int) (bool, string, interface{})
- type CacheTxtUtil
- func (ctu CacheTxtUtil) CreateCacheFile(object interface{}, sCacheFile string) (bool, string, interface{})
- func (ctu CacheTxtUtil) CreateCacheFileByList(list []interface{}, sCacheFile string) (bool, string, interface{})
- func (ctu CacheTxtUtil) DelCacheFile(sCacheFile string) (bool, string, interface{})
- func (ctu CacheTxtUtil) ReadCacheFile(sCacheFile ...string) []interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheInfo ¶
type CacheInfo struct { Id string `json:"Id"` //编号,作为关键字存在 Data interface{} `json:"Data"` //缓存的数据对象 CreateDate time.Time `json:"CreateDate"` //创建时间 LastDate time.Time `json:"LastDate"` //最后访问时间 }
用于定义缓存信息的类
type CachePool ¶
type CachePool struct{}
自定义缓存池
func (CachePool) Add ¶
* * 添加缓存 * @param cacheInfo * @return
func (CachePool) AddData ¶
* * 添加缓存 * @param Id * @param oData * @return
func (CachePool) Contains ¶
* * 判断是否包含缓存,包含返回true * @param Id * @return
func (CachePool) Find ¶
* * 查找缓存信息 * @param Id * @return
func (CachePool) FindData ¶
* * 查找缓存对象 * @param Id * @return
func (CachePool) Free ¶
* * 释放缓存 * @param Id * @return
func (CachePool) FreeByData ¶
* * 释放缓存 * @param Id * @return
func (CachePool) FreeById ¶
* * 释放缓存 * @param Id * @return
type CacheTxtUtil ¶
type CacheTxtUtil struct{}
func (CacheTxtUtil) CreateCacheFile ¶
func (ctu CacheTxtUtil) CreateCacheFile(object interface{}, sCacheFile string) (bool, string, interface{})
*
- 创建缓存文件
- @param object 待存储数据对象
- @param sCacheFile 缓存文件路径及文件名
- @return
func (CacheTxtUtil) CreateCacheFileByList ¶
func (ctu CacheTxtUtil) CreateCacheFileByList(list []interface{}, sCacheFile string) (bool, string, interface{})
*
- 创建缓存文件
- @param list 数据集合
- @param sCacheFile 缓存文件路径及文件名
- @return
func (CacheTxtUtil) DelCacheFile ¶
func (ctu CacheTxtUtil) DelCacheFile(sCacheFile string) (bool, string, interface{})
*
- 删除缓存文件
- @param sCacheFile
func (CacheTxtUtil) ReadCacheFile ¶
func (ctu CacheTxtUtil) ReadCacheFile(sCacheFile ...string) []interface{}
*
- 读取缓存文件
- @param sCacheFile 缓存文件路径及文件名
- @return
Source Files
¶
- CacheInfo.go
- CachePool.go
- CacheTxtUtil.go
- SequenceUtil.go
Click to show internal directories.
Click to hide internal directories.